|
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
|