LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recurring saving while running the vi

Hello to all

 

I have created a VI to acquire data from multiple thermocouples and voltages. You can find my vi attached in this message.

 

At this moment the write to file section is saving the data on a file only if I click on the Stop button. This is not optimal as I had many times my software crushed during the test period I am trying to find a way for the file to save at a specific interval I will be indicating (e.g. each 10 minutes). 

Would it be possible for someone to guide me on how to implement such requirement?

 

Thank you for your help and consideration.

Alex

 

 

0 Kudos
Message 1 of 5
(1,092 Views)

Not many people have LV2021. You will get more help if you save your vi for an older version.

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 2 of 5
(1,077 Views)

Thank you Frozen for your input

 

Please find below a version for 2020 and one for 2019.

 

 

0 Kudos
Message 3 of 5
(1,071 Views)

Hi Nikolian,

 


@Nikolian07 wrote:

I am trying to find a way for the file to save at a specific interval I will be indicating (e.g. each 10 minutes).


Ideas:

  • When you want to save your data not "at the end", but "during the run" you must call the FileWrite function "during the run"! You need to place that code inside the loop…
  • When you want to call the FileWrite function using some conditions then you need to place that call inside a case structure…
  • You can easily combine several conditions (like "user wants to save data" and "Time elapsed so save data") using boolean functions…
  • When you want to measure some "specific time intervals" then you could use the TimeElapsed function (one of the just two or three useful ExpressVIs). Configure that ExpressVI as needed…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(1,068 Views)

@Nikolian07 wrote:

 

At this moment the write to file section is saving the data on a file only if I click on the Stop button. This is not optimal as I had many times my software crushed during the test period I am trying to find a way for the file to save at a specific interval I will be indicating (e.g. each 10 minutes). 

 


And you will continue to have your program crash during the test period

 

I believe this is because you have what 15(?) Arrays that are continuously growing until you stop. 

 

It's only a matter of time before your program will crash due to running out of memory.

 

The shorter your measurement interval is the sooner it will crash.

 

One Big Loop is not a proper program architecture, a simple State Machine would be magnitudes better...

 

  1. Configure your DAQ
  2. Take all measurements 
  3. Display them and save them to disk
  4. Wait for the next measurement interval
  5. Goto 2 until Stop
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 5
(1,031 Views)