VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Detect if Workspace is in Edit or Run mode

I am looking for a way to detect when the workspace switches from Run mode to Edit mode and the other way around. My primary interest is in a custom control based on Free Label. I have only seen the event that notifies you if the workspace is closing or the control is left clicked (show configuration dialog). I would like the control to change appearance when the workspace changes modes.

 

Any suggestions on how to get this information? Preferably as an event, but a solution using polling would work also.

 

If the information is not available to a control but is available to a service, then that could also work since the control and the service could communicate.

 

Thanks,

Carl

0 Kudos
Message 1 of 3
(5,492 Views)

Unfortunately there is no supported way to do this. There is a work around, but since it isn't supported you might find it doesn't work or changes in future releases.

 

If you drop a call library function node and pick "NIVeriStand_lvhook.dll" one of the functions is GetMode. it has no arguments and the return type is uint32 and must be called with C calling convention in "any thread". If the return is 1, you're in run mode. if return is 2, you're in edit mode.

Stephen B
0 Kudos
Message 2 of 3
(5,475 Views)

Thanks. I'll give that a try. And thanks for the warning of not officially being supported. I'll mark the code accordingly.

 

/Carl

0 Kudos
Message 3 of 3
(5,464 Views)