Switches

The objects of PLC-Lab are listed in a tree structure within the tools. These are sorted by category. For example, the category "Lamps" contains all lamp-like objects such as indicator lights, LEDs, stack signal lights, etc.

You can use all the objects in the list to set up a virtual system in PLC-Lab.

After placing an object on the drawing area, you can change the properties of the object and thus adapt its behavior to your requirements.

If you are not yet familiar with how you draw a system, you can read the most important operating instructions in the following section:

Tips and actions for drawing a system

In this section you will find switch objects in different forms. In the existing categories these are partly preconfigured in different colors. The colors and settings are not permanent, they can be adapted in the properties to your own needs.

Switches are mostly used to influence a bit operand. These can be designed as push-buttons or switches. You can select this via the property. They can also be configured as either a closer or an opener.

All switch types are derived from the same original object. These are preconfigured for special tasks only by the settings. This means that you can change all switch types to another switch type by changing the properties.

Switches are not physics objects by default, so they are not visible to the physics engine. You can change this if necessary. Only the properties "Physical type of object" and "Is physics object" as well as the other physics properties have to be adjusted.

A switch cannot only write the values '0' and '1' into an operand. By specifying a range, for example, the value '100' can be written into a byte operand when it is actuated.

To do this, you need only this specification:

0-100 IM.MB10

When the switch is actuated, the value 100 is written to the byte operands MB10 (if it is configured as a closer).

Switches that are not illuminated

This type of switch is intended as a switch that is not illuminated. They are typically used to set a bit operand to the value '0' or '1'.

Switches that can be illuminated

This type of switch is illuminated. In addition to the operand to be influenced, an operand can also be specified, which is evaluated for the illumination. For this purpose, the property Operand switching fill color of the respective operand is specified within the property rubric Appearance->Colors. However, this specification is not mandatory.

Rotary switches

The rotary switch displays a graphic within the switch object that symbolizes a rotary switch. The two graphics for status '0' and '1' are specified in the property sections "Appearance -> Images". If it should be necessary to change the rest position of the switch, then both graphics can be changed.

Windows button

As the name suggests, a button with the appearance of a Windows button is shown. The settings of this button are limited. For example, no graphics can be set. It is also not possible to specify a hotkey.

Horizontal switches

The horizontal switch shows a graphic inside the switch object that symbolizes a horizontal switch. The two graphics for status '0' and '1' are specified in the property sections "Appearance -> Images".

Customizing switch graphics

If you want to customize a switch object with your graphics for the individual switching states, proceed as follows:

  • In the properties section "Appearance -> Colors", set the fill color and the line color to fully transparent. You can do this by setting the opacity of the color to 0%.
  • Now select an image file for the status '0' and the status '1' in the properties section "Appearance -> Images".

If you want to use vector graphics (XAML file), you can specify those in the properties section "Appearance -> Vector graphics".

The first point of the list is only necessary if the "normal" switch object should not be visible anymore. But if you use a PNG-graphic with transparent areas, you may want to keep the normal switch visible.

This is described and an example shown here:

Using of graphics in objects

Operating a switch via hotkey

All switch types with the exception of the Windows button can be provided with a hotkey. You can specify a letter a-z or a number 0-9 at the property "Hotkey" within the category "Main settings->Button properties".

In the simulation the button can be activated with the mouse or this hotkey.

This also makes it possible to operate several switches simultaneously by selecting a different hotkey for each of them and then pressing them on the keyboard at the same time. This means that two-hand activations can be implemented in the simulation.