The Semiconductor Device Control Add-On supports programming with LabVIEW, .NET, and Python. Each language provides a set of scripts you can use to interact with the devices, registers, and fields defined in a hardware configuration exported from InstrumentStudio.

Instantiate and Destroy Session API

The Semiconductor Device Control Add-On provides APIs to instantiate and destroy device control sessions that you must use at the beginning and end of your device control program. The name of these API calls differs between .NET and the other programming languages, but the functionality is consistent across all languages.

Table 7. .NET API
API Call Description Inputs
Instantiate Semi Device Control Main Create Semi Device Control Session Creates and returns a device control session using the InstrumentStudio export configuration, which contains the register map and hardware configuration from the Semiconductor Device Control Add-On.
  • Path to InstrumentStudio export configuration
Destroy Semi Device Control Session Destroys the device session and deallocates the reserved reference and data in memory.
Attach Semi Device Control Session Attaches to an existing instantiated device control session and returns the session.
Table 8. LabVIEW and Python API
API Call Description Inputs
Instantiate Creates and returns a device control session using the InstrumentStudio export configuration, which contains the register map and hardware configuration from the Semiconductor Device Control Add-On.
  • Path to InstrumentStudio export configuration
Destroy Destroys the device session and deallocates the reserved reference and data in memory.
Attach Session Attaches to an existing instantiated device control session and returns the session.

Python API

Table 9. Microsoft IntelliSense in Python Support API
API Call Description Inputs
Generate Device Elements Generates a class file that contains registers and fields from the register map and stores the class file in the specified directory. If the directory input is empty, the class file will be stored in the working directory.
  • Directory path (string)
Note Refer to nisdc for more information about the SDC Python package.

Shared API

The following tables define the API calls that are available in all programming languages for the Semiconductor Device Control Add-On.

Table 10. General API
API Call Description Inputs
Start Starts the device control session through the InstrumentStudio export configuration.
Stop Stops the device control session.
Write from Cache to Device Writes all cache register data to the device in the order it was stored in the cache memory. The cache clears automatically after this operation is complete.
Clear Cache Clears all cached register data from the device control session.
Get Register Address Returns the list of unique IDs and addresses of all registers defined in the register map.
Get Field Definition Details Returns the display value, numeric value, and the size of the field. The field unique ID is a string in the following format: IP Block/Device Name-Register Group-Field Name.
  • Field unique ID
Table 11. Device Read and Write API
API Call Description Inputs
Write Register by Name (Device) Writes the data to the device using the register unique name. The register unique name is a string in the following format: Device Name-Register Group-Register Name.
  • Register unique name
  • Data
Read Register by Name (Device) Reads the data from the device using the register unique name. The register unique name is a string in the following format: Device Name-Register Group-Register Name.
  • Register unique name
Write Register by Address (Device) Writes the data to the device using the register address and device name from the register map.
  • Register address
  • Device name
  • Data
Read Register by Address (Device) Reads the data from the device using the register address and device name from the register map.
  • Register address
  • Device name
Write Field by Name (Device) Writes the data to the device using the field unique name. The field unique name is a string in the following format: Device Name-Register Group-Field Name.
  • Field unique name
Read Field by Name (Device) Reads the data from the device using the field unique name. The field unique name is a string in the following format: Device Name-Register Group-Field Name.
  • Field unique name
Write Multiple Register by Name (Device) Writes data to multiple registers on the device using the register unique name. The register unique name is a string in the following format: Device Name-Register Group-Register Name.
  • Register unique name array
  • Data array
Read Multiple Register by Name (Device) Reads data from multiple registers on the device using the register unique name. The register unique name is a string in the following format: Device Name-Register Group-Register Name.
  • Register unique name array
Write Multiple Register by Address (Device) Writes data to multiple registers on the device using the register address and device name from the register map.
  • Register address array
  • Device name array
  • Data array
Read Multiple Register by Address (Device) Reads data from multiple registers on the device using the register address and device name from the register map.
  • Register address array
  • Device name array
Write Multiple Field by Name (Device) Writes data to multiple fields on the device using the field unique name. The field unique name is a string in the following format: Device Name-Register Group-Field Name.
  • Field unique name array
