NI RFSG Configuration: Clock, Deembedding, P2P, & Scripting - ni/grpc-device GitHub Wiki

Configure Clock

niRFSG_ConfigureRefClock

C Function Prototype

ViStatus niRFSG_ConfigureRefClock (ViSession vi, ViConstString clockSource, ViReal64 refClockRate);

Purpose

Configures the NI-RFSG device Reference Clock. The Reference Clock ensures that the NI-RFSG devices are operating from a common timebase. The NI-RFSG device must be in the Configuration state before calling this function.

Supported Devices: PXI-5610, PXIe-5644/5645/5646, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841

Related Topics

PXIe-5672 Timing Configurations

PXIe-5673 Timing Configurations

PXIe-5673E Timing Configurations

[PXIe-5830 Timing Configurations](javascript:LaunchMergedHelp('RFSG.chm', 'PXIe-5830.chm', 'timing-configurations.html'))

[PXIe-5831 Timing Configurations](javascript:LaunchMergedHelp('RFSG.chm', 'PXIe-5831.chm', 'timing-configurations.html'))

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
refClockSource ViConstString Specifies the source of Reference Clock signal.

PXIe-5841 with PXIe-5655—Lock to the PXIe-5655 onboard clock. Connect the REF OUT connector on the PXIe-5655 to the PXIe-5841 REF IN connector.
NIRFSG_VAL_ONBOARD_CLOCK_STR (default) Uses the onboard Reference Clock as the clock source.

PXIe-5830/5831/5832—For the PXIe-5830, connect the PXIe-5820 REF IN connector to the PXIe-3621 REF OUT connector. For the PXIe-5831, connect the PXIe-5820 REF IN connector to the PXIe-3622 REF OUT connector. For the PXIe-5832, connect the PXIe-5820 REF IN connector to the PXIe-3623 REF OUT connector.

PXIe-5831 with PXIe-5653—Connect the PXIe-5820 REF IN connector to the PXIe-3622 REF OUT connector. Connect the PXIe-5653 REF OUT (10 MHz) connector to the PXIe-3622 REF IN connector.

PXIe-5832 with PXIe-5653—Connect the PXIe-5820 REF IN connector to the PXIe-3623 REF OUT connector. Connect the PXIe-5653 REF OUT (10 MHz) connector to the PXIe-3623 REF IN connector.
NIRFSG_VAL_REF_IN_STR Uses the clock signal present at the front panel REF IN connector as the clock source.

PXIe-5830/5831/5832—For the PXIe-5830, connect the PXIe-5820 REF IN connector to the PXIe- 3621 REF OUT connector. For the PXIe-5831, connect the PXIe-5820 REF IN connector to the PXIe-3622 REF OUT connector. For the PXIe-5832, connect the PXIe-5820 REF IN connector to the PXIe-3623 REF OUT connector. For the PXIe-5830, lock the external signal to the PXIe-3621 REF IN connector. For the PXIe-5831, lock the external signal to the PXIe-3622 REF IN connector. For the PXIe-5832, lock the external signal to the PXIe-3623 REF IN connector.

PXIe-5831 with PXIe-5653—Connect the PXIe-5820 REF IN connector to the PXIe-3622 REF OUT connector. Connect the PXIe-5653 REF OUT (10 MHz) connector to the PXIe-3622 REF IN connector. Lock the external signal to the PXIe-5653 REF IN connector.

PXIe-5832 with PXIe-5653—Connect the PXIe-5820 REF IN connector to the PXIe-3623 REF OUT connector. Connect the PXIe-5653 REF OUT (10 MHz) connector to the PXIe-3623 REF IN connector. Lock the external signal to the PXIe-5653 REF IN connector.

PXIe-5841 with PXIe-5655—Lock to the signal at the REF IN connector on the associated PXIe-5655. Connect the PXIe-5655 REF OUT connector to the PXIe-5841 REF IN connector.
NIRFSG_VAL_PXI_CLK_STR Uses the PXI_CLK signal, which is present on the PXI backplane, as the clock source.
NIRFSG_VAL_CLK_IN_STR Uses the clock signal present at the front panel CLK IN connector as the clock source. This value is not valid for the PXIe-5644/5645/5646 or PXIe-5820/5830/5831/5831 with PXIe-5653/5832/5832 with PXIe-5653/5840/5841/5841 with PXIe-5655.
NIRFSG_VAL_REF_IN_2_STR
NIRFSG_VAL_PXI_CLK_MASTER_STR This value is valid on only the PXIe-5831 with PXIe-5653 and PXIe-5832 with PXIe-5653.

