National Instruments BridgeVIEW 用户手册

下载
页码 455
Chapter 4
Human Machine Interface
© National Instruments Corporation
4-21
period is exceeded, whichever occurs first, then reads the database and 
returns the current tag information. By default, timeout is 0 seconds. 
If you wire nothing into the timeout input of your diagram, the VI reads the 
database and returns immediately. How you use the timeout input depends 
on whether you want to implement event-driven or polled programming 
techniques in your HMI. 
All VIs that read information form the BridgeVIEW database have a 
changed? output that is TRUE if the returned information is new or 
updated. If the VI returns and changed? is FALSE, the VI might have timed 
out, or the information in the database did not change since the last time you 
read it. You can use this output to make your program more efficient by 
using a case statement to update the user interface only if the information 
has changed. 
Some of the more advanced Tags VIs and Alarms and Events VIs also 
return an initialize headers or config changed output that tells your 
program whether your HMI object needs to be initialized with new 
information. In most cases, this corresponds to the first time the VI is 
called, and you only need to update that part of your user interface once. 
For more information about the Tags VI Library, refer to Appendix A,
.
Activity 4-3. Read a Tag
Your objective is to monitor a single tag value using the Read Tag VI.
In this activity, the Read Tag VI returns when a new value for the tag is 
acquired from the Tanks Server, and updated in the RTDB, or a timeout 
of 1 second is exceeded, whichever occurs first. This loop continues 
executing until the Engine shuts down. You will use 
mytanks.scf
 in 
the
BridgeVIEW\Activity
 directory, which you edited in Activity 3-1, 
.
Front Panel
1.
Open a new VI (File»New) and place a tank on the front panel 
(Vessels»Tanks). Label the tank 
Product
. Edit the tank scale to range 
from 0 to 1000.