Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing the DAQ and savind data at intervals

Hardware: PCI-6289, SCXI 1102C,CB 68 LPR

I have a bunch of thermocouples, a pressure transmitter connected to the DAQ and created a NI Daqmx Task as seen in the picture. I am acquiring 1k samples at 2kHz. I am able to read the data, calibrate and display it.

 

Totally unfamiliar with DAQ. I am saving all files with Write to Measurement File Express VI

 

Problem: Timing the loops; (Correct me if I am wrong)1000 S/2000 Sps = 0.5 ms interval and so I get 1000 samples every 500ms. How much wait time should I add in the acquire loop. When left with no wait function, the reading takes too longand so I used 50 ms wait time. Saving data in the Acquisition  loop gives me strange timing values in the beginning. See acquire 1. I save the same data after calibration in another loop with 50 ms wait time. see calibration1. The data is blank for the first 50 ms and the same data repeats 10 times.

 

Goal: To save data at periodic intervals like 5 or 10 seconds. I tried using express wait. It records the extra 50 ms values which i dont want(See acquire 2). I would like to save single values.

 

I have added the Application as well.  It will be missing some APIs though. Please look into the Acquisition and calibration sub VI. 

 

Let me know if you need more info

0 Kudos
Message 1 of 4
(2,750 Views)

Hi Goku,

 

with DAQ acquisition you normally do not use any wait functions in your acquisition loops. You rather connect the 'number of samples per channel' input with the number of samples you want to acquire with every call of the DAQmx Read VI and define a suitable timeout (better not timeout=-1 since you would wait indefinitely).

 

Best regards,

Christoph

Staff Applications Engineer
National Instruments
Certified LabVIEW Developer (CLD), Certified LabVIEW Embedded Systems Developer (CLED)


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved
0 Kudos
Message 2 of 4
(2,696 Views)

Hi Christoph,

 

I want to acquire data continuously and display it but want to save it to file for every 5 seconds or setpoint. I have removed wait function and at the moment, data is saved for an additional 5-7ms between the time period as seen in the attachment. Could you tell me why this happening

0 Kudos
Message 3 of 4
(2,674 Views)

Hi,

 

I really don't understand what you are refering to. Where can I find those 5-7 ms in your attached file? What kind of code are you refering to? Please enable me or the other community members to be able to help you by providing all necessary explainations (code, comments, screenshots).

 

Best regards,

Christoph

Staff Applications Engineer
National Instruments
Certified LabVIEW Developer (CLD), Certified LabVIEW Embedded Systems Developer (CLED)


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved
0 Kudos
Message 4 of 4
(2,665 Views)