**PXIe-5831 with PXIe-5653—**NI-RFSG configures the PXIe-5653 to export the Reference clock and configures the PXIe-5820 and PXIe-3622 to use PXI_Clk as the Reference Clock source. Connect the PXIe-5653 REF OUT (10 MHz) connector to the PXI chassis REF IN connector.

**PXIe-5832 with PXIe-5653—**NI-RFSG configures the PXIe-5653 to export the Reference clock and configures the PXIe-5820 and PXIe-3623 to use PXI_Clk as the Reference Clock source. Connect the PXIe-5653 REF OUT (10 MHz) connector to the PXI chassis REF IN connector.
Name Type Description
refClockRate ViReal64 Specifies the Reference Clock rate, in hertz (Hz), of the signal present at the REF IN or CLK IN connector. The default value is NIRFSG_VAL_AUTO, which allows NI-RFSG to use the default Reference Clock rate for the device or automatically detect the Reference Clock rate, if supported. This parameter is only valid when the refClockSource parameter is set to NIRFSG_VAL_CLK_IN_STR, NIRFSG_VAL_REF_IN_STR, or NIRFSG_VAL_REF_IN_2_STR. Refer to the [NIRFSG_ATTR_REF_CLOCK_RATE](javascript:LaunchMergedHelp('RFSG.chm', 'CVIrfsg.chm', 'NIRFSG_ATTR_REF_CLOCK_RATE.html')) attribute for possible values.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_ConfigurePXIChassisClk10

C Function Prototype

ViStatus niRFSG_ConfigurePXIChassisClk10 (ViSession vi, ViConstString pxiClk10Source);

Purpose

Specifies the signal to drive the 10 MHz Reference Clock on the PXI backplane. This option can only be configured when the PXI-5610 is in Slot 2 of the PXI chassis. The NI-RFSG device must be in the Configuration state before you call this function.

Supported Devices: PXI-5610, PXI-5670/5671

Related Topics

Timing Configurations

System Reference Clock

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
pxiClk10Source ViConstString Specifies the source of the Reference Clock signal.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_ExportSignal

C Function Prototype

ViStatus niRFSG_ExportSignal (ViSession vi, ViInt32 signal, ViConstString signalIdentifier, ViConstString outputTerminal);

Purpose

Routes signals (triggers, clocks, and events) to a specified output terminal. The NI-RFSG device must be in the Configuration state before you call this function.

You can clear a previously routed signal by exporting the signal to "" (empty string).

Supported Devices:PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841

Related Topics

Triggers

Events

PFI Lines

PXI Trigger Lines

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
signal ViInt32 Specifies the type of signal to route.

Defined Values:
NIRFSG_VAL_START_TRIGGER Exports a Start Trigger.
NIRFSG_VAL_SCRIPT_TRIGGER Exports a Script Trigger.
NIRFSG_VAL_MARKER_EVENT Exports a Marker Event.
NIRFSG_VAL_REF_CLOCK Exports the Reference Clock.
NIRFSG_VAL_STARTED_EVENT Exports a Started Event.
NIRFSG_VAL_DONE_EVENT Exports a Done Event.
NIRFSG_VAL_CONFIGURATION_LIST_STEP_TRIGGER Exports a Configuration List Step Trigger.
NIRFSG_VAL_CONFIGURATION_SETTLED_EVENT Exports a Configuration Settled Event.
Name Type Description
signalIdentifier ViConstString Specifies which instance of the selected signal to export. This parameter is useful when you set the signal parameter to NIRFSG_VAL_SCRIPT_TRIGGER or NIRFSG_VAL_MARKER_EVENT. Otherwise, set the signalIdentifier parameter to "" (empty string).

Defined Values:
NIRFSG_VAL_SCRIPT_TRIGGER0 Specifies Script Trigger 0.
NIRFSG_VAL_SCRIPT_TRIGGER1 Specifies Script Trigger 1.
NIRFSG_VAL_SCRIPT_TRIGGER2 Specifies Script Trigger 2.
NIRFSG_VAL_SCRIPT_TRIGGER3 Specifies Script Trigger 3.
NIRFSG_VAL_MARKER_EVENT0 Specifies Marker 0.
NIRFSG_VAL_MARKER_EVENT1 Specifies Marker 1.
NIRFSG_VAL_MARKER_EVENT2 Specifies Marker 2.
NIRFSG_VAL_MARKER_EVENT3 Specifies Marker 3.
"" (empty string) None (no signal to export)
Name Type Description
outputTerminal ViConstString Specifies the terminal where the signal is exported. You can choose not to export any signal. For the PXIe-5841 with PXIe-5655, the signal is exported to the terminal on the PXIe-5841.

