BattelleV
2008-07-24 18:40:09 UTC
Hello,
I am using the NI-USB 6215 DAQ under Linux without Labview. I am using the NI DAQMX Base C api.
What I need to do is read data from an analog input when a digital reference trigger is set high, further I need to set the trigger high from within the same thread.
The output is used to trigger two things (something external as well as something that provides input to the DAQ).
I can succesfully setup a single analog task to read data from an input.
I can succesfully setup a single digital task to set an output high.
I can succesfully setup a single analog task to read data from an input, with a digital start reference (verified by providing an external reference).
What I cannot do is within a single thread start two tasks one to setup an analog read with a digital start reference, and another to output a signal that is fed back and used as the reference. The Readme for DAQMX Base states that the Base API is not threadsafe and so a single thread should be used to setup tasks and channels.
The Readme file further states that an analog task and a digital task can both run simultaneously.
It looks like the two calls I am doing, DAXmxBaseWriteDigitalU32 and DAQmxBaseReadAnalogF64 both block, so it appears that sequentially I can set the output high but in doing so end up missing the rising edge transition.
Any insight would be appreciated.
I am using the NI-USB 6215 DAQ under Linux without Labview. I am using the NI DAQMX Base C api.
What I need to do is read data from an analog input when a digital reference trigger is set high, further I need to set the trigger high from within the same thread.
The output is used to trigger two things (something external as well as something that provides input to the DAQ).
I can succesfully setup a single analog task to read data from an input.
I can succesfully setup a single digital task to set an output high.
I can succesfully setup a single analog task to read data from an input, with a digital start reference (verified by providing an external reference).
What I cannot do is within a single thread start two tasks one to setup an analog read with a digital start reference, and another to output a signal that is fed back and used as the reference. The Readme for DAQMX Base states that the Base API is not threadsafe and so a single thread should be used to setup tasks and channels.
The Readme file further states that an analog task and a digital task can both run simultaneously.
It looks like the two calls I am doing, DAXmxBaseWriteDigitalU32 and DAQmxBaseReadAnalogF64 both block, so it appears that sequentially I can set the output high but in doing so end up missing the rising edge transition.
Any insight would be appreciated.