Thread Subject: NI DAQ Hw Trigger Output

Subject: NI DAQ Hw Trigger Output

From: Jason

Date: 8 Feb, 2008 15:12:11

Message: 1 of 7

MATLAB version:
7.5.0.342 (R2007b)

Data Acquisition Toolbox version:
       Name: 'Data Acquisition Toolbox'
    Version: '2.11'
    Release: '(R2007b)'
       Date: '02-Aug-2007'

NI-DAQmx 8.0.1f0


                AdaptorName: 'nidaqmx'
                 DeviceName: 'PXI-6713'
                         ID: 'PXI1Slot2'
                       Port: [1x1 struct]
              SubsystemType: 'DigitalIO'
                 TotalLines: 8
    VendorDriverDescription: 'National Instruments NIDAQmx
driver'
        VendorDriverVersion: '8.0'

The task is to trigger an analog output using the Digital
Trigger on the NI PXI-6713 board with a BNC 2110 box. In
theory this should be possible. I have read that this works
in Labview but not in Matlab. Apparently one can trigger
analog input (i.e. acquisition of data) using a hardware
clock but not an analog output? Is this true, if yes is
there any workaround?

Code:
function [ out ] = dc_test2(a,b)

a0 = analogoutput('nidaq','PXI1Slot2');

addchannel(a0,1);
addchannel(a0,0);
set(a0,'SampleRate',100000);
set(a0,'TriggerType','HwDigital');
set(a0,'HwDigitalTriggerSource','PFI0');
% get(a0);
    
data = a*ones(100,1);
data2 = b*ones(100,1);
putdata(a0,[data data2]);

start(a0);
trigger(a0);
wait(a0,1);
% showdaqevents(a0);
delete(a0);
clear a0;

Error:
??? NIDAQmx error : Specified route cannot be satisfied,
because it
requires
resources that are currently in use by another route. Property:
DAQmx_DigEdge_StartTrig_Src Property:
DAQmx_DigEdge_StartTrig_Edge
Source
Device: PXI1Slot2 Source Terminal: PFI0 Required Resources
in Use by
Task
Name: MWDAT0709 Source Device: PXI1Slot2 Source Terminal:
Software
Destination
Device: PXI1Slot2 Destination Terminal: ao/StartTrigger
Task Name:
MWDAT0842
Status Code: -89137

Error in ==> dc_test2 at 26
start(a0);

Thanks,
Jason

Subject: NI DAQ Hw Trigger Output

From: Jason

Date: 8 Feb, 2008 16:34:02

Message: 2 of 7

Sorry folks, problem solved! Infact you CAN trigger analog
output using NIDAQmx from a digital clock. Some people on
the NI forum were saying you can't.
If anyone needs to know details let me know.
-Jason

Subject: NI DAQ Hw Trigger Output

From: enahs19@gmail.com

Date: 27 Feb, 2008 16:28:18

Message: 3 of 7

On Feb 8, 8:34=A0am, "Jason " <jf...@ic.ac.uk> wrote:
> Sorry folks, problem solved! Infact you CAN trigger analog
> output using NIDAQmx from a digital clock. Some people on
> the NI forum were saying you can't.
> If anyone needs to know details let me know.
> -Jason

I would like to trigger analog input and output on multiple devices
using a hardware digital trigger through matlab. I define a digital
output device and the available ports (in matlab) are the PO lines (on
the BNC2110 breakout box). Matlab allows one to define a digital
trigger for an analog input/output device, but the PO lines are not
available for this. Only the PFI and RTSI lines. I actually have an
RTSI connector, but Matlab doesn't seem to support RTSI lines. While
matlab allows for manipulation of the digital I/O PO lines, I fear it
also seems that matlab does not allow for manipulation of the PFI
lines which it does allow to be used as digital triggers. At the same
time it does not allow the PO lines to be used directly as digital
triggers for the analog I/O. I can define a PFI digital trigger source
and then hardwire that to a PO line that I can manipulte. In this case
the PO line would have to be physically connected to the PFI on all
the devices. In this case I am only using 2 devices (PCI6133 PCI6115),
but may eventually use more. Any thoughts?

Subject: NI DAQ Hw Trigger Output

From: Rob Purser

Date: 27 Feb, 2008 16:56:02

Message: 4 of 7

