Download "user manual"
Transcript
Lesson 4 Local and Global Variables The Time Delay control determines how often the global variable is read. Notice how the Time Delay affects the values plotted on the waveform chart. If you set the Time Delay to 0, the same Data Value value is read from the global variable several times, appearing to decrease the frequency of the sine wave generated in the Data to Global VI. If you set the Time Delay to a value greater than 50 ms, the Display Global Data VI may never read some values generated in the Data to Global VI, and the frequency of the sine wave appears to increase. If you set the Time Delay to 50 ms, the same rate used in the While Loop in the Data to Global VI, the Display Global Data VI reads and displays each point of the Data Value global only once. When using globals, if you are not careful, you may read values more than once, or you may not read them at all. If you must process every single update, take special care to ensure that a new value is not written to a global variable until the previous one has been read, and that after a global has been read, it is not read again until another value has been written to the global. Note © National Instruments Corporation 4-23 LabVIEW Development Course Manual