Skip to content

NI FGEN Attribute Functions

Palash Khare edited this page Jun 4, 2021 · 3 revisions

Attribute Functions

niFgen_SetAttributeViInt32

ViStatus niFgen_SetAttributeViInt32 (ViSession vi, ViConstString channelName, ViAttr attributeID, ViInt32 attributeValue);

Purpose

Sets the value of a ViInt32 attribute.

This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid or is different than the value you specify.

NI-FGEN contains high-level functions that set most of the instrument attributes. NI recommends that you use the high-level driver functions as much as possible. They handle order dependencies and multithread locking for you. In addition, they perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute functions, the functions check the instrument status after each call.

Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or "" (empty string).

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViInt32 Specifies the value to which you want to set the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_SetAttributeViInt64

ViStatus niFgen_SetAttributeViInt64 (ViSession vi, ViConstString channelName, ViAttr attributeID, ViInt32 attributeValue);

Purpose

Sets the value of a ViInt64 attribute.

This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid or is different than the value you specify.

NI-FGEN contains high-level functions that set most of the instrument attributes. NI recommends that you use the high-level driver functions as much as possible. They handle order dependencies and multithread locking for you. In addition, they perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute functions, the functions check the instrument status after each call.

Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or "" (empty string).

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViInt64 Specifies the value to which you want to set the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_SetAttributeViReal64

ViStatus niFgen_SetAttributeViReal64 (ViSession vi, ViConstString channelName, ViAttr attributeID, ViReal64 attributeValue);

Purpose

Sets the value of a ViReal64 attribute.

This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid or is different than the value you specify.

NI-FGEN contains high-level functions that set most of the instrument attributes. NI recommends that you use the high-level driver functions as much as possible. They handle order dependencies and multithread locking for you. In addition, they perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute functions, the functions check the instrument status after each call.

Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or "" (empty string).

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViReal64 Specifies the value to which you want to set the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_SetAttributeViString

ViStatus niFgen_SetAttributeViString (ViSession vi, ViConstString channelName, ViAttr attributeID, ViConstString attributeValue);

Purpose

Sets the value of a ViString attribute.

This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid or is different than the value you specify.

NI-FGEN contains high-level functions that set most of the instrument attributes. NI recommends that you use the high-level driver functions as much as possible. They handle order dependencies and multithread locking for you. In addition, they perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute functions, the functions check the instrument status after each call.

Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or "" (empty string).

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViString Specifies the value to which you want to set the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_SetAttributeViBoolean

ViStatus niFgen_SetAttributeViBoolean (ViSession vi, ViConstString channelName, ViAttr attributeID, ViBoolean attributeValue);

Purpose

Sets the value of a ViBoolean attribute.

This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid or is different than the value you specify.

NI-FGEN contains high-level functions that set most of the instrument attributes. NI recommends that you use the high-level driver functions as much as possible. They handle order dependencies and multithread locking for you. In addition, they perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute functions, the functions check the instrument status after each call.

Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or "" (empty string).

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViBoolean Specifies the value to which you want to set the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_SetAttributeViSession

ViStatus niFgen_SetAttributeViSession (ViSession vi, ViConstString channelName, ViAttr attributeID, ViSession attributeValue);

Purpose

Sets the value of a ViSession attribute.

This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid or is different than the value you specify.

NI-FGEN contains high-level functions that set most of the instrument attributes. It is best to use the high-level driver functions as much as possible. They handle order dependencies and multithread locking for you. In addition, they perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute functions, the functions check the instrument status after each call.

Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViSession Specifies the value to which you want to set the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_GetAttributeViInt32

ViStatus niFgen_GetAttributeViInt32 (ViSession vi, ViConstString channelName, ViAttr attributeID, ViInt32* attributeValue);

Purpose

Queries the value of a ViInt32 attribute. You can use this function to get the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
Output
Name Type Description
attributeValue ViInt32* Returns the current value of the attribute. Pass the address of a ViInt32 variable.

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_GetAttributeViInt64

ViStatus niFgen_GetAttributeViInt64 (ViSession vi, ViConstString channelName, ViAttr attributeID, ViInt64* attributeValue);

Purpose

Queries the value of a ViInt64 attribute. You can use this function to get the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
Output
Name Type Description
attributeValue ViInt64* Returns the current value of the attribute. Pass the address of a ViInt64 variable.

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_GetAttributeViReal64

ViStatus niFgen_GetAttributeViReal64 (ViSession vi, ViConstString channelName, ViAttr attributeID, ViReal64* attributeValue);

Purpose

Queries the value of a ViReal64 attribute.

You can use this function to get the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
Output
Name Type Description
attributeValue ViReal64* Returns the current value of the attribute. Pass the address of a ViReal64 variable.

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_GetAttributeViString