Read Multiple Field by Name (Device) Reads data from multiple fields on the device using the field unique name. The field unique name is a string in the following format: Device Name-Register Group-Field Name.
  • Field unique name array
Write Field by Value Definition (Device) Writes the data to the device using the field unique name and field value definition. The field unique name is a string in the following format: Device Name-Register Group-Field Name.

The register map file contains the field value definition, which is also a string.

  • Field unique name
  • Field value definition
Read Custom Register by Address (Device) Reads the data using the register address and register size from the device using the interface and protocol configuration you provide.
  • Register address
  • Address size
  • Register size
  • Interface name
  • Protocol name
Write Custom Register by Address (Device) Writes the data using the register address and register size to the device using the interface and protocol configuration you provide.
  • Register address
  • Address size
  • Value
  • Register size
  • Interface name
  • Protocol name
Table 12. Cache Read and Write API
API Call Description Inputs
Write Register by Name (Cache) Writes the data to the cache using the register unique name. The register unique name is a string in the following format: Device Name-Register Group-Register Name.
  • Register unique name
  • Data
Read Register by Name (Cache) Reads the data from the cache using the register unique name, which is a string in the following format: Device Name-Register Group-Register Name.
  • Register unique name
Write Register by Address (Cache) Writes the data to the cache using the register address and device name from the register map.
  • Register address
  • Device name
  • Data
Read Register by Address (Cache) Reads the data from the cache using the register address and device name from the register map.
  • Register address
  • Device name
Write Field by Name (Cache) Writes the data to the cache using the field unique name, which is a string in the following format: Device Name-Register Group-Field Name.
  • Field unique name
  • Data
Read Field by Name (Cache) Reads the data from the cache using the field unique name, which is a string in the following format: Device Name-Register Group-Field Name.
  • Field unique name
Write Multiple Register by Name (Cache) Writes data to multiple registers on the cache using the register unique name, which is a string in the following format: Device Name-Register Group-Register Name.
  • Register unique name array
  • Data array
Read Multiple Register by Name (Cache) Reads data from multiple registers on the cache using the register unique name, which is a string in the following format: Device Name-Register Group-Register Name.
  • Register unique name array
Write Multiple Register by Address (Cache) Writes data to multiple registers on the cache using the register address and device name from the register map.
  • Register address array
  • Device name array
  • Data array
Read Multiple Register by Address (Cache) Reads data from multiple registers on the cache using the register address and device name from the register map.
  • Register address array
  • Device name array
Write Multiple Field by Name (Cache) Writes data to multiple fields on the cache using the field unique name, which is a string in the following format: Device Name-Register Group-Field Name.
  • Field unique name array
  • Data array
Read Multiple Field by Name (Cache) Reads data from multiple fields on the cache using the field unique name, which is a string in the following format: Device Name-Register Group-Field Name.
  • Field unique name array
Write Field by Value Definition (Cache) Writes the data to the device using the field unique name and field value definition. The field unique name is a string in the following format: Device Name-Register Group-Field Name.

The register map file contains the field value definition, which is also a string.

  • Field unique name
  • Field value definition
Table 13. DIO API
API Call Description Inputs
Write Pin State Sets the pin to the specified state using the pin name from the register map.
  • Pin name
  • Pin state (High, Low, or Terminate)
Read Pin State Reads the state of the pin using the pin name from the register map.
  • Pin name
Table 14. Execute and Abort API
API Call Description Inputs
Execute Script Executes the script using the Script Name provided as an input. If a script is already running on the session, this script will throw an error. This script can be configured to run as a blocking call or asynchronously using the waitUntilScriptCompletion control.

After execution, a list of strings in JavaScript Object Notation (JSON) format is returned. Each string in the list contains the results of one executed command in the script.

  • Script name
  • Wait until script completion
Abort Script Aborts the currently running script in the session.
Execute Script Command Executes the script using the Script String provided as an input. If a script is already running on the session, this script will throw an error. This script can be configured to run as a blocking call or asynchronously using the waitUntilScriptCompletion control.

After execution, a list of strings in JavaScript Object Notation (JSON) format is returned. Each string in the list contains the results of one executed command in the script.

  • Script string
  • Wait until script completion
