Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to Multiple Ports inside FOR loop

LabView 5.1, DAQ 6507

I have a FOR loop inside which a series of lines are written to, one at a time. They are input by an array from outside the loop into one port config/write sub-VI. When the port changes (writing to line 35 after line 7) the last line (7) would remain 'on' because that port receives no instruction to change. To fix this, a shift register was added tracking the port and when the port changes (port 0 to port 5) the old port (0) is cleared via a separate port write also inside the FOR loop. The problem is that the new line is only on for an instant, as if it is turned on and turns off when the program is clearing the old port.
Is there a limit to the number of ports that can be written to from a FOR loo
p? Any help is appreciated.
0 Kudos
Message 1 of 2
(2,526 Views)
Greetings,

Given I have not seen your program, it sounds to me like you are turning the port on, switching to a new port, at which time the shift register tracking you are using detects this change in ports, and clears the old port. If your loop executes too fast then you will just see a quick on-off on each port since it will be turned on and then almost immediately cleared when you move to the next port. If this is true, you may want to consider adding a wait VI to your FOR loop.

There is no limit to the number of ports/lines that can be written to from a FOR loop. Most likely the issue exists in your program. Additionally, are you calling a config VI multiple times? Each time config is called all lines will be reset.

Regards,
Justin Britten


Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,526 Views)