Defined Values:
NIRFSG_VAL_DO_NOT_EXPORT_STR Does not export a signal.
NIRFSG_VAL_REF_OUT_STR Exports a signal to the REF OUT connector.
NIRFSG_VAL_REF_OUT2_STR Exports a signal to the REF OUT2 connector, if applicable.
NIRFSG_VAL_CLK_OUT_STR Exports a signal to the CLK OUT connector.
NIRFSG_VAL_PFI0_STR Exports a signal to the PFI 0 terminal.
NIRFSG_VAL_PFI1_STR Exports a signal to the PFI 1 terminal.
NIRFSG_VAL_PFI4_STR Exports a signal to the PFI 4 terminal.
NIRFSG_VAL_PFI5_STR Exports a signal to the PFI 5 terminal.
NIRFSG_VAL_PXI_TRIG0_STR Exports a signal to the PXI trigger line 0 terminal.
NIRFSG_VAL_PXI_TRIG1_STR Exports a signal to the PXI trigger line 1 terminal.
NIRFSG_VAL_PXI_TRIG2_STR Exports a signal to the PXI trigger line 2 terminal.
NIRFSG_VAL_PXI_TRIG3_STR Exports a signal to the PXI trigger line 3 terminal.
NIRFSG_VAL_PXI_TRIG4_STR Exports a signal to the PXI trigger line 4 terminal.
NIRFSG_VAL_PXI_TRIG5_STR Exports a signal to the PXI trigger line 5 terminal.
NIRFSG_VAL_PXI_TRIG6_STR Exports a signal to the PXI trigger line 6 terminal.
NIRFSG_VAL_PXI_STAR_STR Exports a signal to the PXI star trigger line terminal. This value is not valid for the PXIe-5644/5645/5646.
NIRFSG_VAL_PXIE_DSTARC_STR Exports a signal to the PXIe DStar C trigger line terminal. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841.
NIRFSG_VAL_TRIG_OUT_STR Exports a signal to the TRIG IN/OUT terminal.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

De-embedding

niRFSG_CreateDeembeddingSparameterTableS2PFile

ViStatus niRFSG_CreateDeembeddingSparameterTableS2PFile (ViSession vi, ViConstString port, ViConstString tableName, ViConstString s2pFilePath, ViInt32 sparameterOrientation);

Purpose

Creates an S-parameter de-embedding table for the port based on the specified S2P file.

If you only create one table for a port, NI-RFSG automatically selects that table to de-embed the measurement.

Supported Devices: PXIe-5830/5831/5832/5840/5841

Related Topics

De-embedding Overview

S-parameters

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
port ViConstString Specifies the name of the port. The only valid value for the PXIe-5840/5841 is "" (empty string).
tableName ViConstString Specifies the name of the table. The name must be unique for a given port, but not across ports. If you use the same name as an existing table, the table is replaced.
s2pFilePath ViConstString Specifies the path to the S2P file that contains de-embedding information for the specified port.
sparameterOrientation ViInt32 Specifies the orientation of the data in the S2P file relative to the port on the DUT port.
NIRFSG_VAL_PORT1_TOWARDS_DUT (3800) Port 1 of the S2P is oriented towards the DUT port.
NIRFSG_VAL_PORT2_TOWARDS_DUT (3801) Port 2 of the S2P is oriented towards the DUT port.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_CreateDeembeddingSparameterTableArray

ViStatus niRFSG_CreateDeembeddingSparameterTableArray (ViSession vi, ViConstString port, ViConstString tableName, const ViReal64 frequencies[], ViInt32 frequenciesSize, const NIComplexNumber sparameterTable[], ViInt32 sparameterTableSize, ViInt32 numberOfPorts, ViInt32 sparameterOrientation);

Purpose

Creates an s-parameter de-embedding table for the port from the input data.

If you only create one table for a port, NI-RFSG automatically selects that table to de-embed the measurement.

Supported Devices: PXIe-5830/5831/5832/5840/5841

Related Topics

De-embedding Overview

