High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to send a software trigger to 5114

Solved!
Go to solution

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

 

 

 

0 Kudos
Message 1 of 6
(7,574 Views)

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.

0 Kudos
Message 2 of 6
(7,566 Views)

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

 

0 Kudos
Message 3 of 6
(7,552 Views)
Hi Matt,
If you are still on this thread, could I ask another question?  I am now sending a software trigger to the PCI-5114 and then fetching the data, one record at a time.  Everything looks good.  The next thing I am trying to do is put in a triggerHoldoff so that the 5114 triggers 20 seconds after I tell it to trigger.  So far no luck.  I put in the 20 second triggerHoldoff (below) and then did a FetchByte with a timeout of 5 seconds.  In my understanding the FetchByte should have crashed with a timeout in this scheme since the 5114 should not have triggered for another 15 seconds.  Instead it just Fetches the data without any trouble whatsoever.  Could I be missing something important here?

Thanks again,
Penny


scopeSession.Timing.ConfigureTiming(SampleRateMin, RecordLengthMin, referencePosition, 1, enforceRealtime);              
 
PrecisionTimeSpan triggerHoldoff = PrecisionTimeSpan.FromSeconds(20.0);
PrecisionTimeSpan triggerDelay = PrecisionTimeSpan.Zero;
scopeSession.Trigger.ConfigureTriggerSoftware(triggerHoldoff, triggerDelay);
scopeSession.Measurement.Initiate();
scopeSession.Trigger.ReferenceTrigger.SendSoftwareEdgeTrigger();

PrecisionTimeSpan timeout = new PrecisionTimeSpan(5.0);
waveformByte = scopeSession.Channels[ChannelName].Measurement.FetchByte(timeout, 1, waveformByte);

0 Kudos
Message 4 of 6
(7,542 Views)
Solution
Accepted by topic author Penny

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

Systems Engineer
SISU
0 Kudos
Message 5 of 6
(7,540 Views)
Hi Nathan,
Thanks very much for forwarding the NI-Scope.NET 2.0 beta libraries (after https://forums.ni.com/t5/Measurement-Studio-for-NET/ni-scope-net-class-library-1-1-and-Windows-7/m-p... ) and for the state diagram.  I can see that there are some things to ponder here.  In the meantime I am glad to hear that everything seems to be working as expected.

Best regards,
Penny

0 Kudos
Message 6 of 6
(7,526 Views)