SpinControl

The element "SpinControl" enables the value of a variable to be incremented or decremented by clicking on the small arrow keys to the right of the element.

SpinControl 1:

Properties editor

The properties of a visualization element - except alignment and order - can all be configured in the properties editor. By default, this editor opens next to the visualization editor, or it can be opened explicitly via the "Properties" command (which can be found in the View menu as standard).

A property can be modified by editing the field "Value". To this end, an input field, a selection list, a dialog or checkbox that can be activated is provided in this field, depending on the element type. The value field opens

If a variable is assigned,

Working in the list of properties can be made easier with the aid of default, sorting and filter functions.

Element properties

All element properties and their descriptions are listed below.

Element name

The element name can be changed. Standard name is "GenElemInst_x". "x" stands for a sequential number.

Element type

The element type is entered here. For three element groups it is possible to switch between the corresponding elements by changing the element type:

Position

Here you can define the position (X/Y coordinates) and size (width and height) of the element in pixels. The origin is in the top left corner of the window. The positive x-axis is on the right, the positive y-axis runs downwards. If the values edited, the displayed element is simultaneously modified in the visualization editor.

X

Horizontal position in pixels – X=0 is the left edge of the window.

Y

Vertical position in pixels – Y=0 is the upper edge of the window.

Width

Width of the element in pixels

Height

Height of the element in pixels

Additional settings

Variable

Numerical variable, the value of which increases or decreases after a user input.

Number format

Formatting sequence, with which the variable value is displayed.

Example: %i for an integer variable

Interval

Interval (increment) by which the value of the variable is incremented or decremented after a user input.

Value range

Minimum value

Enter the maximum value.

Maximum value

Enter the minimum value.

Text properties

Use of

The following two settings are available for selection:

  • Default style values
  • User-defined settings
    • Horizontal alignment
    • Vertical alignment
    • Font
    • Font color

User-defined text properties

Horizontal alignment

Defines the horizontal alignment of the text through selection of:

  • Left
  • Centered
  • Right

Vertical alignment

Defines the vertical alignment of the text through selection of:

  • Top
  • Centered
  • Bottom

Font:

Defines the font through selection from predefined fonts:

  • Standard
  • Heading
  • Large heading
  • Title
  • Note

Press SpinControl 3: to opens the dialog for user-defined font properties.

Font color

Defines the font color for the element. Either from the selection list or via the dialog that opens when SpinControl 4: is clicked.

Color variables

The color variables used for dynamic definition of the element colors via project variables of type DWORD. A color is defined based on a hexadecimal number consisting of red, green and blue (RGB) components. In addition, the variables are used to specify the transparency of the color (FF: fully opaque - 00: fully transparent). The DWORD has the following structure: 16#TTRRGGBB

SpinControl 5:

The structure of the hexadecimal number differs, compared to TwinCAT 2. In TwinCAT 3, in addition to the RGB components, the color transparency can also be defined with the hexadecimal number. The transparency is indicated by the first two digits after “16#”. Colors with definitions starting with “16#00” are invisible, since they are fully transparent.

Example:

nFillColor := 16#FF8FE03F;

Color change

Boolean variable, which controls the switching of the element color between "normal state" (variable = FALSE) and "alarm state" (variable = TRUE).

SpinControl 6:

Transparency is not supported under Windows CE.

State variables

These are dynamic definitions of the availability of the element in online mode.

Invisibility

Specification of a boolean variable. If this returns TRUE, the element is invisible in online mode.

Input disabled

Specification of a boolean variable. If TRUE is returned, inputs for the element have no effect. Also, the element itself is greyed out in the visualization, to indicate that no user inputs are possible.

If the visualization uses the user management, the elements for user groups with access right "only visible" are grayed out.

Input configuration

Here you can define the consequential action that should be performed when the user makes an input in the element in online mode. As long as no follow-on actions are defined, "Configure…" appears in the Properties field. Click on "Configure…" to open the Input Configuration, where you can assign follow-on actions. Each input action can be assigned any number of follow-on actions.

The following input events are available for an element:

OnDialogClosed

This event is triggered if one of the dialog boxes that were opened for user inputs is closed within a visualization.

Note: This property is not limited to the element, for which it is configured, but applies within the entire visualization. It therefore does not respond to each dialog closing action. Currently there is no way to define such a property for the entire visualization. It therefore has to be assigned to one of its elements.

OnMouseClick

This mouse event is triggered when the cursor points to an element and a full mouse click (pressing and releasing the mouse button) is executed on this item.

OnMouseDown

This mouse event is triggered when the mouse button is pressed while the cursor points to an element. It is irrelevant where on the visualization the mouse button is released again.

OnMouseEnter

This mouse event is triggered when the cursor is dragged to the element. It is irrelevant whether the mouse button is pressed or released.

OnMouseLeave

This mouse event is triggered when the cursor leaves the element. It is irrelevant whether the mouse button is pressed or released.

OnMouseMove

This mouse event is triggered when the cursor is moved within the element. It is irrelevant whether the mouse button is pressed or released.

OnMouseUp

This mouse event occurs when the mouse button is released on the element. The mouse button was pressed prior to that outside of the element.

Input configuration - hotkeys

A hotkey can be used to define a key or key combination and link it with a follow-on action (e.g. MouseDown, MouseUp), which is to be executed when a key event occurs (KeyDown, KeyUp). By default the MouseDown action is executed on KeyDown (press key) and the MouseUp action on KeyUp (release key). This can be useful if a visualization is to be operated both via mouse actions and keyboard entries, since the input actions then only have to be configured once. The key configuration for an element is also managed in the hotkeys configuration for the visualization. Any changes are always synchronized between this and the element properties editor.

Key

Assigning a key. A selection list contains all currently supported keys, e.g. M.

Event(s)

Definition of the event to be executed, if the key or key and modifier are used. Possible values that are available in a selection list:

  • No action
  • MouseDown action when the key is pressed
  • MouseUp action when the key is released
  • MouseDown/MouseUp action when the key is pressed/released

Shift

If this option is enabled, the key has to be used in combination with the Shift key.

Control

If this option is enabled, the key has to be used in combination with the Ctrl key.

Alt

If this option is enabled, the key has to be used in combination with the Alt key.

Access rights

This setting relates to the access rights for the individual element. Click to open the Access rights dialog. The setting is only available if a user management was added to the PLC project. The following status messages are available:

Not set. All rights.

The default message is set, if the element is shown as available for all groups.

Rights are issued: Limited rights.

The message is set, if the element is shown with limited behavior for at least one group.