03-11-2015 10:21 AM
Hello all,
I'm learning NIDAQmx and I wonder if it's possible to program in a single task a complex set of events such as [Generate Analog Out signal from array during T1], [Wait T2], [Receive Analog In signal into array during T3], [generate callback when finished].
After just a few hours I managed to to this as a sequence of 2 different tasks and it works fine, but to be able to do other things at the same time WHILE ensuring precision of operation (the wait sequence in the middle), the best would be for the whole thing to run independently.
So what solutions are there ? Entire sequence in a NIDAQ task ? TaskOut+wait+TaskIn in a thread ? TaskIn started by an async timer launched at the same time than the start of TaskOut ?
Thanks.
03-12-2015 05:12 PM
A related question is: is it possible to enumerate devices by AI/AO properties ?
I saw AQmxGetSystemInfoAttribute (DAQmx_Sys_DevNames) which gives me a list of connected NI devices. Great, I can parse that. But then I wanted to know which ones are analog input and which are analog output.
I first looked at DAQmxGetChanAttribute (Task, Channel, DAQmx_ChanType, &Type) but you need to have already defined the channels yourself... Useless.
Then I looked at NISysCfgGetResourceIndexedProperty() but I don't see any property that will list the available channels and tell me if it's AI or AO.
How is that possible ?
Thanks.
03-13-2015
03:35 PM
- last edited on
01-03-2025
10:39 AM
by
Content Cleaner
Hello,
It will be great if you could add information about the hardware that you are using for this task.
However, I would like to introduce to you the Trigger feature and Retriggerable tasks. Triggers will allow you to execute, pause, or stop tasks based on hardware conditions or signals. This means they are not software dependant.
Tips and Techniques in Data Acquisition Triggering - NI-DAQmx:
https://www.ni.com/en/support/documentation/supplemental/21/ni-daqmx-data-acquisition-triggering-tec...
Retriggerable Tasks in NI-DAQmx:
https://www.ni.com/en/support/documentation/supplemental/21/retriggerable-tasks-in-ni-daqmx.html
Regards,
MCOTO.
03-13-2015 06:20 PM
I currently have some CompactDAQ 9184 racks with 9263 AO and 9215 AI, but I'd like for my code to be as hardware agnostic as possible (hence my 2nd question). Thanks for the trigger info, I'll look it up.
03-16-2015 05:00 AM
For those interested, I posted the solution here: http://forums.ni.com/t5/Multifunction-DAQ/Is-it-possible-to-enumerate-devices-by-AI-AO-properties/m-...