02-20-2018 10:58 PM
hi,
I am using cDAQ 9191 along with module 9205 for data acquisition. Attached with the post is my Lv code foe data aqcuisition and saving it to a measurement file. It is working fine. I start with running the code and i can see the waveform of all my 9 channels. afterwards i can press record button to start recording the data and storing in TDMS file. everything is quite fine till this. Now i need to stop the recording after 6 seconds automatically( which i need to do manually at this stage-aborting execution or pressing stop button on front panel). I guess i need to "time" case structure containing "write to measurement file". But how to do it?
Can anyone help? Or any other solution , after looking into the attached code.I am new to LV. TQ
Solved! Go to Solution.
02-20-2018 10:59 PM
hi,
I am using cDAQ 9191 along with module 9205 for data acquisition. Attached with the post is my Lv code foe data aqcuisition and saving it to a measurement file. It is working fine. I start with running the code and i can see the waveform of all my 9 channels. afterwards i can press record button to start recording the data and storing in TDMS file. everything is quite fine till this. Now i need to stop the recording after 6 seconds automatically( which i need to do manually at this stage-aborting execution or pressing stop button on front panel). I guess i need to "time" case structure containing "write to measurement file". But how to do it?
Can anyone help? Or any other solution , after looking into the attached code.I am new to LV. TQ
02-21-2018 01:20 AM
Hi irsa,
why don't you discuss this with Jawad?
I suggest to use ElapsedTime - it will tell you when the 6s are gone…
02-21-2018 04:32 AM - edited 02-21-2018 04:32 AM
Actually both of us are solving the issue but cannot get something out of it. So i am doing it with express VIs. Attached is the code using Elapsed time. But it is not working well. Still i need to stop the code manually to stop the writing measurement file VI. Can anyone look into the code and tell kindly whats wrong in it ?
02-21-2018 04:43 AM
02-21-2018 04:57 AM
Name the VI used to connect elapse time and write to measurement file?
02-21-2018 05:56 AM
Hi irsa,
it's a function handling boolean signals. Why don't you look in the boolean functions palette?
02-21-2018 09:18 PM
The code still not working. I have attached the code and tdms file view for code.
TDMS file viewer shows clearly that each group of file contains 200 samples. For 6 sec data i should have 6000 samples in total as sampling rate is set to 1000 in DAQ settings. According to auto saving for 6 seconds only 6000 samples should be appearing in groups of tdms file shown in figure. 200 samples each group so total of 30 groups . But each time i run # of groups changes. how to fix this?
02-22-2018 12:41 AM
Hi irsa,
But each time i run # of groups changes. how to fix this?
By debugging and correcting your VI…
The code still not working.
In my image I wired a FALSE to the AutoReset of ElapsedTime, but you wired a TRUE.
What's the reason behind this decision? And what is the result of that decision?
02-22-2018 12:59 AM
Either TRUE or FALSE of AUTO RESET do not have any impact on the result. The number of groups is still not fixed. I am still unable to get fixed number of samples.