Appendix A
HMI Function Reference
A-58
©
National Instruments Corporation
Read Tag (discrete)
Use the Read Tag (discrete) VI to read the latest value for a given discrete (or Boolean) tag
from the Real-Time Database. For immediate polling of the tag value, leave timeout (secs)
unwired. To wait until the value is updated before reading it, wire a timeout value in seconds
to timeout. The Read Tag (discrete) VI returns with the most recent Real-Time Database
value when it is updated, the timeout is exceeded, or the Real-Time Database is shutting
down, whichever occurs first. Use the changed? output to determine whether the value
changed since the last read.
Note
Use a separate Read Tag (discrete) VI for each tag you want to monitor. In other
words, for example, do not put the Read Tag (discrete) VI in a loop to read a
different tag for each iteration of the loop. This results in slower program
performance. The Read Tag(discrete) VI is designed to save information about the
tag internally for efficient operation. This information is updated every time the
tag name changes.
tag name is the name of the discrete tag.
timeout (secs) (0) specifies how many seconds to wait for the tag value to
be updated in the Real-Time Database before reading the Real-Time
Database for the latest value. If timeout is 0, the Read Tag (discrete) VI
reads the Real-Time Database immediately and returns the tag value
without waiting. If timeout is –1, Read Tag (discrete) waits indefinitely
until the tag value is updated, or the BridgeVIEW Engine shuts down,
whichever occurs first. If a timeout occurs before the value is updated,
Read Tag (discrete) returns the most recent value from the Real-Time
Database, and timeout is set to TRUE. The default value is 0.
in alarm is TRUE if the tag is in alarm.
value status returns the status of the value. If value status is greater than
or equal to 0, the value returned by Read Tag is valid and there is a warning
about the tag value. If value status is less than 0, either the device server
has reported an error indicating there is a problem with the tag, or
BridgeVIEW has reported an error indicating there is a problem using
the tag.