Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronization of a cDAQ 9234 (AI) and 9230 (AO) 89120 error using "/<mod>/ai/StartTrigger"

I'm sorry if this is in the wrong forum.  I could not find one more specific to DAQmx.

 

The system comprises a cDAQ-9174
with
cDAQ2Mod1 [an NI-9234]
cDAQ2Mod2 [na NI-9230 (BNC)]

I am using NiDAQmx v20.1


I am setting up an output task using,

_outputTask = New DAQmx.Task("OutputTask") With {.SynchronizeCallbacks = True}
_outputTask.Stream.Timeout = -1
_outputWriter = New DAQmx.AnalogMultiChannelWriter(_outputTask.Stream) With {.SynchronizeCallbacks = False}


I am setting up one output on that task using,

vendorOutputChannel = _outputTask.AOChannels.CreateVoltageChannel(.Tag.ToString, String.Empty,
- .VoltageSettingNow.ValueInVolts, + .VoltageSettingNow.ValueInVolts,
DAQmx.AOVoltageUnits.Volts)
Where:
String.Empty = (String)""
.Tag.ToString = (String)"cDAQ2Mod2/ao0"
.VoltageSettingNow.ValueInVolts = (Single)4.24264


The sample source and sample rate are set for the output task using,

_outputTask.Timing.SampleTimingType = DAQmx.SampleTimingType.SampleClock
_outputTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("/" & _inputDevice & "/ai/StartTrigger", DAQmx.DigitalEdgeStartTriggerEdge.Rising)
_outputTask.Timing.ConfigureSampleClock(String.Empty, MyBase.SampleRateInHzNow, DAQmx.SampleClockActiveEdge.Rising,
DAQmx.SampleQuantityMode.FiniteSamples, MyBase.SampleCountNow)
Where:
[Source =] "/" & _inputDevice & "/ai/StartTrigger" = (String)"/cDAQ2Mod1/ai/StartTrigger"
MyBase.SampleRateInHzNow = (Single)2133.33325
MyBase.SampleCountNow = (Integer)MyBase.SampleCountNow


The task is successfully verified using, (no exceptions are thrown)

_outputTask.Control(DAQmx.TaskAction.Verify)


I get the error when I execute the line,

_outputWriter.WriteMultiSample(True, _outputData)

Where:
OutputData = _outputData As Double(,)
with length = 500
_outputData(0,0) = value1
_outputData(0,1) = value2
::
_outputData(0,499) = value500

Based on the error,
{Error=-89120 Message="Source terminal to be routed could not be found on the device." & vbLf & vbLf & "Make sure the terminal name is valid for the specified device. Refer to Measurement & Automation Explorer for valid terminal names." & vbLf & vbLf & "Property: NationalInstruments.DAQmx.DigitalEdgeStartTrigger.Source" & vbLf & "Property: NationalInstruments.DAQmx.DigitalEdgeStartTrigger.Edge" & vbLf & "Source Device: cDAQ2Mod1" & vbLf & "Source Terminal: ai/StartTrigger" & vbLf & vbLf & "Task Name: OutputTask" & vbLf & vbLf & "Status Code: -89120"}

 

The issue seems to be the use of "/cDAQ2Mod1/ai/StartTrigger" as the output start trigger that's used with the '_outputTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger()' call.


This error is thrown before this line is used to start the input task.

_inputReader.BeginReadMultiSample(_analogInputBufferSampleCount, New AsyncCallback(AddressOf ReaderServiceCallback), _inputTask)


I need to be able to synchronize the start of the analog output task with the start of the analog input task. What should the source be set to in the 'ConfigureDigitalEdgeTrigger()' call to accomplish this synchronization? Maybe there's something that needs to be done to the output task before the call to 'WriteMultiSample()'?

 

0 Kudos
Message 1 of 1
(858 Views)