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