09-28-2011 10:12 AM
Wanting to add an indicator (LED or Button) to a C# User Interface for TestStand that shows the state of a StationGlobals boolean (or FileGlobals) and the indicator changes when the boolean changes during execution of a test program. Is there a way to track a StationGlobals variable state change like this (other than reading the variable every n milliseconds)? Example code?
09-28-2011 10:47 AM
Rather than use a global, you could instead use a UIMessage. Your sequence would need to call Thread.PostUIMessage() (I recommend posting it synchronously - there's a parameter for this). You can use a message code UIMsg_UserMessageBase or higher, or use Engine.RegisterUIMessage() to generate a unique message code for your custom messages. Then in your UI you can handle the UIMessage event of the application manager to get the ui message and respond to it by changing the state of your led. See the API help for more info.
Hope this helps,
-Doug
09-29-2011 10:50 AM
Hello,
You may want to check out the following article on UIMessages.
Using Default and Custom UIMessages
http://zone.ni.com/devzone/cda/tut/p/id/4532