01-20-2010 01:30 PM
How does one set the Bad Status of a Shared Variable in 2009?
IE). I have a custom device that communicates via TCP/IP. I wrote my own I/O server that handles this communication and publishes a set of Shared Variables that my Main Application displays on a screen. These variables are all doubles and hold pressures and temperatures. If my I/O server in labview loses communication I would like to be able to set the status of the variables to bad so they will set off an alarm. In our main application we have colour indicators that are able to display this status. For example the background goes yellow for all indicators that are in "HI" alarm status, red in "HI HI" and orange when "Bad Status" (disconnected).
We were able to accomplish this using LabVIEW 7.1 DSC, by creating a VI to register all our "Tags" and a VI to run the server. The server vi's that came with 7.1 allowed us to set the quality when writing to the server item. Therefore when the device was disconnected or failed we could set the bad status and use the DSC system to log an alarm and use the alarm features to colour code our indicators.
01-21-2010 05:02 AM
I believe this should help:
01-21-2010 07:48 AM
None of the Shared Variable IO Properties can be configured to allow you to set the alarm. You can only configure the properties such as turning the possibility of the alarm status on/off and the priority, name etc. You do not have the ability to indicate that this shared variable is in alarm because your custom server has encountered a problem. I've talked to tech support about it and I've been informed that this was something that was removed when the shared variable engine was introduced. I've been told informed that the recommended alternative is to create an additional boolean shared variable that will contain the status of the items, or to write some sort of unique garbage value to the actual tag value to indicate there is a problem with it.
I now have to come up with a new way of providing this information. I just find it will likely be a poor programming choice because now my entire system will have to handle "tags" differently based on what hardware is being used. (IE) if its coming from a custom I/O device or from an OPC / Modbus etc capable device.