LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I write to data file only near to SW Trigger samples?

Solved!
Go to solution

Hi everyone

I am working on a model based in this one:

http://zone.ni.com/devzone/cda/epd/p/id/34#0requirements

I would like to save the data once the trigger is reached, with some data near to the impact.

Where should I place a "write to measurement file" block in order to may load and plot the data of an impact test?

Regards.

0 Kudos
Message 1 of 6
(3,012 Views)

A good way to handle the data and limit the effect on your acquisition would be to use a queue. 

This scheme will send data to disk only when an event occurs that sends data to the queue.

 

Set up two threads (parallel while loops): While loop 1 for data acquisition, While loop 2 for handling the queue.

 

You can send the data to a queue (Enqueue Data) once the trigger condition occurs.

 

The second while loop will handle the queue when data arrives (Dequeue Data) and send the data to disk.

 

 

CLD | CTD
LabVIEW 2011 SP1 | TestStand 4.5
0 Kudos
Message 2 of 6
(3,007 Views)

Hi CCornish,

Thanks for your attention

I have tried to implement the solution that you proposed, but an error appears when connecting the waveform output from the SW Analagog trigger block.

You can see that in the attached file. What could be the cause of the error?

Excuse me but I have been working with Labview for only a very short time.

 

Regards.

Message 3 of 6
(2,987 Views)
Solution
Accepted by topic author Celuti

Celuti,

 

You are so close!

I am glad to see you understood what I recommended!

 

You need to ensure that you connect the same data type to the Queue as what is coming from the DAQ.

 

Please see the modified version of the code you posted.

 

Craig

CLD | CTD
LabVIEW 2011 SP1 | TestStand 4.5
0 Kudos
Message 4 of 6
(2,982 Views)

Thanks so much Craig

I have tried and it works!

I cannot plot it since I do not obtain the data of time properly. Enclosed you can find the .lvm file. However, I guess that the pretigger samples have been written also, haven't it?

One last question. How could I obtain the data of time so I can plot this graph using matlab i.e.?

Regards.

0 Kudos
Message 5 of 6
(2,970 Views)

I have done it manually, but, is there any option to configure it to obtain those data manually?

I will try also with TDM format.

Regards

 

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