ViStatus niFgen_GetAttributeViString (ViSession vi, ViConstString channelName, ViAttr attributeID, ViInt32 arraySize, ViChar[] attributeValue);

Purpose

Queries the value of a ViString attribute.

You can use this function to get the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid.

You must provide a ViChar array to serve as a buffer for the value. You pass the number of bytes in the buffer as the arraySize parameter. If the current value of the attribute, including the terminating NUL byte, is larger than the size you indicate in the arraySize parameter, the function copies arraySize – 1 bytes into the buffer, places an ASCII NUL byte at the end of the buffer, and returns the array size you must pass to get the entire value. For example, if the value is 123456 and arraySize is 4, the function places 123 into the buffer and returns 7.

If you want to call this function just to get the required array size, you can pass 0 for arraySize and VI_NULL for the attributeValue buffer.

If you want the function to fill in the buffer regardless of the number of bytes in the value, pass a negative number for the arraySize parameter.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
arraySize ViInt32

Specifies the number of bytes in the ViChar array you specify for the attributeValue parameter.

If the current value of the attribute, including the terminating NUL byte, contains more bytes than you indicate in this parameter, the function copies arraySize – 1 bytes into the buffer, places an ASCII NUL byte at the end of the buffer, and returns the array size you must pass to get the entire value. For example, if the value is 123456 and arraySize is 4, the function places 123 into the buffer and returns 7.

If you pass a negative number, the function copies the value to the buffer regardless of the number of bytes in the value.

If you pass 0, you can pass VI_NULL for the attributeValue buffer parameter.

Output
Name Type Description
attributeValue ViChar[]

The buffer in which the function returns the current value of the attribute. The buffer must be a ViChar data type and have at least as many bytes as indicated in the arraySize parameter.

If the current value of the attribute, including the terminating NUL byte, contains more bytes than you indicate in this parameter, the function copies arraySize – 1 bytes into the buffer, places an ASCII NUL byte at the end of the buffer, and returns the array size you must pass to get the entire value. For example, if the value is 123456 and arraySize is 4, the function places 123 into the buffer and returns 7.

If you specify 0 for the arraySize parameter, you can pass VI_NULL for this parameter.

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call niFgen_error_message. To obtain additional information about the error condition, call niFgen_GetError. To clear the error information from NI-FGEN, call niFgen_ClearError.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_GetAttributeViBoolean

ViStatus niFgen_GetAttributeViBoolean (ViSession vi, ViConstString channelName, ViAttr attributeID, ViBoolean* attributeValue);

Purpose

Queries the value of a ViBoolean attribute.

You can use this function to get the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
Output
Name Type Description
attributeValue ViBoolean* Returns the current value of the attribute. Pass the address of a ViBoolean variable.

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_GetAttributeViSession

ViStatus niFgen_GetAttributeViSession (ViSession vi, ViConstString channelName, ViAttr attributeID, ViSession* attributeValue);

Purpose

Queries the value of a ViSession attribute.

You can use this function to get the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:

  • State caching is disabled for the entire session or for the particular attribute.
  • State caching is enabled and the currently cached value is invalid.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
Output
Name Type Description
attributeValue ViSession* Returns the current value of the attribute. Pass the address of a ViSession variable.

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_CheckAttributeViInt32

ViStatus niFgen_CheckAttributeViInt32 (ViSession vi, ViConstString channelName, ViAttr attributeID, ViInt32 attributeValue);

Purpose

Checks the validity of a value you specify for a ViInt32 attribute.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViInt32 Specifies the value to which you want to set the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_CheckAttributeViInt64

ViStatus niFgen_CheckAttributeViInt64 (ViSession vi, ViConstString channelName, ViAttr attributeID, ViInt64 attributeValue);

Purpose

Checks the validity of a value you specify for a ViInt64 attribute.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViInt64 Specifies the value to which you want to set the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_CheckAttributeViReal64

ViStatus niFgen_CheckAttributeViReal64 (ViSession vi, ViConstString channelName, ViAttr attributeID, ViReal64 attributeValue);

Purpose

Checks the validity of a value you specify for a ViReal64 attribute.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViReal64 Specifies the value to which you want to set the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_CheckAttributeViString

ViStatus niFgen_CheckAttributeViString (ViSession vi, ViConstString channelName, ViAttr attributeID, ViConstString attributeValue);

Purpose

Checks the validity of a value you specify for a ViString attribute.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViConstString Specifies the value which you want to verify as a valid value for the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_CheckAttributeViBoolean

ViStatus niFgen_CheckAttributeViBoolean (ViSession vi, ViConstString channelName, ViAttr attributeID, ViBoolean attributeValue);

Purpose

Checks the validity of a value you specify for a ViBoolean attribute.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViBoolean Specifies the value to which you want to set the attribute.

<

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_CheckAttributeViSession

