Developing Custom Interfaces and Protocols
- Updated2025-09-22
- 4 minute(s) read
Developing Custom Interfaces and Protocols
The Semiconductor Device Control Add-On Professional edition for InstrumentStudio provides project templates in Visual Studio for you to create custom interfaces and protocols.
Developing a Custom Interface
Complete the following steps to develop a custom interface.
- Launch Visual Studio.
- Enter Semiconductor Device Control Interface Library in the search field.
- Click Semiconductor Device Control Interface Library to create a new interface project from the interface template.
-
In the Configure your new project dialog box, enter the
name of the interface.
The word Interface automatically appends to the name you specify when the project is created.
-
Add settings to the interface class. The settings help to acquire inputs from
the Semiconductor Device Control Add-On. Refer to the
SettingsInformation Class section for more information about
each setting.
Note When creating a new project, do not change any of the class names in the project template. The class names are automatically generated with the template.
- Add the required interface settings and provide logic for setting validation.
- Implement the logic for the GetDeviceInformation() API to return the resource name and .pinmap file path, which allows the Semiconductor Device Control Add-On to load the DIO details from the pin maps.
- Define actions to perform during communication start and stop in the Run() and Stop() APIs.
-
Test the interface using the unit test project for the interface.
The unit test project is in the same location as the interface project.
- Run the PackageGenerator.bat file located in the Visual Studio project directory to create the package file.
SettingsInformation Class
The SettingsInformation class sets the name, header, and other information for each setting in the configuration page of the Semiconductor Device Control Add-On. This class contains a constructor that accepts the following parameters.
| Setting | Data Type | Description |
|---|---|---|
| Name | string | Name of the setting |
| Header | string | Header of the setting that groups settings. Settings under the same header display together in the Semiconductor Device Control Add-On. For example, use the header Pin Settings for the Pin Group, Write Pin, and Read Pin settings to display these settings together. |
| Datatype | string | Data type for the setting. Appropriate controls display in the Semiconductor Device Control Add-On based on their data type. Refer to the Settings Data Types section for more information about acceptable data types. To set the datatype as string, use the constant strings of the class. |
| Value | string | This property denotes the default value for the setting. This parameter can be empty if not applicable. |
| PossibleValue | List<string> | A list of values that apply to the setting. This parameter can be an empty list or null if not applicable. |
| Disable | Boolean | This property can be true if the settings need to be disabled in the Semiconductor Device Control Add-On. |
| Tooltip | string | Displays the tooltip for the setting. |
Settings Data Types
The SettingsDataType class contains constant strings that denote the data types for each setting in the Semiconductor Device Control Add-On configuration page.
| Setting | Data Type |
|---|---|
| Boolean | Toggle button |
| Button | Button |
| ComboBox | Combo box |
| Numeric | Numeric |
| PathFile | Text box with file browse control |
| PathFolder | Text box with folder browse control |
| SignedNumeric | Signed numeric |
| String | Text box |
| Image | File path input, which expects an image path and displays the image in the Semiconductor Device Control Add-On. The recommended image resolution is 212 pixels x 1175 pixels. |
Developing a Custom Protocol
Complete the following steps to develop a custom protocol.
- Launch Visual Studio.
- Enter Semiconductor Device Control Protocol Library in the search field.
- Click Semiconductor Device Control Protocol Library to create a new protocol project from the protocol template.
-
In the Configure your new project dialog box, enter the
name of the protocol.
The word Protocol automatically appends to the name you specify when the project is created.
-
Add protocol settings to the protocol class. The protocol settings help to
acquire inputs from the Semiconductor Device Control Add-On.
Note When creating a new project, do not change any of the class names in the project template. The class names are automatically generated with the template.
- Add the required protocol settings and provide logic for setting validation.
- Define actions to perform during communication start and stop in the Run() and Stop() APIs.
- Add the logic required to perform write register operations in the WriteRegister() API.
- Add the logic required to perform read register operations in the ReadRegister() API.
-
Test the protocol using the unit test project for the protocol.
The unit test project is in the same location as the protocol project.
-
Update package specifications in the control file, as needed, and run the
PackageGenerator.bat file located in the Visual Studio
project directory to create the package file.
Note In the specifications folder of the package, add any instrument-specific driver or wrapper you need for communication.
- Run the PackageGenerator.bat file to create the protocol package file.
Related Information
- API Reference for Interface and Protocol Projects
The Semiconductor Device Control Add-On Professional edition for InstrumentStudio includes APIs in the interface and protocol project templates to create communication interfaces.