07-21-2015 03:26 AM
Hello all,
I'm creating a life test VI which works by configuring an array of connected Modbus devices then running a test cycle of three operational modes of the product (full cold, blend and disinfection).
The main VI needs to be able to run, pause and stop the test, at whatever point it is at in the cycle:
1) Run - either start from the beginning if not already started. If already started, re-commence from where the loop was paused
2) Pause - Stop the test cycle at whatever point it is currently at and be able to resume again
3) Stop - Stop the test cycle completely and reset everything.
In addition, there will be some live readout charts/indicators to show the user the current operational state which are reading registers over Modbus from the product periodically (1/sec)
I'm struggling a little with the best way to handle the Run/Pause/Stop commands. At the moment I am using a producer/consumer loop but once the sequence starts with the Run button I can't figure out how to pause it at the current position and it's just running until the end of the cycle. Button presses of the Pause/Stop are queued but aren't immediately handled.
Does anyone have any suggestions? I've attached the VI for reference.
Cheers!
Rich
07-21-2015 04:11 AM
07-21-2015 04:35 AM - edited 07-21-2015 04:37 AM
Hi Rich,
You can use global variables to perform these action in your program.
I am not able to view your code as you have done development in LV2014, kinldy downgrade the code to LV12 and upload the same.
Thanks
Pankaj
07-21-2015 04:40 AM
Thanks for the responses so far - 2012 code attached
07-21-2015 07:41 AM
State Machines inside of commanded states...not going to work well.
1. You should only have one state machine.
2. You will want to make your states a lot more modular (ie: do less in each of your states)
3. There is nothing wrong with your state machine adding states to the queue.
07-21-2015 08:37 AM - edited 07-21-2015 08:38 AM
@Pankajusic wrote:
Hi Rich,
You can use global variables to perform these action in your program.
I am not able to view your code as you have done development in LV2014, kinldy downgrade the code to LV12 and upload the same.
Thanks
Pankaj
How would you implement this? If it invovles constantly writing to as well as reading from globals, the advice ranges from "not advisable" to "downright dangerous", depending on the details of how you are implementing it... Write once/read many is the only way I use globals.
08-03-2015 10:33 AM
Hi richellis2001,
For the application you are trying to create, it is possible to use LabVIEW, however using TestStand would be a more efficient way of performing the tasks you are trying acheive. The TestStand sequencer editor is ideal for your application giving you the ability to run, pause and stop the test sequence, whilst also generating reports and enabling efficient data logging.
A 45 day free trial is available to enable you to see if this will meet your needs.
http://www.ni.com/teststand/download/
Regards,
Tom-S