Showing results for 
Search instead for 
Did you mean: 

Independent Sample and log rates

I would like to log data at 0.5 second intervals while the daq assistant acquires data at 1KHz,


I tried using the write to measurement file express vi but couldn't separate the sampling and logging rates.


Any suggestions with code is always appreciated.


Thanks !!

0 Kudos
Message 1 of 18

Your VI is saved in LabvIEW 2013, hence I can't open, either save it in previous version and upload or share the snapshot of block diagram.


Well, have you tried running two parallel loops one for acquisition and other for data logging.

Refer to these:

1. Application Design Patterns: Producer/Consumer

2. Data Acquisition Reference Design for LabVIEW

I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.

0 Kudos
Message 2 of 18

I changed daq portion to daqmx rather than daq assistant express but still lost with writing data to file every 0.5 seconds.



0 Kudos
Message 3 of 18

Your screenshot doesn't show anything trying to log the data!




Take the boolean output from the Timer express VI and wire that to a case structure.  Inside the true case, put your data logging function.  If you set your time target to 0.5, then the the timer will become true every 1/2 second and send your data to the file.



0 Kudos
Message 4 of 18

Thanks for your response.  I did not include data logging yet (cause I dont know how) but looked at the logic.


That will destroy my count down timer on the front panel right ?

0 Kudos
Message 5 of 18

What is your countdown timer supposed to show?  It wasn't clear you were using the express VI for that purpose in your earlier screenshot.


If you need a separate timer for the sake of a countdown vs. a timer for when to log, then put two express VI's in your code, each configured however you need it.

0 Kudos
Message 6 of 18

The timer is used to toggle a valve every five seconds and provide an countdown indicator for the sampling period (0.5 sec x 10 seconds).


I will work on your suggestion using another express VI.



0 Kudos
Message 7 of 18

Its logging data every millisecond.  I for it produced the same result with the express vi in the false case.



0 Kudos
Message 8 of 18
You are acquiring a sample every msec. Each of those samples is recorded at the rate you specify with the elapsed time function. It appears to be doing exactly what you asked for.
0 Kudos
Message 9 of 18

I am trying to sample every msec but I want to write to the measurement file every 0.5 seconds.

0 Kudos
Message 10 of 18