From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automated sequenced tasks

Solved!
Go to solution

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! 

0 Kudos
Message 1 of 3
(1,967 Views)
Solution
Accepted by topic author L_Carvalho

Hi L,

 

use a state machine approach instead!

I could imagine states like

  1. INIT: initialize the device communication
  2. SET-Temp: set a new temperature setpoint
  3. WAIT-for-Temp: waits until the setpoint has been reached
  4. EXIT: end device communication, cleanup, exit the program

You can cylce between state 2 and 3 as often as you like…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(1,923 Views)
Solution
Accepted by topic author L_Carvalho

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.

 

 


GCentral
Message 3 of 3
(1,902 Views)