LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

shift register: initialization

I am collecting data from four cDAq9181. I attach the vi. It compares the current array of booleans with the previous. If they are different, it writes the new one to a text file. It works ok but does not collect the first array of booleans. I have initialized the shift register of the while loop to 0s, but it does not suffice since in many cases the initial array is made of 0s.

how can I change the code to work around this issue? thanks

0 Kudos
Message 1 of 4
(2,302 Views)

Or the logic that compares the current and previous arrays with i=0. This way if i=0 you will always put the data in the shift register and write it to the text file. You really wouldn't even have to initialize the shift register then because you're initializing it on that first iteration.

Message 2 of 4
(2,255 Views)

very good idea! I will give it a try and get back to you in case. Thanks

0 Kudos
Message 3 of 4
(2,228 Views)

Just initialize the shift register input with an empty array of booleans.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 4
(2,219 Views)