Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

digital trigger and partial DAQ read

I have an issue when trying to use a digital trigger to start an acquistion and attempting to read the data values before all has been collected.  The time I wish to acquire data will vary so I do not need to always wait the entire time to read my values (i.e. 1sec acquistion time but may be ready to read values after only 600msec).  The trigger appears to be working and if I read values quickly before the entire dataset has been collected it shows me those values collected so far but then I must read the remaining samples and perform another "dummy" trigger before another set of data can be collected - whether partial or full.  I am not sure why I cannot just dispose the remaining samples and have the next trigger returns new data values but it returns the remaining data and then the next trigger returns no data after which I must perform another trigger.  In the attached code I am just manually applying a level to the PFI0 to trigger the acquistion and then click the button on the front panel to perform the read (eventually the button will not be there).  I hope this all makes sense and this should not be that hard but for some reason I must be missing something.

 

 

0 Kudos
Message 1 of 3
(2,950 Views)

As I understand it you are trying to acquire an indeterminate amount of samples when a digital trigger is received and then clear out the buffer of the rest of the samples until the next trigger is received.  Is this correct?

 

Currently the only way I can think of to clear the buffer is to clear the task.  I did some digging in property nodes and wasn't able to find anything.  If I have mistated your problem please correct me.

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 2 of 3
(2,934 Views)

Doug

 

You are correct - that is basically what I am trying to do (in much less words then I stated).  Since I could not figure out how to do that and had to get something working, I have basically changed it to do a continuous sampling of 1000 samples at 1KHz (1 second max of data).  Since I know the time between triggers will never exceed 1second I will just acquire continuously and read the data every cycle even though the start/trigger may not always be at the beginning of the dataset in the returned data. 

 

If you do find a way a better way for what I am trying to accomplish I would still be interested in the solution but for now I am set.

 

Thanks.

0 Kudos
Message 3 of 3
(2,926 Views)