LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging every five seconds

I have had to ammend my software for better efficiency. I am to log data once every 5 seconds for 24 hours. After that time, the contents of log file should be replaced by  a new set. This should continue until the program is stopped. I have tried using sequence structures but this has not worked.

 

Any suggestions please?

0 Kudos
Message 1 of 6
(2,862 Views)

Hi maxidivine,

i think you should use a loop to accomplish this. What type of data do you log? Do you reset the entire file after 24 hours or only one value?

 

Mike

0 Kudos
Message 2 of 6
(2,858 Views)

This should do the every 5 seconds all you have to add is the file IO inside the case structure

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 3 of 6
(2,853 Views)

Well, it seems to me that in recent times more and more people tend to use sequence structures (of anykind) instead of proper architectures and therefore are running into more or less serious issues.

 

I think it is time that sequence structures should be removed from LV with two exceptions:

a) Single Frame

b) FPGA Module

 

But since this is most probably not going to happen, we have to go on answering in such a way: "Use proper architectures!" *sigh*

 

Now to answer maxi's question:

You have to collect data and pass this to a function group which writes the data to disk. This function group is to be executed once each 5 seconds. Therefore i tend to recommend parallel loops with proper data transfer mechanisms (queue). So i suggest you to look into producer/consumer architecture found in the template browser (file >> new).

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 6
(2,848 Views)

Mike is correct. You could use a Wait(ms) or WaitUntilNextmsMultiple vi with 5000 wired to it in a While loop. If you're not using event driven code then your vi would become sluggish, acting on button presses every 5 seconds. In that case, you could, say, wire 100 to the Wait then execute your logging every 50 iterations. (You could use the Quotient & Remainder vi to compute the modulus. When i mod 50 == 0 you execute.)

 

Ed

0 Kudos
Message 5 of 6
(2,839 Views)
Many thanks for the brilliant assistance. I would implement the long and get back with a feedback. I really appreciate it.
0 Kudos
Message 6 of 6
(2,823 Views)