11-04-2013 02:41 PM
Greetings to all my friends on the digitizer board,
I am trying to send a software trigger to my 5114 digitizer in C#.NET . There are no cables attached to the board, so there are no signals going in. It runs fine with the trigger set to "immediate". However I would like to do a software trigger while I am testing things. It is not working - when I tell it to FetchByte it crashes with a timeout.
Here is the basic gist of what I have in my code:
PrecisionTimeSpan triggerHoldoff = PrecisionTimeSpan.Zero;
PrecisionTimeSpan triggerDelay = PrecisionTimeSpan.Zero;
scopeSession.Trigger.ConfigureTriggerSoftware(triggerHoldoff, triggerDelay);
scopeSession.Measurement.Initiate();
scopeSession.Trigger.AdvanceTrigger.SendSoftwareEdgeTrigger(); // Is this right?
waveformByte = scopeSession.Channels[ChannelName].Measurement.FetchByte(timeout, 1, waveformByte, out waveformInfo); // This request times out.
Does this look right, or is there some other way to configure a generic software trigger and then send it to the 5114? Thanks for any thoughts.
Regards,
Penny
Solved! Go to Solution.
11-05-2013 11:55 AM
Hi Penny,
It looks like things are in the right order; however, I noticed that the software trigger function for the Scope is different than in our other drivers. It should be "SendSoftwareTriggerEdge" (see http://zone.ni.com/reference/en-XX/help/370592V-01/scopefunc/cviniscope_sendsoftwaretriggeredge/). Just a minor naming convention difference, but it should work in the same way.
11-06-2013 02:03 PM
Hi Matt,
Thanks for the reply. Right, I am using NI-Scope.NET 2.0 so maybe the exact syntax is a little different. As it turns out I just needed to do some more investigating into the triggering. I am having better luck using scopeSession.Trigger.ReferenceTrigger.SendSoftwareEdgeTrigger() and keeping better track of what is being acquired and when. Thanks again for the help.
Best regards,
Penny
11-07-2013 09:32 AM
Thanks again,
Penny
11-07-2013 09:39 AM
Penny,
Thanks for using the NI-SCOPE .NET 2.0 API so soon after release!
To help answer your question as to why scopeSession.Trigger.ReferenceTrigger.SendSoftwareEdgeTrigger() worked and scopeSession.Trigger.AdvanceTrigger.SendSoftwareEdgeTrigger(); did not can be found in the following Help File Topics:
http://zone.ni.com/reference/en-XX/help/370592V-01/digitizers/5122_state_model/
Your code timed out because it was in a pre-sampling state, waiting for the Reference Trigger. Once an acquisition is complete, that is when (in yellow) it will wait for the Advance Trigger. The advance trigger is used for multi-record acquisitions, and allows you to wait between records.
This chart is also very helpful since it shows all the events that can be exported, and triggers that can be imported for your digitizer. (and at what times those triggers can be used.)
I hope that helps!
-Nathan
11-07-2013 06:42 PM
Best regards,
Penny