LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital I/O Buffered Output Example

NI has a VI example called "Buffered Pattern Looping Output" In the DIO Config VI, there is a control called "number of scans/updates." What does this value imply? For example, I place 20 into the control. Is the pattern generated 20 times each time the clock goes high? Or does it mean the the pattern is simply generated 20 times. In the example, does the DIO write within the loop serve a purpose other than reporting the number of iterations? The VI DIO Start also has a similar control (number of updates)? What purpose does it serve? I assumed the control would limit the number of times the pattern is generated. When I run the NI example, it seems to continue without stop. I assumed the example would stop when the buffer it
erations equals the number of scan/updates. Thanks in advance for any help.
0 Kudos
Message 1 of 2
(2,993 Views)
The ?number of updates? is going to set how big the buffer size is. If you set this value to 100, then there are going to be 100 values in the buffer to output, one at a time. Therefore, it is going to take 100 clock pulses to output the entire buffer. Since this is the continuous pattern generation example, it will continually output data until the user presses the Stop button. If you only want to output the buffer once, use the Buffered Pattern Output VI example.

When doing continuous pattern generation, you have the option to continually output the same buffer or write new data to the buffer so that you output new data.

If you are using a NI 6533, and you want to output the same buffer continuously, you will need to set Regeneration to ?Allow?. To do this,
open the DIO Start VI, then go to the block diagram. Then wire a constant to the bottom of the Buffer Control VI to ?data overwrite/regen. connection. Set this constant to ?allowed.? You then do not need to write new data to the buffer inside the while loop. It is suggested to keep the DIO Write in the loop without any new data for error checking purposes.

If you are using a NI 6534, you can use the onboard looping feature to output the same buffer continuously. Use the DIO Parameter VI to set this up.

Let me know if you have any questions about this.

Brian
0 Kudos
Message 2 of 2
(2,993 Views)