LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to know programatically when LabVIEW has been paused?

This question has probably already been asked but couldn't quite find a solution to it with searching. I am running LabVIEW 8.5 and am wondering if there is a way to know when a user pauses the code. Thanks

 

Regards,

Anthony Maglio

0 Kudos
Message 1 of 17
(4,021 Views)
Are you saying that you want the code to do something when it's paused?
0 Kudos
Message 2 of 17
(4,009 Views)

I just want to be able to know if it has been paused or not. The reason is because, on occasion we will pause our code during a test and sometimes change instruments settings. I want my program to know if it has been paused so it can make sure to restore instrument settings regardless of what we have set manually.

0 Kudos
Message 3 of 17
(4,004 Views)

It sounds like you are distributing source code and the user is running the code in the development environment. Typically one does not do this. Typically one builds an application and delivers that. If you want the user to have the ability to "pause" the test then you'd provide that capability yourself by using a system architecture like a state machine. I have not checked, but it's possible that scripting may be able to tell you, but even then you'd have to have some sort of parallel VI (built into an app) running that continuously monitors to see if the development environment has been paused and then potentially use the VI Server to run your "reconfiguration" VI. Sounds like a kludgey approach to me.

Message 4 of 17
(3,993 Views)

The toolbar has no reason to be visible in an end-user application, so pausing a VI should not even be possible.

 

Make your program into a state machine, with one state being idle. Your code will know at all times if it is in the idle state.

 

EDIT: Saverio, I could not have said it better myself :D) 

0 Kudos
Message 5 of 17
(3,991 Views)

If you don't have the LabVIEW Application Builder, I would suggest disabling 'Show toolbar when running" Under VI Proerties -> Window Appearance -> Custom. The users will not see the toolbar and will not be able to 'pause' the application.

 

Add your own pause button and state in your code and perform the steps necessary when a pause has occurred.

 

Manually changing the configuration of an instrument during a test effectively renders the results invalid. If you need to prevent the operators from tinkering during the test, some GPIB instruments support a LLO (Local Lock-Out) mode that can be configured to disable and enable the instrument's keypad.

 

 

0 Kudos
Message 6 of 17
(3,950 Views)

So, back to the original question, which actually raises some questions:

 

(1) First of course, the program cannot detect its own paused state, because, well, it's paused so it cannot do anything at the moment!

 

(2) This leaves us the possibility of an externally running "watchdog VI" that monitors the state of the original VI in memory and will take appropriate action under some conditions. If scripting is enabled, there is a boolean property "is VI paused?". This should work!

0 Kudos
Message 7 of 17
(3,924 Views)

Hi,

 

one more possibility:

When the VI itself should only check if it has been paused it could use a simple parallel loop for doing the watchdog.

In case of pausing the VI the iteration time of the parallel loop should be changed from normal behaviour...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 17
(3,908 Views)

Gerd,

 

I think we are talking about the pause button on the tool bar, a debugging tool.

 

If the VI is paused, any loop will be paused so I don't see how this should work.

0 Kudos
Message 9 of 17
(3,904 Views)

If you really want to you could take time stamps every so often and compare the current and the last one. Any large deltas could suggest a pause condition.

-Nate
0 Kudos
Message 10 of 17
(3,877 Views)