Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

PCIe-6321 - Unable to set Analog Input Reference Trigger to Analog Edge type

Hello,

 

In our application, we are trying to detect the time that a projectile makes contact with a surface by monitoring the acceleration/vibration on the surface. I set up an analog input task with continuous sampling and tried to configure a trigger to detect an input signal above a threshold. This task consists of three input channels to monitor the accelerometer and a couple other inputs. I use an AnalogMultiChannelReader to periodically read the values of the channels to display to an operator.

 

The code looks vaguely as follows:

Create input channels (x3)

  • myTask.AIChannels.CreateVoltageChannel(pchannel, Name, AITerminalConfiguration.Rse, minVoltage, maxVoltage, AIVoltageUnits.Volts);

Configure task timing

  • myTask.Timing.ConfigureSampleClock("", sampleRate, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples);

Configure multi channel reader

  • multiReader = new AnalogMultiChannelReader(myTask.Stream);

Manually verify the task

  • myTask.Control(TaskAction.Verify);

Configure trigger

  • myTask.Triggers.ReferenceTrigger.ConfigureAnalogEdgeTrigger(channels[channel].Name, AnalogEdgeReferenceTriggerSlope.Rising, threshold, preTriggerSamples);

(Eventually) Retrieve timestamp of latest trigger event

  • public DateTime TriggerTimestamp { get => myTask.Triggers.ReferenceTrigger.Timestamp.ToDateTime(); }

 

Prior to configuring the trigger, I was able to read data from all three channels. I added the code for the trigger and now cannot load my application due to a -200077 error stating:

 

"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.ReferenceTrigger.Type

Requested Value: NationalInstruments.DAQmx.ReferenceTriggerType.AnalogEdge

Possible Values: NationalInstruments.DAQmx.ReferenceTriggerType.DigitalEdge, NationalInstruments.DAQmx.ReferenceTriggerType.None"

 

As far as I can tell from the documentation provided, any Reference Trigger should be able to be configured with an Analog Edge trigger.

 

Is this a limitation for this specific board that I could not find in the documentation? Or is there another method to configure the channels/task/trigger? Any help or ideas are appreciated. Thanks!

0 Kudos
Message 1 of 1
(728 Views)