From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can NIDAQmx do multiple things in sequence ?

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.

0 Kudos
Message 1 of 5
(4,667 Views)

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.

0 Kudos
Message 2 of 5
(4,642 Views)

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:
http://www.ni.com/tutorial/4329/en/

 

Retriggerable Tasks in NI-DAQmx:
http://www.ni.com/tutorial/5382/en/

 

Regards,

 

MCOTO.

0 Kudos
Message 3 of 5
(4,620 Views)

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.

0 Kudos
Message 4 of 5
(4,615 Views)
0 Kudos
Message 5 of 5
(4,581 Views)