Skip to content

Check box group

The check box group shows the bits of one integer tag. Each check box is its own bit and is checked when the bit is set. A click toggles the bit and writes the whole word; the other bits stay as they are. This is how the WinCC Check box works. Typical uses, each kept in one PLC word:

  • which pumps are in service;
  • which sensors to count;
  • permissions by area.

Check boxes are set as “bit=text” pairs in “Check boxes”, with bit 0 the lowest and 63 the highest. They can also come from a project text list where the value is the bit number. Bits need not be consecutive: 0=Pump 1; 1=Pump 2; 4=Fan. The tag must be an integer type such as Int16, UInt16 or Int32; the project check warns otherwise.

Writing checks the element’s right, asks the “Confirm” question and raises “Value changed”. Without a connection to the tag the boxes are grey.

For a single bit, a switch with the “Check box” style is more convenient.

Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:

Property Values Default Description
Tag tag name Tag. Integer tag: each check box is one of its bits
TextList text list Text list. Project text list where the value is the bit number; empty — the check boxes below
Items text 0=Насос 1; 1=Насос 2; 2=Насос 3 Check boxes. “bit=text” pairs separated by “;”: 0=Pump 1; 1=Pump 2; 4=Fan (bit 0 is the lowest)
Orientation Vertical, Horizontal Vertical Direction. Check boxes in a column or in a row
MarkColor #RRGGBB #2F6FB0 Mark color
Confirm text Confirmation. Question before writing; empty — no question
FontFamily text Font. Windows font name: Segoe UI, Arial, Consolas, Tahoma; empty — default
FontSize number 14 Font size
Bold true / false false Bold
Italic true / false false Italic
Underline true / false false Underlined
Foreground #RRGGBB Text color. Empty — default
Alignment Left, Center, Right Left Alignment
VerticalAlignment Top, Center, Bottom Top Vertically
Background #RRGGBB Background. Empty — default
BackgroundStyle Solid, VerticalGradient, HorizontalGradient, Transparent Solid Background fill. Solid, gradient (3D) or transparent
Background2 #RRGGBB Second background color. For gradient; empty — lighter than background
BorderColor #RRGGBB Border color. Empty — default
BorderWidth number 0 Border width. 0 — no border
BorderStyle Solid, Dash, Dot, DashDot Solid Border style
CornerRadius number 0 Corner radius
Padding number Padding. From border to text; empty — default
Shadow true / false false Shadow
FlashBackground true / false false Flash background. Background alternates with the flash color; to switch by tag — use property animation
FlashBackgroundColor #RRGGBB #D32F2F Background flash color
FlashForeground true / false false Flash text
FlashForegroundColor #RRGGBB #FFFFFF Text flash color
FlashRate Slow, Medium, Fast Medium Flash rate

Item.Type = CheckGroup. Any property is read and changed by name: Item.MarkColor = "#D32F2F". The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.

Actions of this element:

Member Description
Boxes() Check boxes — Bit, Text, Checked
IsChecked(bit or text) Whether a check box is checked
Check(bit or text, on) Check (true) or uncheck (false) a box, like the operator
Toggle(bit or text) Toggle a check box, like an operator’s click

Mouse, hover, focus and keyboard — as for any element (see Events and functions). Its own events:

  • Value change (Change) — The operator entered a new value.

Put pump 2 into service from a script. The other bits of the word are not touched.

Screen.Items("Pumps").Check("Pump 2", true);

List of checked boxes.

var on = Screen.Items("Pumps").Boxes().filter(function (b) { return b.Checked; });
HMI.ShowMessage("In service: " + on.map(function (b) { return b.Text; }).join(", "));