LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

two signal acquisition subtraction

Hi guys

 

I am trying to acquire voltage using NI 9205 in a cDAQ  chassis.  I want to acquire two different signals at the same time so that i can subtract one voltage from the other.

 

Just a jist of my application: basically i want to perform V1 - V2. I know that the first impression would be using a differential mode.  But both my signals are acquired in differential mode. if it helps, one signal is random and the other signal is dc (from a thermocouple).  and i have to obtain the random signal from the channel (thats the restriction).

 

 

when i tried it using two physical channels in my program i was getting an error.

 

any suggestions?

 

Ishan 

0 Kudos
Message 1 of 4
(3,725 Views)

If your DAQ task is setup right, you should get a 2D array of data.

Rows, #chaneels read

Cols, #data points read

So by subtraction of row 1 from row 2 your problem should be solved Smiley Wink

 

Anyway, what error do you get?

Can you share some code?

0 Kudos
Message 2 of 4
(3,720 Views)

hi alain

 

the attachment contains the vi which i tried out.  the error which i encounter is Error -50103 Possible reason(s):The specified resource is reserved. The operation could not be completed as specified.Task Name: _unnamedTask<2> .

 

i am sending you a screenshot of the error display.   

 

going back to your suggestion: yes perhaps looks the more logical way of doing the task. i will try it out.  ( i am a newbie so i will take some time)

 

thanks 

cheers

ishan 

Download All
0 Kudos
Message 3 of 4
(3,701 Views)
  • The upper DAQmx read has the wrong selection. NChan NSamp while it should be 1Chan NSamp like the lower one.
  • I don't see the need of the "Sort 1D array" vi in the loop.
  • I don't see the need of the loop at all 🙂
  • So forget about both and just wire the outputs of both DAQmx read to the Subtract vi.
  • I would also add a delay in the loop to free processor resources.
  • You don't need two DAQmx "strings".
    You can use only one but define multiple analog channels in the "Physical Channels" control.
    Something like this (from the help)

Physical Channel Ranges

To specify a range of physical channels, use a colon between two channel numbers or two physical channel names:

Dev0/ai0:4

Dev0/ai0:Dev0/ai4

For digital I/O, you can specify a range of ports with a colon between two port numbers:

Dev0/port0:1

You also can specify a range of lines:

Dev0/port0/line0:4

Dev0/line0:31

You can specify channel ranges in reverse order:

Dev0/ai4:0

Dev0/ai4:Dev0/ai0

Dev0/port1/line3:0

Physical Channel Lists

Use commas to separate physical channel names and ranges in a list as follows:

Dev0/ai0, Dev0/ai3:6

Dev0/port0, Dev0/port1/line0:2

 

The loop of a solution with only one DAQmx "string" will look like this

SNAG-037.jpg

 

Good luck!

0 Kudos
Message 4 of 4
(3,693 Views)