S-parameters

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
port ViConstString Specifies the name of the port. The only valid value for the PXIe-5840/5841 is "" (empty string).
tableName ViConstString Specifies the name of the table. The name must be unique for a given port, but not across ports. If you use the same name as an existing table, the table is replaced.
frequencies const ViReal64[] Specifies the frequencies for the sparameterTable rows. Frequencies must be unique and in ascending order.
frequenciesSize ViInt32 Specifies the size of the frequency.
sparameterTable const NIComplexNumber[] Specifies the S-parameters for each frequency. S-parameters for each frequency are placed in the array in the following order: s11, s12, s21, s22.
sparameterTableSize ViInt32 Specifies the size of the S-parameter table.
numberOfPorts ViInt32 Specifies the number of DUT ports.
sparameterOrientation ViInt32 Specifies the orientation of the data in the S2P file relative to the port on the DUT port.
NIRFSG_VAL_PORT1_TOWARDS_DUT (3800) Port 1 of the S2P is oriented towards the DUT port.
NIRFSG_VAL_PORT2_TOWARDS_DUT (3801) Port 2 of the S2P is oriented towards the DUT port.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_DeleteDeembeddingTable

ViStatus niRFSG_DeleteDeembeddingTable (ViSession vi, ViConstString port, ViInt32 numberOfListAttributes, ViConstString tableName);

Purpose

Deletes the selected de-embedding table for a given port.

Supported Devices: PXIe-5830/5831/5832/5840/5841

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
port ViConstString Specifies the name of the port. The only valid value for the PXIe-5840/5841 is "" (empty string).
tableName ViConstString Specifies the name of the table.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_DeleteAllDeembeddingTables

ViStatus niRFSG_DeleteAllDeembeddingTables (ViSession vi);

Purpose

Deletes all configured de-embedding tables for the session.

Supported Devices: PXIe-5830/5831/5832/5840/5841

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_ConfigureDeembeddingTableInterpolationNearest

ViStatus niRFSG_ConfigureDeembeddingTableInterpolationNearest (ViSession vi, ViConstString port, ViConstString tableName);

Purpose

Selects the nearest interpolation method. NI-RFSG uses the parameters of the table nearest to the carrier frequency for de-embedding.

Supported Devices: PXIe-5830/5831/5832/5840/5841

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
port ViConstString Specifies the name of the port. The only valid value for the PXIe-5840/5841 is "" (empty string).
tableName ViConstString Specifies the name of the table.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_ConfigureDeembeddingTableInterpolationLinear

ViStatus niRFSG_ConfigureDeembeddingTableInterpolationLinear (ViSession vi, ViConstString port, ViConstString tableName, ViInt32 format);

Purpose

Selects the linear interpolation method. If the carrier frequency does not match a row in the de-embedding table, NI-RFSG performs a linear interpolation based on the entries in the de-embedding table to determine the parameters to use for de-embedding.

Supported Devices: PXIe-5830/5831/5832/5840/5841

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
port ViConstString Specifies the name of the port. The only valid value for the PXIe-5840/5841 is "" (empty string).
tableName ViConstString Specifies the name of the table.
format ViInt32 Specifies the format of parameters to interpolate.
NIRFSG_VAL_LINEAR_INTERPOLATION_FORMAT_REAL_AND_IMAGINARY (4000) Results in a linear interpolation of the real portion of the complex number and a separate linear interpolation of the complex portion.
NIRFSG_VAL_LINEAR_INTERPOLATION_FORMAT_MAGNITUDE_AND_PHASE (4001) Results in a linear interpolation of the magnitude and a separate linear interpolation of the phase.
NIRFSG_VAL_LINEAR_INTERPOLATION_FORMAT_MAGNITUDE_DB_AND_PHASE (4002) Results in a linear interpolation of the magnitude, in decibels, and a separate linear interpolation of the phase.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_ConfigureDeembeddingTableInterpolationSpline

ViStatus niRFSG_ConfigureDeembeddingTableInterpolationSpline (ViSession vi, ViConstString port, ViConstString tableName);

Purpose

Selects the spline interpolation method. If the carrier frequency does not match a row in the de-embedding table, NI-RFSG performs a spline interpolation based on the entries in the de-embedding table to determine the parameters to use for de-embedding.

Supported Devices: PXIe-5830/5831/5832/5840/5841

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
port ViConstString Specifies the name of the port. The only valid value for the PXIe-5840/5841 is "" (empty string).
tableName ViConstString Specifies the name of the table.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_GetDeembeddingSparameters

