Irsa
Irsa

Reputation: 1

How to time a case structure in labview?

I am using cDAQ 9191 along with module 9205 for data acquisition. Attached with the post is figure of my LV code for data acquisition 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 what i need is to press record button so that write data is written/stored in TDMS file for only 6 seconds. and this should happen automatically and auto stop of code. The block diagram of code is shown in figure using elapse time.

The block diagram of code is shown in figure using elapse time

The tdms shows how data is saved The tdms file saved after running this code The tdms file saved after running this 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?

Upvotes: 0

Views: 2726

Answers (1)

sporc
sporc

Reputation: 387

So you want to automatically just save 6 seconds of data? You could work with the Elapsed Time Express VI

http://zone.ni.com/reference/en-XX/help/371361P-01/lvexpress/elapsed_time/

Set the start time as zero and the time target to 6. After 6 seconds the VI will give you the boolean true, otherwise false. Then you will need a while loop. While the VI returns the boolean false write to file. The while loop should be placed in your case structure. You also should change the mechanical action of your boolean object named switch to Latch when pressed. See this link http://zone.ni.com/reference/en-XX/help/371361G-01/lvhowto/changemechactofboolswitch/

Hope it helps

Upvotes: 1

Related Questions