How you can increment/decrement a variable value in the runtime via a button
You can use the OCX "SpinButton" for this function. Below is a description of how to incorporate and interconnect this object.
- In the WinCC Graphics Designer, insert a smart object of the
"Control" type. In the window that opens select the entry
Microsoft Forms 2.0 SpinButton and acknowledge with
Fig. 1: Inserting the "SpinButton" object ( 23 KB )
- Right-click to open the Properties of the "SpinButton" object.
In Control Properties interconnect the "Value" attribute with the
variable that you want to address (Fig. 2). In this example the
variable is called "SpinButton".
Fig. 2: Properties of the SpinButton
- With the "Min" and "Max" attributes you set the range in which
you want to change the value.
- Via the "SmallChange" value you specify the change step size.
The "Delay" attribute controls the delay after a value change
before the button can be selected again (specification in
- The "Orientation" attribute defines the orientation of the
button for the "SpinButton" object (horizontal,
Since this is not a WinCC OCX, but a third-party OCX (Microsoft), the process variable to be changed must be linked via a direct connection.
Fig. 3: Interconnection for the "SpinButton"
Fig. 4: Creating the direct connection
The "SpinButton" object is now completely configured.
(excerpt from the WinCC Online Help):
Using ActiveX controls
The use of ActiveX controls from third-parties can lead to errors (e.g. memory loss, decreased performance, system congestion). The user of the software is responsible for any problems due to the use of third-party ActiveX controls. We recommend checking thoroughly before application.
Linking C scripts with events of ActiveX controls
If C scripts are linked with events of ActiveX controls, then you should make sure that the event name concerned is at least 5 characters long. If the name of the event is shorter than 5 characters, then the C script is not executed.
Siemens assumes no liability whatsoever for conflict-free operation of third-party ActiveX controls.
The use of third-party ActiveX controls is the sole responsibility of the user. It is recommended to make a thorough check for safe operation before application.
Non-certified ActiveX controls must behave in compliance with the Microsoft specification. In case of conflict it is the obligation of the user to produce evidence that the specification has been complied with.
SpinButton, Toggle button, Picture object, Value change, Button, increment, decrement