06-11-2019 04:28 PM
Hi everybody, how's it going?
So, I am working on a code to control a circulating temperature bath (from PolyScience), and my ultimate goal is to be able to pre-set specific temperatures in which I want the bath to reach, so then I could set those and basically walk away from the device.
This device already has a LABVIEW driver where one can send set temperatures, but it only gives the option to do one temperature at a time (i.e. I have to manually type in the temperature, then hit the "send command" button, and then it would change).
My goal is to be able to predetermine a few temperatures in which the code would, then, automatically change the device to the next temperature once the previous one has been achieved by the device, creating automated sequenced tasks that would happen given a specific condition. Would you guys have any ideas?
A few explanations: "Send set command" would be the button to send the command, "numeric input" would be the numerical indicator of the temperature (both are side by side on the pictures)
Please see attached files for further reference. Let me know if something is unclear!
Thank you!
Solved! Go to Solution.
06-12-2019 01:29 AM
Hi L,
use a state machine approach instead!
I could imagine states like
You can cylce between state 2 and 3 as often as you like…
06-12-2019
07:39 AM
- last edited on
01-06-2025
10:19 AM
by
Content Cleaner
As GerdW suggested, a State Machine might be helpful for you here.
I'd also guess that what you posted is probably an example VI from the driver, or similar. It will become much simpler to use/reuse/reimplement yourself if you first create a copy of it and remove all of the code for different communication/wiring methods - e.g. if you're using RS232, get rid of the rest and only keep the cases that are evaluated for RS232 (I'd guess that's the 'Serial' set of cases).
If you want to do this yourself, you can drill into the (non-attached) driver VI, (Communication Driver.vi) and determine exactly what it's doing (I expect something like an "Action Engine"). You can then probably just pick the operations you need (Connect, Set Temp, Disconnect, etc) and implement them yourself in separate VIs which you call in parts of your State Machine or sequencer.