Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Requesting help with timing of data acquisition

The part of the code that I need help with consists of two main sections. The two sections are inside the same frame of a flat sequence structure. The bottom part is responsible for creating a pulse from NI-9263. 

The top part starts data acqusition for Voltage and temperature. The current set up causes the data acquisition to start simultaneously with the Pulse creation. I want to add a delay between the time when the pulse first starts and when data acquisition begins. For example, if I create a pulse for 150 seconds, I want to start the data acquisition at 100seconds so I will be taking data for 50 seconds instead of 150.  Any suggestions on how to time the data acqusition? 

 

Here's a list of the National instruments hardware  at my disposal: 

 

1. c-DAQ 9174

2. NI-9205

3. NI-9211

4. NI-9263

 

Please check the attached file for more information. 

Thanks!

Download All
0 Kudos
Message 1 of 2
(4,896 Views)

I have not used the cDAQ products so my comments are more general than specific.

 

1. The use of sequence structures in LabVIEW programming is discouraged because they defeat the dataflow paradigm, are very inflexible to changes, to conditional processes, and to error handling.

2. It appears that you may want to run some very slow processes (100 seconds). Timing that slow in a sequence structure will be excruciatingly painful if the user wants to interrupt the process. Even your default values will have the program looking like nothing is happening for several seconds.

3. A parallel loop architecture, possibly with a state machine in one or more of the loops is probably a better choice.

4. You appear to be starting the pulse generation from the AI start trigger but this is opposite to what you say you want - to delay acquisition after the start of the pulse.

5.  Consider continuous acquisition. Your rates are moderate and the total data accumulated over even several minutes would only be a few MB. Also acquire the pulse signal on another AI channel. Then find the edge of the pulse in the data and extract the segment of the voltage and temperature data you want by using the data rate and element counts.  You are getting the data as a 2D array, so Array Subset will easily extract the portion you want. Discard the rest of the data.

6. Put the DAQ Read and Write VIs inside a loop which runs around 5 to 100 iterations per second. Put the configuration VIS before the loop and the STop Task stuff after the loop. Either accumulate the data in a shift register or pass it via a queue to another parellel loop for analysis (Producer/Consumer architecture). This will allow rapid response to user inputs or errors.

 

Lynn

 

0 Kudos
Message 2 of 2
(4,875 Views)