From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when trying to configure an analog start trigger for my analog output task

Solved!
Go to solution

Hello,

 

I am working on creating an application that outputs a waveform on an analog output. I would like to have my analog output task use an AnalogEdge as it's start trigger but this seems to be causing issues. The code for setting up my analog output task can be seen below..

 

_captureAnalogOutputTask = new Task();
_captureAnalogOutputTask.AOChannels.CreateVoltageChannel("Dev2/ao0", "ao0", -10, 10, AOVoltageUnits.Volts); _captureAnalogOutputTask.Timing.ConfigureSampleClock("", 5000, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, 1000); _captureAnalogOutputTask.Triggers.StartTrigger.ConfigureAnalogEdgeTrigger("/Dev2/ai2", AnalogEdgeStartTriggerSlope.Rising, 1);
_captureAnalogOutputTask.Control(TaskAction.Verify);

More specifically, the following exception is thrown when I call the ConfigureAnalogEdgeTrigger function..

An exception of type 'NationalInstruments.DAQmx.DaqException' occurred in NationalInstruments.DAQmx.dll but was not handled in user code
Additional information: Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: NationalInstruments.DAQmx.StartTrigger.Type Requested Value: NationalInstruments.DAQmx.StartTriggerType.AnalogEdge Possible Values: NationalInstruments.DAQmx.StartTriggerType.DigitalEdge, NationalInstruments.DAQmx.StartTriggerType.None

Now seems like a good time to mention that I am using the NI USB-6218 BNC DAQ M-Series device. It seems like this exception implies that my device does not support using analog inputs as start triggers but, that is only a guess.

 

What's the issue here?

Thanks!

 

0 Kudos
Message 1 of 5
(2,643 Views)
Solution
Accepted by topic author b!tmaster

After reading the Analog Triggering Considerations for C Series, E Series, M Series, and S Series Devices my understanding is that it is not possible to trigger an analog output task from an analog start trigger, it is only possible for an analog input task. Can someone confirm this?

0 Kudos
Message 2 of 5
(2,622 Views)

Hi there, 

 

There is no trigger function for an analog output, this since you are able to completely program when you want it to start outputting a signal. You could use an analog input with an "if structure" and configure when to start your analog output.

 

Does that help?

 

 

0 Kudos
Message 3 of 5
(2,612 Views)

Andres,

 

There is a digital trigger function for an analog output so I ended using that instead. The following statement sets a digital start trigger for my analog output task.

 

_stageTwoCaptureAnalogOutputTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("/Dev3/PFI1", DigitalEdgeStartTriggerEdge.Rising);
0 Kudos
Message 4 of 5
(2,607 Views)

I see, thanks for putting me up to speed! Success!

0 Kudos
Message 5 of 5
(2,597 Views)