Note If you are using the digital pattern session to create measurement services with Measurement Plug-Ins, asynchronous script execution is not supported. An error returns when you try to run scripts asynchronously.
Table 15. NIDigital API
API Call Description Inputs
Get Session ID (deprecated) Returns the interface session information containing the resource name and session ID.
  • Interface name
Get Interface Dynamic Setting Returns the values of dynamic settings for an interface.
  • Interface name
  • Setting name
Set Interface Dynamic Setting Configures the dynamic settings for an interface.
  • Interface name
  • Setting name
  • Setting value
Set Protocol Dynamic Setting Configures the dynamic settings for a protocol in the specified interface.
  • Protocol name
  • Interface name
  • Setting name
  • Setting value
Get Protocol Dynamic Setting Returns the values of dynamic settings for a protocol in the specified interface.
  • Protocol name
  • Interface name
  • Setting name
Get Interface Details Returns a list of interface names and the type of each interface for the configured device control session.
Get gRPC Session Options Returns the following gRPC session options:
  • gRPC port number in which the gRPC device server is running
  • gRPC address
  • Session name
  • Resource name
Interface name
Note Semiconductor Device Control Add-On 2023 Q4 and later enable you to share digital pattern driver sessions between Semiconductor Device Control Add-On and Measurement Plug-Ins through the Measurement Plug-Ins session management service. Refer to the Understanding the Driver Session Management Service section for information about using the session management service to share driver sessions. Because the session management service is used to share NI digital sessions, the Get Session ID API is deprecated.
Note If you do not have Measurement Plug-Ins, you can communicate with NI digital instruments through the gRPC Device Server API. You need to call the Get gRPC Session Options API to obtain the gRPC session options from the Semiconductor Device Control Add-On for InstrumentStudio. Then, call the gRPC Device Server API to access the existing digital session that Semiconductor Device Control Add-On for InstrumentStudio initializes and stores in the gRPC Device Server. If you are programming with LabVIEW, refer to the Session Sharing with Semi Device Control.vi that Semiconductor Device Control Add-On 2024 Q2 or later for InstrumentStudio provides to understand how to access an existing digital session in the gRPC Device Server.
Table 16. I3C® Session API
API Call Description Inputs
Instantiate Creates and returns a semiconductor device control (SDC) I3C Session based on an existing SDC session. This session can be used to perform operations on an I3C device by using the Semiconductor Device Control Add-On.
  • Device control session
  • Interface name
  • Protocol name
Execute Dynamic Addressing CCC Executes the common command code (CCC) commands to assign dynamic address.

If the command ID does not require dynamic address, the dynamic address input will be ignored.

If the command ID does not match the CCC type and operation, an exception will be thrown.

  • CCC type
  • Command ID
  • Dynamic address
Execute Dynamic Addressing CCC with Read Executes the CCC commands to assign dynamic address. This API is applicable only for the enter dynamic address assignment (ENTDAA) CCC in the current I3C specification.

If the command ID does not require dynamic address, the dynamic address input will be ignored.

If the command ID does not match the CCC type and operation, an exception will be thrown.

  • CCC type
  • Command ID
  • Dynamic address
Execute SDR CCC Read

Executes the read CCC commands used in single data rate (SDR) mode and returns the read data.

Configure the read byte length if you intend to run the following commands. Otherwise, an error will be thrown.
  • get max read length (GETMRL)
  • get device status (GETSTATUS)
  • get max data speed (GETMXDS)
  • get caps (GETCAPS)

If the defining byte and read byte length conflict with the command ID, the command will not be executed.

If the command ID does not match the CCC type and operation, an exception will be thrown.

  • CCC type
  • Command ID
  • Read byte length
  • Defining byte
Execute SDR CCC Write

Executes the write CCC commands used in SDR mode.

If the defining byte and write data conflict with the command ID, the command will not be executed.

If the command ID does not match the CCC type and operation, an exception will be thrown.

  • CCC type
  • Command ID
  • Defining byte
  • Write data
Destroy

Destroys the I3C session and deallocates the reserved resource.

Note The NI657x I2C Low-Level API are available for LabVIEW and .NET only.
Table 17. NI657x I2C Low-Level API
API Call Description Inputs
Instantiate (deprecated) Creates and returns a low-level I2C session.
  • Instrument handle
  • Pattern project file path
