LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write measurement to file every X minutes

Solved!
Go to solution

Hi guys,

 

I am using a DAQ configured into 2 signals every 5hz into a while loop.

 

The fact is that i dont need that huge amount of data, i only need to see graphically.

 

On the other side i have a measurement to file block where i want to save the input data lets say every 15 minutes.

 

How is the best way to implement this?


Regards

0 Kudos
Message 1 of 14
(6,369 Views)
Solution
Accepted by topic author Ivanhe

Hi Ivanhe,

 

How is the best way to implement this?

The best way is to get rid of ExpressVIs… 😄

 

i want to save the input data lets say every 15 minutes.

Use the ElapsedTime ExpressVI and a case structure…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 14
(6,354 Views)

"Get rid of Express VI's",  "Use an Express VI".   Smiley Surprised  I'm confused!  Which is it?Smiley Very Happy

 

Seriously, Elapsed Time is one of the better Express VI's.  Trying to avoid Express VI's for things like DAQ assistant is helpful because it hides a lot of things, and limits your flexibility.  The combination of Express VI's and the blue dynamic datatype wire (DDT) is where problems really start to occur.  Things will magically wire together and seem to work, until you realize all of the configuration settings and actual datatypes are hidden and things aren't quite working the way you wanted them to.

Message 3 of 14
(6,346 Views)

Hi,

 

I'm confused!  Which is it?

Yes, I should have used more smileys… 😄

 

There are 2 "nice" ExpressVIs: ElapsedTime and FileDialog. Maybe there are some more, but right now I can't remember them…

Best regards,
GerdW


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

Hmm Maybe too obvious only 2 weeks with LV.

 

Not working atm. Any help? 🙂

 

Appreciate your time

0 Kudos
Message 5 of 14
(6,334 Views)

Hi Ivanhe,

 

even after just 2 weeks you should always say the mantra "THINK DATAFLOW"! It's the very basic LabVIEW programming principle…

 

When you want to do something in a loop you should put the code into the loop!

Right now your ElapsedTime will execute only AFTER the first loop has been finished!

Best regards,
GerdW


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

Maybe i am wrong but...


If i use the elapsed time, during that time my DAQ input won't work, am i wrong?

 

I want to get the signals every time but just recording every X minutes.

 

Is it possible with the elapsed time?

 

I would prefere to do coding atm 😄 😄 😄

0 Kudos
Message 7 of 14
(6,319 Views)

Think i got

 

EDIT: Nope, brings me open file error

0 Kudos
Message 8 of 14
(6,316 Views)
Solution
Accepted by topic author Ivanhe

That will work.

 

The only thing that concerns me is that event structure hanging out in space above the loop, and no obvious sign there are any other loops.  That event structure will happen in parallel with the while loop you show.  If you have a master while loop around everything, then it won't run again until your lower stop button is pressed.   If there is no master while loop, then that event structure can only occur once.

 

And I'm going to bet whatever events you have in that event structure are set to the default setting of locking the front panel until the even case executes, which means your VI will lock up cold the second time you trigger an event, (unless you happen to hit the stop button first).  And if two events happen and the FP locks up, you'll never be able to hit the stop button to stop the lower loop.  You'll be forced to abort the VI.

Message 9 of 14
(6,307 Views)

Hi Ivanhe,

 

If i use the elapsed time, during that time my DAQ input won't work, am i wrong?

Did you try?

You're wrong…

 

I want to get the signals every time but just recording every X minutes. Is it possible with the elapsed time?

Yes, that's why I suggested it!

 

Nope, brings me open file error

Ok. What did you do in your VI?

 

The problem with attaching images is: we cannot debug your VI.

The problem with ExpressVIs is: they hide a lot of information. One information is the name of the input you used to connect the boolean wire to…

 

And you forgot the case structure - I repeat:

Use the ElapsedTime ExpressVI and a case structure…

(I wonder why people asking for help don't read the answers carefully…)

 

To put the suggestion into pseudocode:

IF ElapsedTime(X minutes) THEN 
  save data to measurement file
ENDIF
Best regards,
GerdW


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