Sorry, currently, the Data Acquisition Toolbox only allows
you to "receive" triggers from PFIs and RTSI lines, but
currently we can't "transmit/output" on PFIs and RTSI lines.

-Rob

Subject: NI DAQ Hw Trigger Output

From: Shane

Date: 29 Feb, 2008 21:04:26

Message: 5 of 7

"Rob Purser" <rob.purser@mathworks.com> wrote in message
<fq44n1$f7s$1@fred.mathworks.com>...
> Sorry, currently, the Data Acquisition Toolbox only allows
> you to "receive" triggers from PFIs and RTSI lines, but
> currently we can't "transmit/output" on PFIs and RTSI lines.
>
> -Rob

Hi Rob,

I have been doing alot of tinkering with the DAQ tool box (Matlab 7.2 tolbox
ver ver 2.8.1) to control NI devices. I found that if I specify a digital hw
trigger for an analog input device (or AO device) and set the trigger to trigger
from 'PFI0' (or any of the PFI's), the triggering doesn't seem to work, at least
not from the matlab side. Specifically, I hardwired the digital port, PO1 (or
any of them) to the PFI0. Then I changed the state of the PO1 from 0 to 1 or
from 1 to zero, no trigger was initiated in matlab. I used a voltmeter to verify
that the voltage on the PFI0 terminal was indeed changing from 0 to 1
(actually its 0 to 5V). Each time I changed the state I checked to see if the
device had been triggered (using get(AI) command). There was always a zero
in the AI.triggersexecuted property, i.e. no triggers. The analog input device
which was directed to use the digitalhwtrigger was started at the time. If this
procedure doesn't initiate a trigger, then I am not sure how the Matlab
digitalhwtrigger functionality works, or if it even works at all. Any
suggestions?

Subject: NI DAQ Hw Trigger Output

From: Shane

Date: 29 Feb, 2008 21:05:04

Message: 6 of 7

"Rob Purser" <rob.purser@mathworks.com> wrote in message
<fq44n1$f7s$1@fred.mathworks.com>...
> Sorry, currently, the Data Acquisition Toolbox only allows
> you to "receive" triggers from PFIs and RTSI lines, but
> currently we can't "transmit/output" on PFIs and RTSI lines.
>
> -Rob

Hi Rob,

I have been doing alot of tinkering with the DAQ tool box (Matlab 7.2 tolbox
ver ver 2.8.1) to control NI devices. I found that if I specify a digital hw
trigger for an analog input device (or AO device) and set the trigger to trigger
from 'PFI0' (or any of the PFI's), the triggering doesn't seem to work, at least
not from the matlab side. Specifically, I hardwired the digital port, PO1 (or
any of them) to the PFI0. Then I changed the state of the PO1 from 0 to 1 or
from 1 to zero, no trigger was initiated in matlab. I used a voltmeter to verify
that the voltage on the PFI0 terminal was indeed changing from 0 to 1
(actually its 0 to 5V). Each time I changed the state I checked to see if the
device had been triggered (using get(AI) command). There was always a zero
in the AI.triggersexecuted property, i.e. no triggers. The analog input device
which was directed to use the digitalhwtrigger was started at the time. If this
procedure doesn't initiate a trigger, then I am not sure how the Matlab
digitalhwtrigger functionality works, or if it even works at all. Any
suggestions?

Subject: NI DAQ Hw Trigger Output

From: Rob Purser

Date: 20 Oct, 2008 19:50:19

Message: 7 of 7

Hi all,

 

As of our October 2008 release, R2008b, the Data Acquisition Toolbox provides full support for RTSI signals. For a demo, visit

http://www.mathworks.com/products/daq/demos.html?file=/products/demos/shipping/daq/demosync_ai_and_ao.html

 

-Rob

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
hardware Rob Purser 27 Feb, 2008 11:52:39
data acquisition Rob Purser 27 Feb, 2008 11:52:39
daq Jason 8 Feb, 2008 10:15:07
trigger Jason 8 Feb, 2008 10:15:07
hw Jason 8 Feb, 2008 10:15:07
analog Jason 8 Feb, 2008 10:15:07
output Jason 8 Feb, 2008 10:15:07
nidaqmx Jason 8 Feb, 2008 10:15:07
nidaq Jason 8 Feb, 2008 10:15:07
rssFeed for this Thread

Contact us at files@mathworks.com