ViStatus niRFSG_GetDeembeddingSparameters (ViSession vi, NIComplexNumber *sparameters, ViInt32 sparametersArraySize, ViInt32 *numberOfSparametersReturned, ViInt32 *numberOfPorts);

Purpose

Returns the S-parameters used for de-embedding a measurement on the selected port. This includes interpolation of the parameters based on the configured carrier frequency. This function returns an empty array if no de-embedding is completed.

If you want to call this function just to get the required buffer size, you can pass 0 for S-parameter Size and VI_NULL for the S-parameters buffer.

Supported Devices: PXIe-5830/5831/5832/5840/5841

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
sparametersArraySize ViInt32 Specifies the size of the array that is returned by the sparameters output.
Output
Name Type Description
sparameters NIComplexNumber* Returns an array of S-parameters. The S-parameters are returned in the following order: s11, s12, s21, s22.
numberOfSparametersReturned ViInt32* Returns the number of S-parameters.
numberOfPorts ViInt32* Returns the number of S-parameter ports. The sparameter array is always n x n, where span n is the number of ports.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

Peer To Peer (P2P)

niRFSG_GetStreamEndpointHandle

C Function Prototype

ViStatus niRFSG_GetStreamEndpointHandle (ViSession vi, ViConstString streamEndpoint, ViUInt32* readerHandle);

Purpose

Returns a reader endpoint handle that can be used with NI-P2P to configure a peer-to-peer stream with an RF signal generator endpoint.

Supported Devices: PXIe-5673E, PXIe-5820/5830/5831/5832/5840/5841

Related Topics

Configuring a Peer-to-Peer Endpoint

Configuring Flow Control

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
streamEndpoint ViConstString Specifies the stream endpoint FIFO to configure.
Output
Name Type Description
readerHandle ViUInt32* Returns the reader endpoint handle that is used with NI-P2P to create a stream with the NI-RFSG device as an endpoint.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_WriteP2PEndpointI16

C Function Prototype

ViStatus niRFSG_WriteP2PEndpointI16 (ViSession vi, ViConstString streamEndpoint, ViInt32 numberOfSamples, ViInt16 endpointData[])

Purpose

Writes an array of 16-bit integer data to the peer-to-peer endpoint. Use this function to write initial data from the host to the endpoint before starting generation to avoid an underflow when you start the generation.

Supported Devices: PXIe-5673E

Related Topics

Peer-to-Peer Data Streaming—Refer to this topic for more information about configuring a stream.

Configuring Flow Control

Starting Peer-to-Peer Generation

Reconfiguring a Stream

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
streamEndpoint ViConstString Specifies the stream endpoint FIFO to configure.
numberOfSamples ViInt32 Specifies the number of samples to write into the endpoint FIFO.
endpointData ViInt16 [] Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

Scripting

niRFSG_CheckIfScriptExists

C Function Prototype

ViStatus niRFSG_CheckIfScriptExists (ViSession vi, ViConstString scriptName, ViBoolean* scriptExists);

Purpose

Returns whether the script that you specify as scriptName exists.

Supported Devices: PXIe-5673/5673E

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
scriptName ViConstString Specifies the name of the script. This string is case-insensitive.
Output
Name Type Description
scriptExists ViBoolean* Returns VI_TRUE if the script exists.

Defined Values:
VI_TRUE The script exists.
VI_FALSE The script does not exist.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niRFSG_WriteScript

C Function Prototype

ViStatus niRFSG_WriteScript (ViSession vi, ViConstString script);

Purpose

Writes a script to the device to control waveform generation in Script mode. First, configure your device for Script mode by calling the niRFSG_ConfigureGenerationMode function. The NI-RFSG device must be in the Configuration state before calling the niRFSG_WriteScript function.

Note Note  If you are using an RF vector signal transceiver (VST) device, some script instructions may not be supported.
Supported Devices: PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841

Related Topics

Scripting Instructions—Refer to this topic for more information about VST restrictions on scripts.

Common Scripting Use Cases

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.
script ViConstString Specifies a string containing a syntactically correct script. NI-RFSG supports multiple scripts that are selected with the NIRFSG_ATTR_SELECTED_SCRIPT for more information about using scripts.

Return Value

Name Type Description
status ViStatus

Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the error code, call the niRFSG_GetError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors
⚠️ **GitHub.com Fallback** ⚠️