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

Second contact module (from V1.8.2.0)

As of version 1.8.2.0, a second operand can be specified at the switch. This is a second contact module whose contact can be configured as a normally open or normally closed contact. When the switch is actuated, the operand of the second contact module is also influenced.

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

Rotary switch on/off

The rotary switch on/off 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.

Multi rotary switch (from V1.7.0.0)

The multiple rotary switch supports a maximum of three switch positions on the left and four switch positions on the right. The zero position is in the middle. The number of left and right switch positions can be set individually. For this purpose, the properties "Number of switch positions right" and "Number of switch positions left" are set in the range 1 to 4 and 0 to 3 respectively.

The switch shown below has two switch positions left and three switch positions right:

An operand can be assigned to each switch position. In addition, each position can be configured as normally open or normally closed.

Horizontal switches

Horizontal switch On/Off

The horizontal switch on/off 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".

Horizontal multi switch (from V1.7.0.0)

The horizontal multiple switch supports max. three switch positions on the left and four switch positions on the right side. The zero position is in the middle. The number of left and right switch positions can be set individually. For this purpose the properties "Number of switch positions right" and "Number of switch positions left" are set in the range 1 to 4 and 0 to 3 respectively.

The switch shown below has two switch positions left and three switch positions right:

An operand can be assigned to each switch position. In addition, each position can be configured as normally open or normally closed.

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.

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.