×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 19730300, Entry date: 12/16/2004
(0)
Rate

How you can increment/decrement a variable value in the runtime via a button

  • Entry
  • Associated product(s)
You can use the OCX "SpinButton" for this function. Below is a description of how to incorporate and interconnect this object.

Procedure:

You can use the OCX "SpinButton" for this function. Below is a description of how to incorporate and interconnect this object.

  1. 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 OK.

    Fig. 1: Inserting the "SpinButton" object ( 23 KB )

  2. 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
  3. With the "Min" and "Max" attributes you set the range in which you want to change the value.

  4. 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 milliseconds).

  5. The "Orientation" attribute defines the orientation of the button for the "SpinButton" object (horizontal, vertical).

    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.

Note:
(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.

Keywords:
SpinButton, Toggle button, Picture object, Value change, Button, increment, decrement


Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.
Support to the statistics
With this function the IDs found are listed according to number (format .txt).

Generate list
Copy URL
Display page in new design
mySupport Cockpit
Related links