Instantiate Creates and returns a low-level I2C session.
  • Resource name
  • gRPC session name
  • gRPC device server address
  • gRPC device server port
  • Pattern project file path
Set Pattern Parameters

Sets the pattern parameters to configure source and capture waveforms, and burst the pattern.

  • Data pin name
  • Bus
  • Pin group name
  • Source waveform name
  • Capture waveform name
  • Burst timeout in seconds (ms)
Unload and Load Pattern

Unloads all patterns and loads patterns according to the specified Pattern Name.

  • Start label
  • Pattern name
Set Clock Frequency Sets the clock frequency in the pattern project specification file for the I2C operation. The specification file must contain a specification named I2C.Clk_Freq.
  • Clock frequency (kHz)
Enable High-Speed Mode Enables I2C high-speed mode. The High Speed Code will transmit in burst mode according to the High Speed Clock Frequency to ensure the I2C device is in high-speed mode during the next I2C operation.
  • High speed clock frequency (kHz)
  • High speed code
Disable High-Speed Mode Disables I2C high-speed mode.
Write Register with 7-Bit Slave Address Writes data to single or multiple registers. This API supports only 7-bit I2C slave address.

The Register Address and Register Data are two-dimensional arrays of bytes.

  • Slave address
  • Register address
  • Register data
Read Register with 7-Bit Slave Address Reads data from single or multiple registers. This API supports only 7-bit I2C slave address.

The Read Byte Size is a one-dimensional array of integers and specifies the length of the data to read in bytes.

  • Slave address
  • Register address
  • Read byte size
Write Register with 10-Bit Slave Address Writes data to single or multiple registers. This API supports only 10-bit I2C slave address.
  • Slave address
  • Register address
  • Register data
Read Register with 10-Bit Slave Address Reads data from single or multiple registers. This API supports only 10-bit slave address.

The Read Byte Size is a one-dimensional array of integers and specifies the length of the data to read in bytes.

  • Slave address
  • Register address
  • Read byte size
Destroy Destroys the low-level I2C session and deallocates the reserved resources.
Note The NI657x SPI Low-Level API are available for LabVIEW and .NET only.
Table 18. NI657x SPI Low-Level API
API Call Description Inputs
Instantiate (deprecated) Creates and returns a low-level SPI session.
  • Instrument handle
  • Pattern project file path
Instantiate Creates and returns a low-level SPI session.
  • Resource name
  • gRPC session name
  • gRPC device server address
  • gRPC device server port
  • Pattern project file path
Set Pattern Parameters

Sets the pattern parameters to configure source and capture waveforms, and burst the pattern.

  • Data pin name
  • Bus
  • Pin group name
  • Source waveform name
  • Capture waveform name
  • Burst timeout in seconds (ms)
Unload and Load Pattern

Unloads all patterns and loads patterns according to the specified Pattern Name.

  • Start label
  • Pattern name
Set Clock Frequency Sets the clock frequency in the pattern project specification file for the SPI operation. The specification file must contain a specification named SPI.Clk_Freq.
  • Clock frequency (kHz)
Define Read and Write Bit Encoding Specifies the positions and values to read and write bits from an SPI register. At the start of the session, the values of the parameters are as follows:
  • Write Command: 0
  • Read Command: 1
  • Command Length: 1
  • Address Offset: 7
  • Read command
  • Write command
  • Command length
  • Address offset
Enable Read and Write Bits Enables read and write bit encoding. When a low-level SPI session is created, this API is set to TRUE by default.
Disable Read and Write Bits Disables read and write bit encoding.
Write Register Writes data to single or multiple registers.
  • Register addresses
  • Register data
Read Register Reads data from single or multiple registers.

The Read Byte Size is a one-dimensional array of integers and specifies the length of the data to read in bytes.

  • Register address
  • Read byte size
Destroy Destroys the low-level SPI session and deallocates the reserved resources.
Note The NI657x I3C® Low-Level API are available for LabVIEW and .NET only.
Table 19. NI657x I3C® Low-Level API
API Call Description Inputs
Instantiate (deprecated) Creates and returns a low-level I3C session.
  • Instrument handle
  • Pattern project file path
