You can set the initial value only for network-published shared variables.
 |
Note You can set the initial value only for shared variables with the Variable Type is set to Network-Published on the Variable page of the Shared Variable Properties dialog box. |
Complete the following steps to initialize a shared variable to a known value when the Shared Variable Engine starts.
- Right-click a target or a project library in the Project Explorer window and select New»Variable from the shortcut menu. You also can right-click an existing shared variable in the Project Explorer window and select Properties from the shortcut menu to display the Shared Variable Properties dialog box.
- Select the Logging option in the listbox of the dialog box to display the Logging page of the Shared Variable Properties dialog box.
- Select the Initial Value option in the listbox of the dialog box to display the Initial Value page of the Shared Variable Properties dialog box.
- Place a checkmark in the Enable Initial Value checkbox.
- Enter the initial value you want the shared variable to have in the Initial Value control. The information you enter in this control depends on the data type of the shared variable.
- Double—Enter a numeric value in the Initial value field.
- String—Enter a text value in the Initial value text box.
- Boolean—Select whether you want the initial value to be 0 (Low) or 1 (High) in the Initial value section.
- U32 Bit Field—Enter a numeric value in the Initial value field.
- Click the OK button.