How the multistate push button works at runtime
When the operator first presses the button, it changes from State 0 to State 1 and sends the State 1 value to the data source. When the operator presses the button a second time, it changes from State 1 to State 2 and sends the State 2 value to the data source. Thus the state is increased by one for each button press. When the button is in the last configured state and the operator presses it, it changes to State 0 and sends the State 0 value to the data source.
The multistate push button’s behavior at runtime also depends on how you set up the
Next state based on
option, auto repeat options, and connections.Changing states
- The application uses theNext state based onoption (specified in the General tab of the Multistate Push Button Properties dialog box) to determine how to change the button’s state.
- When the operator presses the button, ifNext state based onis set to Value, and the value of the connection does not match any of the states' values, the button is set to State 0 and the application writes the State 0 value to the data source.
Using auto repeat
- Set up the Repeat rate and Repeat delay options in the Timing tab of the Multistate Push Button Properties dialog box.
- When the operator presses the button, the auto repeat delay starts timing. The application continues timing until the operator releases the button or until the time reaches the Repeat delay time. If the Repeat delay time is reached, the button goes into auto repeat mode until the operator releases the button. Once in auto repeat mode, the application uses the Repeat rate option to determine the number of button presses per second to send to the data source.
- When in auto repeat mode, the application does not read the Value control to determine the next value to write out, regardless of theNext state based on setting. The application uses the last value written out to determine the next value to write out.
Using connections
- If you assign just the Value connection and not the Indicator connection, the button’s pressed state is displayed as soon as the button is pressed. The feedback for this connection is local and immediate. It does not necessarily reflect the value of the Value connection in the data source.
- If you assign the same tag to the Value and Indicator connections, at runtime the displayed button state is based on the Indicator connection. If network traffic is heavy, the display response might be delayed.
- If the Indicator connection value is a floating point value, the application rounds the value to the nearest integer to determine the state to display.
Starting applications
- When an application starts up at runtime, including starting after a reboot, the application reads the Value connection and sets the button to this state, regardless of theNext state based onsetting.
Opening and closing graphic displays
- When you open a display at runtime, the application reads value of the Value connection, but does not write the value to the data source.
- When you open a display at runtime, the application reads the Indicator connection value and updates the display based on the value, unless the Value connection is unassigned.
- When you close a display at runtime, if the button is in auto repeat mode, the button is released and the application writes the current value to the Value connection.
Provide Feedback