LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best approach for a start/pause/stop test program?

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

0 Kudos
Message 1 of 7
(3,355 Views)

Hi Rich,

 

read about statemachines and how they are implemented in LabVIEW.

This will be a great help on your question!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,321 Views)

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



 

0 Kudos
Message 3 of 7
(3,301 Views)

Thanks for the responses so far - 2012 code attached

Download All
0 Kudos
Message 4 of 7
(3,295 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(3,232 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 7
(3,207 Views)

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

 

 

Message 7 of 7
(3,117 Views)