LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to resize a troublesome array

Solved!
Go to solution

I am still struggling with one last thing, how do I get the milisecond timer / bench mark for the iteration of the forloop on the end of each row? In the position were it is input to the data stream in the attached vi all I get is a final value printed on the end of each row. But it should be incrementing.

If I add the milisecond timer, format_into_string and build_array before the concatenating tunnel in the forloop the milisecond timer data is incrementing but gets printed in an extra column between each register read. And I am concerned that the registers are just copies of the first reading. But There doesnt seem anywhere else to indroduce that data to the data stream.

 

Example of data produced by the attached vi

Data 1, data 2, data 3,        data 4,   data 5,     milisec

40806,48646,-40.156933,3.459666,0.032125,8.86860s
40806,48646,-40.156933,3.459666,0.032125,8.86860s
40806,48646,-40.156933,3.459666,0.032125,8.86860s
40806,48646,-40.156933,3.459666,0.032125,8.86860s

 

Example of data produced if the input is before the concatenating tunnel in the for loop.

 

Data 1, data 2, milisec 1, data 3,    milisec 2,  data 4,    milisec 3, data 5,     milisec 4

4802,48649,8.84844s,-40.151413,9.08847s,3.459666,9.32840s,0.032125,9.56936s
4802,48649,8.84844s,-40.151413,9.08847s,3.459666,9.32840s,0.032125,9.56936s
4802,48649,8.84844s,-40.151413,9.08847s,3.459666,9.32840s,0.032125,9.56936s
4802,48649,8.84844s,-40.151413,9.08847s,3.459666,9.32840s,0.032125,9.56936s

0 Kudos
Message 21 of 24
(89 Views)
Solution
Accepted by EdHarris

You give two examples of what you apparently don't want, but no example of what you actually want.

 

You still have that silly FOR loop where you write the exact same thing N times! Delete that little FOR loop! To get the data from all iterations into the file, the output tunnel of the while loop needs to be indexing (currently it is "last value", so you only get the data from the last iteration and all data from earlier iterations are irreversibly lost!).

 

Did you even study my VI?

0 Kudos
Message 22 of 24
(79 Views)

Thanks,  I deleted the silly forloop and changed the tunnel to indexing which gave me only one line of readings. So I moved the write vi into the while loop which works perfectly. I did study your examples, thanks, and am now understanding indexing and output of loops much better.  It seems the vi became simpler and simpler the closer is got to a solution.

Message 23 of 24
(58 Views)

You don't need any wait in the reading For-loop and if it's different Visa resources you can parallellize that loop. Now it's starting to loop like a correct little program. 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 24 of 24
(44 Views)