09-13-2010 10:34 PM
I'm working on a VI for data acquisition with DAQmxRead inside a while loop consisting of only one interaction that lasts a few seconds. I would like to insert a chronometer to display the spending runtime on the front panel - how? I have searched for examples but all use the number of samples measured connected in every interaction, with the sampling frequency and a counter initialized to zero to show the time .... But like I said, my application consists of only one interaction lasting a few seconds ... any help would be really appreciable?
Hello!
/s/
FGF
09-13-2010 10:59 PM
You can try using the system clock reading when the read starts & when it finishes. You can initialize it to 00:00:00 before read starts.
09-14-2010 09:15 AM
Thank you kekin. I've tried that.
The problem is that it shows the time only after finished the interaction...
And I'd like to see the time running on the front panel during this interaction execution.
Capite? Any sugestion?
09-14-2010 09:16 AM
If possible, please send an example vi.... thanks!
09-14-2010 09:45 AM
"While"
The word "while" is one of those words I look for when reviewing specs because each "While" introduces a potetial parallel task. Each task has to be started and stopped etc. and that adds complexitiy to the application.
You are asking for a clock to be updated WHILE the I/O is taking place. This implies having a seperate loop updating the clock WHILE the I/O is active. So you have a need to start the background taks when the I/O starts and stops when the I/O completes. So...
Search this site for the design patterns "Maste Slave" or Producer Consumer to gt an idea how to run paralle tasks and communicate between them.
If you get stuck, post IMAGE of your code along with the code itself and someone here should be able to offer more suggestions.
Just trying to help,
Ben
09-14-2010 12:38 PM
Thanks Ben.
If a solution emerges, i'll share here.
anyway still opened to sugestions.
FGF
09-14-2010 02:27 PM
an other could be to cut your code (if possible) as fine enough <100 ms each step
so that the chronometer looks like independent
regards
Tinnitus
09-14-2010 06:30 PM
Yes Tinnitus, it is a possibility.... i'll try it.
Thanks!
FaFe