Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

separating two channel input from one task

Solved!
Go to solution

hi guys,

i am using x series NI-USB 6341. i've created a block diagram as below.i provided a 5V DC voltage to channel 1 and 3V dc voltage to channel 2 in one task.the problem is, i failed to obtain the same voltage reading as provided at the input terminal after i seperated the channels from that task by using arrays..can somebody explain what did i lack of or maybe something wrong with my block diagram.i also already attached the VI.thank you.

 

 

0 Kudos
Message 1 of 6
(3,077 Views)

Move your initialization code outside of the loop.  You don't need to keep reinitializing the task.  You should setup the task once before the loop and close the task once after the loop.  You can then only perform the read inside of the loop.


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 6
(3,065 Views)
Solution
Accepted by topic author syedanas

Hello syedanas,

 

You can find the implementation of crossrulz statements below.  Also you do not need to create an array to feed n channels into the DAQmx Create Virtual Channel you can simply drop down the control/constant and specify both of the channels.  

 

hello6.png

 

Best Regards,

 

Izzy O.

Applications Engineer

National Instruments

www.ni.com/support

0 Kudos
Message 3 of 6
(3,053 Views)

thanks for helping.but,do you see somthing wrong with my arrays?i did not quite understands about it.i want to separate the two voltage input from the read.vi to form channel 1 and channel 2 voltage.did i got i wrong?please help.

regards,

anas

0 Kudos
Message 4 of 6
(3,050 Views)

HI Izzy O,

this one obviously can be understand by me.but, i do not need to concatecenate the two physical channel during the initialization to obtain two different input from two analog input pin do i?

0 Kudos
Message 5 of 6
(3,044 Views)

@syedanas wrote:

thanks for helping.but,do you see somthing wrong with my arrays?i did not quite understands about it.i want to separate the two voltage input from the read.vi to form channel 1 and channel 2 voltage.did i got i wrong?please help.

regards,

anas


Just use the Index Array.  Each channel will use a row in the 2D array.  The code shown already does this.


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 6 of 6
(3,036 Views)