09-17-2015 05:22 PM
I built a VI that I believe should initialize an 8 element bool array to all FALSE. Then on each iteration of the for loop it's in, should turn each increasing element to TRUE. But in each loop iteration, the previous element is returning to FALSE rather than staying TRUE. Why is this, and what logic is needed to avoid this?
Solved! Go to Solution.
09-17-2015 05:34 PM
09-17-2015 06:02 PM - edited 09-17-2015 06:05 PM
I added the shift register, and if I run it without the DAQ Assist, it works flawlessly, thanks! But when I add it back (8 digital outputs on a USB-6343 controlling a relay board) it stops after the second iteration.
The pic should show that the error states:
Number of Channels in Task: 8
Number of Channels in Data: 9
09-17-2015 06:07 PM
Como mencionan, tienes qué agregar un shift register y cambiar la función de insertar elemento a reemplazar valor de elemento.
Espero esto sea la solución a tu problema.
Saludos.
09-17-2015 06:22 PM
@dourk wrote:
I added the shift register, and if I run it without the DAQ Assist, it works flawlessly, thanks!
You need to use "replace array subset", not "insert into array". You also need to initialize the array with 8 elements.
("insert into array" will grow the array by one element whenever you insert one, shifting all higher elements up. After two iterations, the array will have 9 elements. In contrast, "replace array subset" will keep the array at the same size, replacing the value of an existing element with a new value)
09-17-2015 06:32 PM
Woohoo! Thanks, moving on to the next issue!