LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data at every 10 seconds

Hi

I am getting 4 waveforms from my program, 2 time domain and 2 frequency domain. Currently I have to save them manually. What I need to do is make it automatic so that when I run the program it saves the 4 waveforms every 10 seconds. Is that doable? Can anyone please help?

 

0 Kudos
Message 1 of 10
(3,884 Views)

Hi mna,

 


@Beginnermna wrote:

What I need to do is make it automatic so that when I run the program it saves the 4 waveforms every 10 seconds. Is that doable?

 


Yes 🙂

 


@Beginnermna wrote:

Can anyone please help?

 


It would be easier if you could add your code. Then we can make better suggestions as to what you should add and where.

 

Also, how do you want to save them? E.g. TDMS, binary, csv as text, ...?


GCentral
0 Kudos
Message 2 of 10
(3,880 Views)
0 Kudos
Message 3 of 10
(3,872 Views)

@Beginnermna wrote:

Please have the code


I opened your block diagram.  Then I closed it right away.  It's way too messy for me to deal with.

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

I abhor messy code.  I cleanup up one of your subVIs (Sum Waveforms .vi) just to illustrate the difference between clean and messy code.

Here is your original:

mc.png

 

Here it is after I cleaned it up:

mcf.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 10
(3,843 Views)

I cleaned up one more.  The original:

mff.png

Inexcusably bad.

 

Cleaned up:

cff.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 10
(3,839 Views)

Hi Beginnermna,

 


@Beginnermna wrote:

What I need to do is make it automatic so that when I run the program it saves the 4 waveforms every 10 seconds.


The code really is bad…

 

One more cleanup (RollingAverage):

Hint: In case of "Rolling Average"=FALSE the average calculation might be wrong…

 

After implementing all those cleanups you should learn to use the ElapsedTime ExpressVI: it will give you a simple way of getting a boolean TRUE signal after each 10s…

Best regards,
GerdW


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

Hello

 

Thanks for your help. Can you please tell me where I can find the Elapsed Time Express VI?

0 Kudos
Message 8 of 10
(3,747 Views)

@Beginnermna wrote:

Hello

 

Thanks for your help. Can you please tell me where I can find the Elapsed Time Express VI?


The VI can be found under the Express VIs palette when right clicking on the block diagram, in the Execution Control subpalette.

 

Documentation can be found online here: https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/express/express-execution-control/e...


GCentral
0 Kudos
Message 9 of 10
(3,744 Views)

Hi beginner,

 


@Beginnermna wrote:

Can you please tell me where I can find the Elapsed Time Express VI?


Have you had a look into the time functions palette?

Best regards,
GerdW


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