ViStatus niFgen_CheckAttributeViSession (ViSession vi, ViConstString channelName, ViAttr attributeID, ViSession attributeValue);

Purpose

Checks the validity of a value you specify for a ViSession attribute.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.
attributeValue ViSession Specifies the value to which you want to set the attribute.

Note:   Some of the values might not be valid depending on the current settings of the instrument session.

Default Value: None

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_ResetAttribute

ViStatus niFgen_ResetAttribute (ViSession vi, ViConstString channelName, ViAttr attributeID);

Purpose

Resets the attribute to its default value.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the name of the channel on which to check the attribute value if the attribute is channel-based. If the attribute is not channel-based, then pass VI_NULL or an empty string ("").

Default Value: "" (empty string)

attributeID ViAttr Specifies the ID of an attribute.

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_ImportAttributeConfigurationFile

ViStatus niFgen_ImportAttributeConfigurationFile (ViSession Instrument_Handle, ViConstString File_Path);

Purpose

Imports a configuration to the session from the specified file.

You can export and import supported configurations only between NIFGEN devices with identical bus types, model numbers, and channel counts, as well as the same number of initialized channels.

Note:  You cannot call this function while the session is in the Running/Generating state.

Supported Configurations

You can export and import the following between NI-FGEN sessions:

  • Attribute configurations
  • Arbitrary waveforms

Requirements for Exporting and Importing Arbitrary Waveforms

Arbitrary waveforms you export and import between sessions using this function must meet the following criteria:

  • All waveforms in the exporting session are created from files, other than HWS files, using the niFgen_CreateWaveformFromFileI16 or niFgen_CreateWaveformFromFileF64 functions
  • The full file path of the file containing the arbitrary waveform still exists upon import
  • All waveforms are defined using handles rather than names
  • All waveforms are complete—none are streamed or incrementally written

You can set the device mode with the niFgen_ConfigureOutputMode function. For more information on arbitrary waveform mode, refer to Arbitrary Waveform Output Mode and Configure Arbitrary Waveform Mode.

Channel Mapping Behavior

When exporting and importing configurations between NIFGEN sessions that were initialized with different channels using the niFgen_InitializeWithChannels function, the configuration of the exporting channel is mapped to the importing channel.

For example, if your entry for channelName is 0 for the exporting session and 1 for the importing session, the configuration exported from channel 0 is imported into channel 1.

Note:  This function will return an error if the total number of channels initialized for the exporting session is not equal to the total number of channels initialized for the importing session.

Parameters

Input
Name Type Description
Instrument_Handle ViSession Identifies your instrument session. Instrument_Handle is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
File_Path ViConstString The absolute path to the file that contains the configuration to import. If you specify an empty or relative path, this function returns an error.

Default File Extension: .nifgenconfig

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_ExportAttributeConfigurationFile

ViStatus niFgen_ExportAttributeConfigurationBuffer (ViSession Instrument_Handle, ViInt32 Size, ViAddr Configuration);

Purpose

Exports a session configuration to a buffer.

You can export and import supported configurations only betwen NIFGEN devices with identical bus types, model numbers, and channel counts, as well as the same number of initialized channels.

Note  You cannot call this function while the session is in the Running/Generating state.

Supported Configurations

You can export and import the following between NIFGEN sessions:

  • Attribute configurations
  • Arbitrary waveforms

Requirements for Exporting and Importing Arbitrary Waveforms

Arbitrary waveforms you export and import between sessions using this function must meet the following criteria:

  • All waveforms in the exporting session are created from files, other than HWS files, using the niFgen_CreateWaveformFromFileI16 or niFgen_CreateWaveformFromFileF64 functions
  • The full file path of the file containing the arbitrary waveform still exists upon import
  • All waveforms are defined using handles rather than names
  • All waveforms are complete—none are streamed or incrementally written You can set the device mode with the niFgen_ConfigureOutputModefunction. For more information on arbitrary waveform mode, refer to Arbitrary Waveform Output Mode and Configure Arbitrary Waveform Mode.

Channel Mapping Behavior

When exporting and importing configurations between NI-FGEN sessions that were initialized with different channels using the niFgen_InitializeWithChannels function, the configuration of the exporting channel is mapped to the importing channel.

For example, if your entry for channelName is 0 for the exporting session and 1 for the importing session, the configuration exported from channel 0 is imported into channel 1.

Note:  This function will return an error if the total number of channels initialized for the exporting session is not equal to the total number of channels initialized for the importing session.

Parameters

Input
Name Type Description
Instrument_Handle ViSession Identifies your instrument session. Instrument_Handle is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
size ViInt32

Specifies the number of samples to load into the waveform.

Default Value: 0

Configuration ViAddr Specifies the byte array buffer to be populated with the exported configuration.

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_ImportAttributeConfigurationBuffer

