Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

daq assistant multiple analog inputs and digital outputs

When dealing with DAQMX and having 15 analog in channels (all current) and 15 DO out channels (for relay on/off) which way is the "correct" way to program this? see the snippets below. Not sure if i need code A 15 times with a "read function" in my loop or code 2 inside my loop with 15 index arrays attached to it. Code 2 seems easier and cleaner but i would also be configuring everytime. or with the daq assistant out side the loop with the read function inside and index arrays attached to it.

 

Need some clarification about this since Im not real familiar with DAQMX. Im using a cDaq 9172 with 2 NI 9203's and 2 NI 9472's

Thanks in advance

 

Myke

Download All
0 Kudos
Message 1 of 3
(4,577 Views)

Avoid DAQ Assistant when you can simply use the DAQmx API.  The proper way to do this is to have your initialization code before your loop and then close out the task after your loop.  Inside of your loop, use the DAQmx Read set to N Channels.  It is better to read it all in one shot.

 

Be sure to look at the DAQmx Examples.  In LabVIEW, go to Help->Find Examples.  Do a search for Analog Input and you should be able to find a nice example.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(4,561 Views)

Thanks crossrulz. That's what I was thinking. I'm trying to optimize the best I can for my knowledge limits where this stuff is concerned. Have a look at what I have so far. Obviously there are wires missing and I'm not done with it yet but i believe I've captured what you said. Using index arrays to hit my data on the the individual channels. there is a while loop around everything i have here. I hope you can view the snippet. its kinda big.

 

 

 

Download All
0 Kudos
Message 3 of 3
(4,554 Views)