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

The following diagram illustrates the workflow of creating a custom interface.
Figure 3. Custom Interface Workflow


Complete the following steps to develop a custom interface.

  1. Launch Visual Studio.
  2. Enter Semiconductor Device Control Interface Library in the search field.
  3. Click Semiconductor Device Control Interface Library to create a new interface project from the interface template.
  4. 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.
  5. 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.
  6. Add the required interface settings and provide logic for setting validation.
  7. 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.
  8. Define actions to perform during communication start and stop in the Run() and Stop() APIs.
  9. Test the interface using the unit test project for the interface.
    The unit test project is in the same location as the interface project.
  10. Run the PackageGenerator.bat file located in the Visual Studio project directory to create the package file.
After creating the package file, deploy the package file to the Semiconductor Device Control Add-On.

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.

Table 21. SettingsInformation Class
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.

Table 22. Settings Data Types
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

The following diagram illustrates the workflow of creating a custom protocol:
Figure 4. Custom Protocol Workflow


Complete the following steps to develop a custom protocol.

  1. Launch Visual Studio.
  2. Enter Semiconductor Device Control Protocol Library in the search field.
  3. Click Semiconductor Device Control Protocol Library to create a new protocol project from the protocol template.
  4. 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.
  5. 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.
  6. Add the required protocol settings and provide logic for setting validation.
  7. Define actions to perform during communication start and stop in the Run() and Stop() APIs.
  8. Add the logic required to perform write register operations in the WriteRegister() API.
  9. Add the logic required to perform read register operations in the ReadRegister() API.
  10. Test the protocol using the unit test project for the protocol.
    The unit test project is in the same location as the protocol project.
  11. 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.
  12. Run the PackageGenerator.bat file to create the protocol package file.