ViStatus niFgen_ImportAttributeConfigurationBuffer (ViSession Instrument_Handle, ViInt32 Size, ViAddr Configuration);

Purpose

Imports a configuration to the session from the specified buffer.

You can export and import supported configurations only betwen NI-FGEN devices with identical bus types, model numbers, and channel counts, as well as the same number of initialized channels.

Note  You cannot call this function while the session is in the Running/Generating state.

Supported Configurations

You can export and import the following between NIFGEN sessions:

  • Attribute configurations
  • Arbitrary waveforms

Requirements for Exporting and Importing Arbitrary Waveforms

Arbitrary waveforms you export and import between sessions using this function must meet the following criteria:

  • All waveforms in the exporting session are created from files, other than HWS files, using the niFgen_CreateWaveformFromFileI16 or niFgen_CreateWaveformFromFileF64 functions
  • The full file path of the file containing the arbitrary waveform still exists upon import
  • All waveforms are defined using handles rather than names
  • All waveforms are complete—none are streamed or incrementally written

You can set the device mode with the niFgen_ConfigureOutputMode function. For more information on arbitrary waveform mode, refer to Arbitrary Waveform Output Mode) and Configure Arbitrary Waveform Mode.

Channel Mapping Behavior

When exporting and importing configurations between NIFGEN sessions that were initialized with different channels using the niFgen_InitializeWithChannels function, the configuration of the exporting channel is mapped to the importing channel.

For example, if your entry for channelName is 0 for the exporting session and 1 for the importing session, the configuration exported from channel 0 is imported into channel 1.

Note:  This function will return an error if the total number of channels initialized for the exporting session is not equal to the total number of channels initialized for the importing session.

Parameters

Input
Name Type Description
Instrument_Handle ViSession Identifies your instrument session. Instrument_Handle is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
size ViInt32

Specifies the number of samples to load into the waveform.

Default Value: 0

Configuration ViAddr Specifies the byte array buffer that contains the configuration to import.

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

niFgen_ExportAttributeConfigurationBuffer

ViStatus niFgen_ExportAttributeConfigurationBuffer (ViSession Instrument_Handle, ViInt32 Size, ViAddr Configuration);

Purpose

Exports a session configuration to a buffer.

You can export and import supported configurations only betwen NI-FGEN devices with identical bus types, model numbers, and channel counts, as well as the same number of initialized channels.

Note  You cannot call this function while the session is in the Running/Generating state.

Supported Configurations

You can export and import the following between NIFGEN sessions:

  • Attribute configurations
  • Arbitrary waveforms

Requirements for Exporting and Importing Arbitrary Waveforms

Arbitrary waveforms you export and import between sessions using this function must meet the following criteria:

  • All waveforms in the exporting session are created from files, other than HWS files, using the niFgen_CreateWaveformFromFileI16 or niFgen_CreateWaveformFromFileF64 functions
  • The full file path of the file containing the arbitrary waveform still exists upon import
  • All waveforms are defined using handles rather than names
  • All waveforms are complete—none are streamed or incrementally written

You can set the device mode with the niFgen_ConfigureOutputMode function. For more information on arbitrary waveform mode, refer to Arbitrary Waveform Output Mode) and Configure Arbitrary Waveform Mode.

Channel Mapping Behavior

When exporting and importing configurations between NIFGEN sessions that were initialized with different channels using the niFgen_InitializeWithChannels function, the configuration of the exporting channel is mapped to the importing channel.

For example, if your entry for channelName is 0 for the exporting session and 1 for the importing session, the configuration exported from channel 0 is imported into channel 1.

Note:  This function will return an error if the total number of channels initialized for the exporting session is not equal to the total number of channels initialized for the importing session.

Parameters

Input
Name Type Description
Instrument_Handle ViSession Identifies your instrument session. Instrument_Handle is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
size ViInt32

Specifies the number of samples to load into the waveform.

Default Value: 0

Configuration ViAddr Specifies the byte array buffer that contains the configuration to import.

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. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

Table of Contents

Internal Development

Creating and Setting Up a gRPC Server

Server Security Support

Creating a gRPC Client

gRPC Client Examples

Session Utilities API Reference

Driver Documentation

gRPC API Differences From C API

Sharing Driver Sessions Between Clients

C API Docs
NI-DAQmx
NI-DCPOWER
NI-DIGITAL PATTERN DRIVER
NI-DMM
NI-FGEN
NI-FPGA
NI-RFmx Bluetooth
NI-RFmx NR
NI-RFmx WCDMA
NI-RFmx GSM
NI-RFmx CDMA2k
NI-RFmx Instr
NI-RFmx LTE
NI-RFmx SpecAn
NI-RFmx TD-SCDMA
NI-RFmx WLAN
NI-RFSA
NI-RFSG
NI-SCOPE
NI-SWITCH
NI-TCLK
NI-XNET
Clone this wiki locally