05-30-2012 10:12 AM
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
05-31-2012 09:29 AM
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.
06-01-2012 01:37 AM
Thanks. I'll give that a try. And thanks for the warning of not officially being supported. I'll mark the code accordingly.
/Carl