LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting data all the data from a for loop as an array

Solved!
Go to solution

I need to record a signal from a photodiode at a specific time interval. For that photodiode will be connected to a DAQ, as an initial step a basic code was created where input from the DAQ is simulated using the simulated signal function. The problem I am facing is that I need to store data in an array and output it as a text file, but when I run the code when the code is executed data is stored in the correct position but while doing that previous value changes to zero. I want to get all the data from 10 run in a single array. 

Download All
0 Kudos
Message 1 of 10
(333 Views)

Hi Guy,

 

you need to learn some LabVIEW basics, like shift registers!

And you need to learn to avoid DDT wires as much as possible!

 


@UV_Vis_Guy wrote:

I want to get all the data from 10 run in a single array. 


Use an auto-indexing output tunnel!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(302 Views)

@UV_Vis_Guy wrote:

when I run the code when the code is executed data is stored in the correct position but while doing that previous value changes to zero. I want to get all the data from 10 run in a single array. 


Yes, you send in an array of 10 0's and replace 1 value x 10 loops.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 10
(299 Views)

Hai GerdW,

 

Thanks for your valuable comment but auto-indexing is not working, when I enable auto-indexing for the output array it is asking to create a 2D array and the final output does not have all the values. 

 

Regards,

Jefry

0 Kudos
Message 4 of 10
(257 Views)

A shift register is all you need.

Yamaeda_0-1736869067921.png

 

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 10
(243 Views)
Solution
Accepted by topic author UV_Vis_Guy

Hi Guy,

 


@UV_Vis_Guy wrote:

auto-indexing is not working, when I enable auto-indexing for the output array it is asking to create a 2D array and the final output does not have all the values. 


I don't think you are right!

Maybe you should learn more LabVIEW basics?

And no, you don't need any shift registers (and InitArray and ReplaceArraySubset) for such a simple task! (Sorry, Yamaeda! 🙂 )

 

Btw. I recommend NOT to use ExpressVIs excessively. Their DDT wires prohibit you from becoming a better LabVIEW programmer…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(237 Views)

@GerdW wrote:

Hi Guy,

 


@UV_Vis_Guy wrote:

auto-indexing is not working, when I enable auto-indexing for the output array it is asking to create a 2D array and the final output does not have all the values. 


I don't think you are right!

Maybe you should learn more LabVIEW basics?

 

And no, you don't need any shift registers (and InitArray and ReplaceArraySubset) for such a simple task! (Sorry, Yamaeda! 🙂 )

 

Btw. I recommend NOT to use ExpressVIs excessively. Their DDT wires prohibit you from becoming a better LabVIEW programmer…


You're right, but i was thinking of the minimal change to get it working. 🙂

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 10
(185 Views)

@Yamaeda wrote:


You're right, but i was thinking of the minimal change to get it working. 🙂


Minimal change, he? 😀

 

Instead of a DDT to Number we use a shift register, initializer constant, and insert into array!

If you don't watch out, Christian might promote you for the Rube Goldberg thread. 😋

 

But in your defense you can say that the use of Express Nodes and DDT datatype are the even bigger Rube Goldberg solution.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 10
(175 Views)

@rolfk wrote:

@Yamaeda wrote:


You're right, but i was thinking of the minimal change to get it working. 🙂


Minimal change, he? 😀

 

Instead of a DDT to Number we use a shift register, initializer constant, and insert into array!

If you don't watch out, Christian might promote you for the Rube Goldberg thread. 😋

 

But in your defense you can say that the use of Express Nodes and DDT datatype are the even bigger Rube Goldberg solution.


🙂 Sometimes i wonder at which level i should answer questions. Sure, we can throw Actor Framework at the problem, but if they're having issue with some basic concept i like to start with just that and let the rest be bad (but maybe point it out), they'll probably be overwhelmed with information otherwise. But it depends on the mood of the day. 🙂

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 10
(153 Views)

@Yamaeda wrote:


🙂 Sometimes i wonder at which level i should answer questions. Sure, we can throw Actor Framework at the problem, but if they're having issue with some basic concept i like to start with just that and let the rest be bad (but maybe point it out), they'll probably be overwhelmed with information otherwise. But it depends on the mood of the day. 🙂


I know the feeling. How far to go? Try to fix the mess with minimal modifications or cleanup seriously? The first approach will result in more and more requests to fix yet another problem they run into because the initial setup simply was borked from the start, the latter requires usually a lot of extra explanations, that they may not even be able to process at all with their level of knowledge.

Whatever you do, you often end up with someone who keeps running into problems and depending in everything on you and the rest of the community to get anything done.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 10
(135 Views)