06-18-2009 06:59 PM
I'm using DAQmx in C# to monitor a TTL signal (3ms wide), wait a specified period of time, and then send a pulse on the counter output line (1ms wide). I have set it to be retriggerable so that for every input pulse, I get an output pulse after the delay period. This works like a charm on one machine.
On the other, I get two output pulses. If I vary my delay value, the two pulses are delayed in lockstep, and their interval is precisely the width of the input pulse. It looks on the scope like the trigger is occurring on both the rising and falling edges, although I've asked for only the rising one.
As a hack, I lengthend the duration of the output pulse to 3ms, so that it outlasted the trigger pulse. This resolved the issue, but is not workable long-term because it limits the rate I can do this operation.
Has anybody seen this behavior, or have any clues? My understanding is that the task will not retrigger until it sees another rising edge, and that the falling edge will not retrigger it.
Oh - we swapped the PCI-6052E card with a new one, but the problem remained. This problem does NOT happen on a machine we built 6 months ago.
Here's the code:
_triggerTask.COChannels.CreatePulseChannelTime(_cameraCounterLine, string.Empty, COPulseTimeUnits.Seconds, COPulseIdleState.Low, 0, _delaySecs, triggerLengthSec);
_triggerTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger( triggerLine,
DigitalEdgeStartTriggerEdge.Rising);
_triggerTask.Triggers.StartTrigger.Retriggerable = true;// generate 1 pulse
_triggerTask.Timing.ConfigureImplicit(SampleQuantityMode.FiniteSamples, 1);_triggerTask.Control(TaskAction.Verify);_triggerTask.Start();
Thanks -
John Duddy
Solved! Go to Solution.
06-19-2009 04:44 PM
06-19-2009 04:47 PM
We just figured it out - the Heisenberg Uncertainty Principle applied to Classical Mechanics. The problem went away when we disconnected the oscilloscope. Without the scope connected, we had to infer that the problem went away (no direct evidence) but I am convinced. It was the same scope we used last time too.
It's a good lesson - when contradictions arise, check your premises.