Providing Configuration Data to a Process

NI InsightCM™ SDK 3.3 Help

Edition Date: December 2018

Part Number: 375191F-01

»View Product Info
Download Help (Windows Only)

Parent Topic: Creating a New Process

Processes often need to transfer data from iteration to iteration between message-handling subdiagrams. The process VI template provides a configuration cluster for this purpose. This cluster can store configuration properties set in NI InsightCM Server and applied to the device when a user saves changes to the configuration. You can populate the cluster with configuration properties in the Initialize subdiagram of the process VI.

What to Use

  • Global Configuration VIs
  • Device Helpers VIs
  • config.ctl from the project library

What to Do

Create the following block diagram to read from configuration files, filter properties for elements, and bundle the properties into the configuration cluster. Customize the gray section for your unique programming goals.

Read properties from configuration JSON files stored on the device. The Get Device Model VI returns the contents of the entire device model. Other Global Configuration VIs read and return properties for alarm rules, the equipment hierarchy that is defined in the InsightCM web application, and so on.
Return configuration information for only the channels in a specific data group. You often need to filter the contents of configuration files because they consist of clusters with many elements or arrays of clusters. Use the Device Helper VIs to filter configuration files for elements.
From each channel configuration, read a specific property and use its value to determine whether to add the data group name to the configuration cluster. Some configuration properties are formatted as key-value pairs rather than as named elements. Use the Property Helpers VIs to parse key-value properties.
Bundle the array of data group names into the configuration cluster. Modify the config.ctl type definition in the project library for the process so it contains all the elements that the process needs to access in any subdiagram.

Tips

  • Convert your custom initialization code to a subVI to save space and simplify future updates to this code.
  • You do not have to populate the entire configuration cluster in the Initialize diagram. Other subdiagrams can bundle values that do not originate in configuration files into the cluster.
  • The Global Configuration VIs contain a found output that returns FALSE if an error occurs when reading or converting configuration data. If the configuration data you are reading is essential to the process, you can use found to place the device in an Invalid Configuration error state. Wire found to a Case structure that calls the InvalidConfigurationRoutedMessage_Send VI in its False case. This VI sends a message to the Controller process, which the Controller process handles by logging a tracepoint instance and setting the device into an invalid configuration error state.

Related Information

Configuration Properties from NI InsightCM Server

Components of a Process

Controller Process

WAS THIS ARTICLE HELPFUL?

Not Helpful