LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI DAQ USB - 6221 , problem while using both the Analog output channel

Dear All,

I have written a lab view program, which is using AO0 channel of NI DAQ USB - 6221  to generate square wave and AO1 channel of NI DAQ USB - 6221  to generate sine wave. 

 

When I run these program one by one they are working fine. While when I run both together, it gives error as ( NI DAQ mx - 50103 , ' the specified resource is reserved' )

 

Do anyone tell me how can I use both the channels simultaneously to simulate different tasks for  my experiment.

Thanks and Regards

Ashish Garg 

 

0 Kudos
Message 1 of 7
(3,651 Views)

Attach your VI (so we can see what you did) and we may be able to suggest how to make the code do what you want.

 

Bob Schor

0 Kudos
Message 2 of 7
(3,554 Views)

Do a search for Error -50103, and you'll find it is a common issue.  Make sure both channels are a part of the same analog output task.  If you created two tasks, one for each channel, one task or the other will give this error.  The "specified resource" is the single timing counter that exists within the DAQ device.

Message 3 of 7
(3,552 Views)

Hi Bob Schor,

 

I am attaching the .vi, which I am using with DAQ 6221 to generate sine and square wave simultaneously with channel 0 and 1. I tried the same .vi by putting two DAQ in different parallel while loop as well, which also did not work. 

Please find attached the .vi .

 

Thanks and Regards

Ashish

0 Kudos
Message 4 of 7
(3,544 Views)

Hi Bob Schor,

 

I am attaching the .vi, which I am using with DAQ 6221 to generate sine and square wave simultaneously with channel 0 and 1. I tried the same .vi by putting two DAQ in different parallel while loop as well, which also did not work. 

Please find attached the .vi .

 

Thanks and Regards

Ashish

Download All
0 Kudos
Message 5 of 7
(3,544 Views)

I should have guessed -- the Dreaded DAQ Assistant has "messed" with another poor student trying to learn LabVIEW.  Here are some recommendations:

  • Learn the "basics" of DAQmx.  Read Learn 10 Functions in NI-DAQmx ... to see how simple it is to use DAQmx for your DAQ tasks.
  • For simple things (as this is), learn how to create a Task, either in MAX or (better) in LabVIEW Project.  Of course, you need to be doing your development using a Project.
  • (Almost) always do LabVIEW Development in a Project.  This is especially true for Homework (a good Instructor should give "Extra Credit" for using Project).
  • About Tasks --
    • Open MAX, look in Data Neighborhood for Tasks, choose NI-DAQmx Tasks, and click Create New Task.  Have your DAQ device plugged in.  Alternatively, you can open your Device and click Create Task.
    • Define the Task.  In your case, it will be two channels (two!) of Signal Generation.  Give the Task a sensible Name, configure it appropriately.  Pay particular attention to Timing -- you usually want Continuous Samples.
    • Run the Task to be sure it "looks right", then Save the Task.
    • If you are using LabVIEW Project, you can do the same thing without using MAX.  Right-click My Computer (in the Project Explorer), New, NI-DAQmx Task.  Configure the Task.
    • Once you have defined a Task, programming DAQmx is almost trivial.  You need a Start Task, Read (or Write), and Stop Task function, with the Task and Error Lines connected.  In Start Task, right-click the Task Input terminal, choose Create, Constant, click the "Drop-down" arrow, and the MAX and Project Tasks you have created will appear.  Choose the right Task, and all the configurations you specified will be loaded.  In particular, you now have started two channels, can set up N-Channel, N-Sample Read/Writes and you'll get both channels at the same time (you obviously need to provide two channels of data for input or output).

I hope the above makes sense to you.  Your VI should reduce to a single Start Task with an appropriate Task Constant wired to it (again, if you do this in a LabVIEW Project, the Task "stays with" the Project, so you can move the code to another PC and it will run), a While Loop with the DAQmx Write (whose input is a 2D array of Channel 0 and Channel 1 samples), and a DAQmx Stop or Clear Task after the loop.

 

Bob Schor

0 Kudos
Message 6 of 7
(3,541 Views)

Hi Bob, 

I made the program as you said, it is working as well, I am able to use both output channel of DAQ 6221  and able to give TTL signal to camera and voltage to shaker. But while doing so, there is a time lapse of 100 millisecond, is there any way I can start both TTL signal and shaker simultaneously. 

 

Thanks and Regards

Ashish Garg

 

0 Kudos
Message 7 of 7
(3,484 Views)