LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading and Recording Two Signals

Hi,

 

I am looking to read in two signals, both are triggered voltage pulses, and plot them on the same waveform chart and print them into the same excel file.  I get an error saying, "The specified resource is reserved," when I try to run the code. Also, I have not been able to wire the error out to the "Write to File" error in, but I'm not sure if that's necessary.  The code is attached.

 

Thanks!

0 Kudos
Message 1 of 4
(2,805 Views)

You basically just need to put the Channel VIs in series and they will be added to the same task.  A lot of devices only have 1 A/D converter, which is why you get the "resource in use" error. 

Capture.PNG

aputman
0 Kudos
Message 2 of 4
(2,780 Views)

This is a very common question so for a full explanation just Google "LabVIEW DAQ Resource Reserved Error" or search this forum.

 

Quick answer to get you going:  There is only one sampling clock on most DAQ devices so you can't run two separate AI tasks simultaneously.  You'll need to create ONE task with TWO channels.  For example to collect 2 channels on AI0 and AI1 of Device1 use Dev1/ai0:1.

 

Your DAQmx code will then collect a 2D array.  Index 0 containing the Y array of channel 1 and index 1 containing channel 2.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 3 of 4
(2,775 Views)

Thanks!  I didn't know that, but this seems to work.

0 Kudos
Message 4 of 4
(2,705 Views)