Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample of simultaneous use of DO and AI for USB 6008/6009

Can someone post some simple example how to use analog input  and digital output in the same program (I want to make program that switches relay using DO when the signal is bigger than some value). The samples supplied with DAQ have only separate tasks and I could not find any example or guide how to make a program with mixed tasks.
Thanks. Sergey.
0 Kudos
Message 1 of 3
(3,804 Views)
Hi Sergey,
 
I have made up a quick example which should do what you need. I'm assuming you have converted your USB-6008 to use DAQmx 7.5 and that is all working correctly. If not, then let me know and I'll have a look at getting an example working in DAQmx Base.
 
Best regards,

Peter H.
Applications Engineer.
NIUK.
0 Kudos
Message 2 of 3
(3,793 Views)
Thanks a lot Peter,
it does exactly what I want.
Just one question: why the voltage on a plot behaves so strange? I thought that it should be the straight line.
I have attached image of AI connected to DO, but it is the same when I connect voltage from power supply to AI.
Should I make something in MAX or somewhere else.
I already saw similar behaviour in NI data logger, a little bit different like connected pressure transducer showed the voltage and regilarly this voltage dropped to 0. Is it possible to avoid this?
Regards and thanks again.
Sergey.
0 Kudos
Message 3 of 3
(3,778 Views)