Instantiate Creates and returns a low-level I3C session.
  • Resource name
  • gRPC session name
  • gRPC device server address
  • gRPC device server port
  • Pattern project file path
Set Pattern Parameters

Sets the pattern parameters to configure source and capture waveforms, and burst the pattern.

  • Data pin name
  • Bus
  • Pin group name
  • Source waveform name
  • Capture waveform name
  • Burst timeout in seconds (ms)
Unload and Load Pattern

Unloads all patterns and loads patterns according to the specified Pattern Name.

  • Start label
  • Pattern name
Set Legacy I2C Clock Frequency Sets the clock frequency in the pattern project specification file for the legacy I2C operation. The specification file must contain a specification named I2C.Clk_Freq.
  • Clock frequency (kHz)
Set I3C Clock Frequency Sets the clock frequency in the pattern project specification file for the I3C operation. The specification file must contain a specification named I3C.Clk_Freq.
  • Clock frequency (kHz)
Legacy I2C Write Register Writes data to single or multiple registers during the legacy I2C operation.

When Include broadcast address is set to TRUE, a 7-bit broadcast address is included at the start of the burst sequence.

  • Slave address
  • Register addresses
  • Register data
  • (Optional) Include broadcast address
Legacy I2C Read Register Reads data from single or multiple registers during the legacy I2C operation.

The Read Byte Size is a one-dimensional array of integers and specifies the length of the data to read in bytes.

When Include broadcast address is set to TRUE, a 7-bit broadcast address is included at the start of the burst sequence.

  • Slave address
  • Register address
  • Read byte size
  • (Optional) Include broadcast address
I3C SDR Write Register Writes data to single or multiple registers in SDR mode during the I3C operation.

When Include broadcast address is set to TRUE, a 7-bit broadcast address is included at the start of the burst sequence.

  • Slave address
  • Register addresses
  • Register data
  • (Optional) Include broadcast address
I3C SDR Read Register Reads data from single or multiple registers in SDR mode during the I3C operation.

The Read Byte Size is a one-dimensional array of integers and specifies the length of the data to read in bytes.

When Include broadcast address is set to TRUE, a 7-bit broadcast address is included at the start of the burst sequence.

  • Slave address
  • Register addresses
  • Register data
  • (Optional) Include broadcast address
Execute Dynamic Addressing CCC Executes the CCC commands to assign dynamic addresses.

When the CCC Type is set to Broadcast, the Slave Address is not used in the CCC waveform burst.

  • Slave address
  • CCC type
  • Command ID
  • Dynamic address
Execute Dynamic Addressing CCC with Read Executes the CCC commands to assign dynamic addresses and returns the data read from the DUT. This API is applicable only for the enter dynamic address assignment (ENTDAA) CCC in the current I3C specification.

When the CCC Type is set to Broadcast, the Slave Address is not used in the CCC waveform burst.

  • Slave address
  • CCC type
  • Command ID
  • Dynamic address
Execute SDR CCC Write

Executes the write CCC commands used in SDR mode.

When the CCC Type is set to Broadcast, the Slave Address is not used in the CCC waveform burst.

  • Slave address
  • CCC type
  • Command ID
  • Defining byte
  • Write data
Execute SDR CCC Read Executes the read CCC commands used in SDR mode and returns the read data.

When the CCC Type is set to Broadcast, the Slave Address is not used in the CCC waveform burst.

  • Slave address
  • CCC type
  • Command ID
  • Read byte size
  • Defining byte
Destroy Destroys the low-level I3C session and deallocates the reserved resources.

SDConfig Editor API

The following table defines the API calls you can make to open the SDConfig Editor and edit the contents of the configuration .sdconfig file that you export from InstrumentStudio. You can make the following edits using the SDConfig Editor:

  • Register map file path
  • Script folder location
  • Interface settings
  • Protocol settings
  • Register group mappings
  • DIO mappings
Table 20. SDConfig Editor API
API Call Description Inputs
ShowSDConfigEditor() Opens the SDConfig Editor window that can be used to edit the contents of .sdconfig files exported from InstrumentStudio.
  • (Optional) Path to InstrumentStudio export configuration (.sdconfig file)
  • (Optional) Register map file path
  • (Optional) Script folder location