Using Predefined or Custom Values for Source or Output Terminal Properties

NI RF Vector Signal Analyzers (NI-RFSA 18.1) Help

Edition Date: June 2018

Part Number: 372058U-01

View Product Info

Download Help (Windows Only)


NI-RFSA 18.1 Help
NI-RFSA 18.2.1 Help
NI-RFSA 19.1 Help

How Do I Pass a Value to an NI-RFSA Property?

There are certain properties, such as trigger sources, clock sources, and output terminals, that work with a set of predefined string values, but might also accept custom values. For this you can use the utility classes that are part of NI-RFSA .NET API. For example, the Source property in RfsaDigitalEdgeStartTrigger specifies an RfsaDigitalEdgeStartTriggerSource object. You can configure Source using one of the predefined values, such as:

VB.NET
session.Configuration.Triggers.ReferenceTrigger.DigitalEdge.Source = RfsaDigitalEdgeReferenceTriggerSource.Pfi0
C#
session.Configuration.Triggers.ReferenceTrigger.DigitalEdge.Source = RfsaDigitalEdgeReferenceTriggerSource.Pfi0;

You can also create a custom value with the static FromString method.

VB.NET
session.Configuration.Triggers.ReferenceTrigger.DigitalEdge.Source = RfsaDigitalEdgeReferenceTriggerSource.FromString("CustomSource")
C#
session.Configuration.Triggers.ReferenceTrigger.DigitalEdge.Source = RfsaDigitalEdgeReferenceTriggerSource.FromString("CustomSource");

You can also directly set the source as a string instead of using the FromString method.

VB.NET
session.Configuration.Triggers.ReferenceTrigger.DigitalEdge.Source = "CustomSource"
C#
session.Configuration.Triggers.ReferenceTrigger.DigitalEdge.Source = "CustomSource";

How Do I Get the Underlying String from Source or Output Terminal Value?

You can use the ToString method to retrieve the underlying source values. For example, the following code shows how to retrieve the source name:

VB.NET
Dim triggerSource As String = RfsaDigitalEdgeReferenceTriggerSource.Pfi0.ToString()
C#
string triggerSource = RfsaDigitalEdgeReferenceTriggerSource.Pfi0.ToString();

You can use the underlying string value if you want to assign a source or output terminal to some other source or output terminal.

VB.NET
session.Configuration.Events.ReadyForReferenceEvent.OutputTerminal = RfsaReadyForReferenceEventExportedOutputTerminal.Pfi0
session.Configuration.Triggers.ReferenceTrigger.DigitalEdge.Source = session.Configuration.Events.ReadyForReferenceEvent.OutputTerminal.ToString()
C#
session.Configuration.Events.ReadyForReferenceEvent.OutputTerminal = RfsaReadyForReferenceEventExportedOutputTerminal.Pfi0;
session.Configuration.Triggers.ReferenceTrigger.DigitalEdge.Source = session.Configuration.Events.ReadyForReferenceEvent.OutputTerminal.ToString();

WAS THIS ARTICLE HELPFUL?

Not Helpful