NI InsightCM™ SDK 3.3 Help
»View Product Info
Parent Topic: Adding Support for New Device Hardware, Channel Types, and Properties
To support the configuration of a custom device type, you might need to customize the InsightCM web application by customizing an existing device type definition. To customize an existing device type definition, you must work with JSON files that serve as the source for device type definitions. NI recommends that you start from the NI-developed device type definitions in NI InsightCM Server. Complete the following steps to customize a device type definition:
- Export an existing device type definition from NI InsightCM Server, such as one that NI developed. This ensures you have a template that contains all relevant definition components to begin from. If your programming goals allow, you might be able to reuse NI-developed component definitions within the new device type definition. For example, you can reuse the configuration tab layouts in an existing device type definition if you want the Devices page to display the same set of tabs.
- Modify existing JSON to achieve the behavior you desire. For example, you might want to add a new sample rate option to the existing pull-down menu in the InsightCM web application where users configure this setting. For a list of modifications you can perform, refer to Customizable Features of the InsightCM Web Application.
- Create definitions for any new components that are unique to your device type. For example, you might want to create a new channel type definition to use with an existing device type definition. For a list of component types you can create, refer to Customizable Features of the InsightCM Web Application.
- Call any new component definitions from the appropriate location in the hierarchy of JSON definitions. For example, consider the task of adding a new property field to the channel-configuration pane on the Device Configuration page»Channels tab. This task requires the following steps:
- Creating a property definition.
- Calling the property definition from the channel type definition to which it applies.
- Calling the property definition from a new or existing layout group in the channel type definition so it appears at the location in the InsightCM web application that you desire.
- Import the device type definition into NI InsightCM Server.
Techniques for Sourcing Definitions
When you develop components of the overall device type definition, you can typically choose to define them inline within the calling definition or externally, in separate JSON files. Defining element definitions externally is useful if you want to call the same definition from multiple files rather than redefining it in each file. For example, you can define a property field for channels, including its label and default value, in a property-type definition JSON file. Then you can call this JSON file from any channel type definition for which the property is relevant.
Correlating Components to a Location in the InsightCM Web Application
When you define certain components of a device type definition, you must correlate them to a particular location in the InsightCM web application so they appear where you desire. The following components require you to correlate them to a location:
- Layout groups
- Property fields
- UX rules
- Validation rules
To correlate these items to a particular location in the InsightCM web application, define the Type name-value pair in their definition.
||Note In addition to correlating a layout group or rule to the Operating States tab on the Assets page, you can correlate a layout group to the page in the New Device dialog box where you specify the controller and data acquisition modules in the device chassis.
Reading Device-Definition Properties in the Device Software
NI InsightCM Server sends device-configuration information, including properties that users set, to the device in a series of JSON files. Therefore, the device software can read the values of properties you add or edit in the device type definition. To read from the files and filter properties for elements, use Global Configuration VIs as you develop the device software in LabVIEW.
Importing a Device Type Definition into NI InsightCM Server
Accessing a Device, Feature, or Unit Definition to Use as a Template
Providing Configuration Data to the Device Software