Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronization of two analogue DAQmx outputs, error -89131

I am trying to synchronize two analogue waveform outputs.  I can run and observe both channels  in isolation but cannot work out how to run both at the same time.  I'm a novice Labview user.

 

My system contains the following:

Labview 2012

Windows 7

PCI-6035 DAQ card

 

I've attempted to write code configured as MASTER/SLAVE, an error occurs when the code attempts to write the waveform to the SLAVE output (DAQmx Write), error code -89131

 

Any help would be much appreciated

 

Thanks

 

Duncan

0 Kudos
Message 1 of 7
(5,295 Views)

Hi Duncan,

 

As you are trying to write to one channel for the master and one channel for the slave, i think that the problem may be cause by the fact that each of your DAQmx write VIs are configured for multiple channels. If you select a single sample for DAQmx write function this may solve your issue.

 

Regards,

 

TomS

0 Kudos
Message 2 of 7
(5,186 Views)

Edit*

 

If you select a single channel for DAQmx write function this may solve your issue.

 

Apologies

0 Kudos
Message 3 of 7
(5,173 Views)

Hi Duncan,

 

Please see the attached example programs that demonstrate synchronisation and simultaneous start. 

 

Regards,

 

Tom-S

MEng (Hons) CLAD
Applications Engineer
National Instruments

0 Kudos
Message 4 of 7
(5,161 Views)

Hi Tom,

 

Thanks for the feedback and examples.

 

The examples you provided have synchronised 1x analog input and 1x output.  I'm trying to synchronise 2x analog outputs, I'll try to amend your code.

 

Duncan

0 Kudos
Message 5 of 7
(5,077 Views)

Hi Duncan,

 

For most DAQ devices, only one hardware timed task per subsystem (i.e. analog input, analog output, digital input/ouput, ...) can run at once.  Each subsystem has its own dedicated timing and triggering circuitry, and your code has two separate AO tasks trying to configure the AO subsystem's resources simultaneously.  After the resources are configured the first time, the second task notices that they're already being used, and it tosses you an error indicating as much.

 

In order to configure multiple AO channels on a single device, you need to include both (or all) of them in a single task.  For your application, since it looks like your channels will be updating at the same rate, this will be fairly straightforward.

 

  1. Open the Voltage - Continuous Output example that you used as a starting point for your code.
  2. Configure the Physical Channel(s) input -- either in the existing front panel control or as a block diagram constant -- to include both channels.  You can use the dropdown, select Browse, and Ctrl-click multiple channels or you can simply type Dev1/ao0:1 into the field.
  3. Now that the task contains two channels, it expects you to define two waveforms to write to the output.  In the example, all you have to do is initialize a second element in the Waveform Settings array.  Just increase the array index value to 1 to view the second entry (should be grayed out, at first) and select the Waveform Type, Frequency, or Amplitude for the waveform you want to send out on AO1.

 

That should get you going.  Let us know if you run into any other hurdles as you develop your DAQ application!

 

 

KB

 

- Additional reference: Simultaneous AO Tasks on the Same Device

Message 6 of 7
(5,064 Views)

Hi Kyle,

 

Configuring the two channels into the one task works for me, I can now output the two analogue channels simultaneously.

 

Thanks for your advice.

 

Duncan

0 Kudos
Message 7 of 7
(5,002 Views)