LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Halt programatically

Hi,
 
when I am running a VI, I have the posibility to halt the VI using the pause-button.
Is there a way to do this using property or invoke nodes (I found the ones to start and stop the VI - but yet none to halt the VI).
 
What I want to do is to halt a VI, if a I-O-communication does not work - and give the user the possibility to check the connections. He then can resume the programm by pressing the pause button manually...
 
Regards,
 
Frank
0 Kudos
Message 1 of 6
(3,133 Views)
I very good way to do this is through a state machine.
If IO fault or pause is presses goto pause state. then in the pause state, if not unpause return to pause state.
Easy eays to to this (but not as versitile as a state machine architecture) is through a blocking pause call such as a dialog box or a wait loop.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 6
(3,120 Views)

Hi Paul,

the problem is, that I have three seperate While-Loops running in parallel all with a Sequenz with quite a lot of cases. I would like to halt the hole program easily. If I understand your suggestion correctly, I would have to put a state maschine or a while-loop in every single case of the hole sequenz - and that would be a lot of work...

Therefore I am looking for something to controll the pause-button programatically...

Regards,

 

Frank

0 Kudos
Message 3 of 6
(3,114 Views)
Hi Sonnenkind,

with a state machine this would be very easy 🙂

And as mentioned in many other threads: it's not considered good programming practice to use 'sequences with lots of frames' (especially the stacked ones as they hide a lot of code)!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,106 Views)

Ideally, none of the buttons on the toolbar should be used during normal program execution. Their intended use is for development/debuggin and troubleshooting. This is why there is no way to control anyting on the toolbar (with the exception of font settings) from the block diagram.

Pauls suggestion of re-writing your applicaiton into a state machine and having a "Pause State" in your application is really the only way to go. Since you've used Sequence structures, it's going to be difficult to add this functionality into your current application. There might be something you can do using Notifiers and/or Queues to send messages to certain points in your application to implement a pause feature. But without seeing your code, it's difficult to say how easy this would be.

Ed



Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 5 of 6
(3,103 Views)

Each loop can still be in parallel and you can use a queued message passing state machine.   Now you can have 3 loosly coupled state machines, each of which will check a queue in a central state, each thread can send a message to anyother thread using the queue.  This is an architecture which I use in almost all of my applications, it is very flexable.  Very good for allowing multiple threads to run in parallel but still tightly controls the over all flow of execution. 

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 6
(3,085 Views)