Configuring Shared Variables Programmatically (DSC Module)
- Updated2023-02-21
- 2 minute(s) read
You can configure a shared variable programmatically by using the SharedVariableIO properties. You can configure SharedVariableIO properties for network-published shared variables only. Enable network publishing for a shared variable before you configure this shared variable.
Complete the following steps to configure a shared variable programmatically.
- Create and deploy a shared variable.
- Add a shared variable constant on the block diagram.
Add
- Click the down arrow on the shared variable constant and select or browse to a shared variable to configure.
- Right-click the shared variable constant and select Create»Property from the shortcut menu.
- Select the property you want to configure. A Property Node appears with the property you selected.
Note To write data to the shared variable properties, right-click the Property Node and select Change To Write from the shortcut menu. To read data from shared variable properties, right-click the Property Node and select Change To Read from the shortcut menu. Some properties are read-only properties. Refer to the characteristics of each property to determine whether the property is read-only. - Wire the shared variable constant to the Property Node.