Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

performing two NiDAQ operations at once...

Hello,

I am using NiDAQ 7.1 and a 6025E DAQ.

I am performing a simple rocket engine test.

These are my concerns so far...

1. The NiDAQ board cannot perform two operations simultaneously. What this means is that in order to operate the valve (digital out), I would have to interrupt the continous analog input scanning. This would cause a problem. I would not be recording analog inputs during, or immediately after the operation of the valve (digital out).

2. Synchronizing the operation of the valve with the continous analog input data recording. i.e What sample point in the analog input data corresponds to the instant the valve was opened/closed? I am using an accelerometer to record when the valve opens/closes.
But the interruption of operating the valve will render it useless since analog input recording will have been halted, and thus the accelerometer data will not have been recorded.

How do I operate the valve at the same time that I am continously reading analog inputs? According to your documentation, it is not possible to perform two operations on the E series at the same time. How do I overcome this issue? My analog input sampling frequency is 2KHz.

Would something like this work:

SCAN_Op(length of time before opening valve)
DIG_Line_Out(Turn on valve)
SCAN_Op(length of time before closing valve)
DIG_Line_Out(Turn off valve)
SCAN_Op(length of time to record after valve is closed)
StoreSamplesToFile()

What is the amount of time between SCAN_Op() returning, calling DIG_OUT_Line() and calling SCAN_Op()? i.e. how many samples will I miss due to stopping and starting analog input recording using SCAN_Op()?

- Tree
0 Kudos
Message 1 of 4
(3,088 Views)
Hey Tree,

I think you are still slightly confused on what Traditional NI-DAQ is capable of doing. The E-Series device is capable of doing analog input, analog output, digital input, digital output, and counter operations all at the same time. The problem with the Traditional NI-DAQ driver (not DAQmx) is that it is not a truly multithreaded driver.

Now what does this mean?

Assume you have two threads operating at the same time. One is performing an analog input and the other is performing a digital output. If the analog input thread is executing the AI_Read function then it is waiting for the device to fill the buffer with the number of samples that you have requested and then it will return the array of data to your program.

If the Dig_Out_Lin
e function tries to execute while the AI_Read is waiting for the data then the DIG_Out_Line function will be blocked until the AI_Read completes. You can minimize the effect by reading smaller chunks of data or placing small wait functions in your analog input while loop so the processor and driver can perform other tasks.

This will not change the analog input process and you will not miss any data points if you have it configured for a continuous analog input. The data is always being transferred from the DAQ device to the buffer. You are just reading from that buffer when you execute the read functions.

The best solution to your problem would be to use NI-DAQmx. This driver is multithreaded and the analog input will not block the digital output thread. There should be several examples that are installed for ANSI C on your hard driver at C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev.

I hope this helps out.

Joshua P.
Application Engineering
National I
nstruments
Message 2 of 4
(3,088 Views)
Hello Joshua,

Could you please tell me what PC configuration would be required to run a program that would continously read 12 analog inputs and control 1 digital output. I would be using the NiDAQmx driver with Visual C++ to write the program for the 6025E card. Please specify the RAM and CPU requirements.

Thanks,

- Tree
0 Kudos
Message 3 of 4
(3,088 Views)
Hey Tree,

The specifications for NI-DAQ 7.1 are located in the readme.

Attached is a copy.

Regards,
Joshua P.
Application Engineering
National Instruments
0 Kudos
Message 4 of 4
(3,088 Views)