The symbol table

In the symbol table, you can assign descriptive names to the operands used in the system project. As a rule, defining the symbols and assigning them to the operands of the respective device should be the first step when you start a new system project. For this, you should use appropriate and descriptive names. Even if the symbols might be longer as a result. This is because usually you do not have to type the symbols again manually when you use them in the object properties. You can insert them via drag & drop or Intellisense, without any additional typing.

We will show you how to do this in this section.

How a symbol entry is structured in the symbol table

A symbol entry consists of 5 parts. We will explain these in more detail below.

The device

The operand, for which the symbol name is defined, belongs to the device. The device can be changed, provided that the new device has the same operand. Also, no symbol may be assigned to this operand in the new device. The rewiring to another device can be done manually or via the function "Change the device of operands".

All devices that are available in the project can be selected in the list of devices. You can add new devices to the project using the function "Create a new device".

Here we describe the devices available in PLC-Lab.

The symbol

This is the symbol name for the operand. This should be as clear as possible. You can use the characters a-z, A-Z, öäü, _ and 0-9. The maximum number of characters is 80. The symbol must start with a letter.

When you have defined a symbol for an operand, you can specify this symbol instead of the operand in the properties of the objects. Symbols must be unique within a device; this means that a symbol already used in a device cannot be used again. Please note that there is no distinction made between upper and lower case letters.

Operand

This is the operand for which the symbol is defined. The set device determines the available operands.

Here you can find out more about the operands of the respective device types.

Data type

When you specify an operand, the program creates a list of the data types available for this operand. You can then select the data type. The data type is determined by their use in the virtual system, in particular for digital operands (byte, word, or double word operands). If a word operand, e.g. bipolar, is required, then "Int16" must be set as the data type and not "UInt16". This setting is essential when you consider that PLC-Lab may scale values from system sensors to the value range of the set data type.

When working with analog values in the S7 environment, the data type "S7Analog" should be used in this case. This data type has the value range -27648 to +27648, which corresponds to the analog range of a Siemens S7.

Comment

Here you can enter a comment for the symbol. The length is not limited.

Control elements in the symbol table

The following image shows a symbol table.

Below you can find a description of the individual control elements.

Filter for symbols in table (1)

Here you can specify a filter for the elements in the table. Only elements are displayed for which the filter was found in the device name, symbol, or operand name. In the example, "Cyl" was specified as the filter. As a result, only symbols with this component are displayed in the symbol.

Inserting a new symbol (2)

When you click on this button, a new symbol is inserted below the currently selected line in the table. The device set in (6) is used. The operand in the currently selected line with an address increased by one is used as the operand. This means that with a bit operand the bit address is increased by one, with byte operands the byte address is increased by one. For word and double word operands, the next word or double word address is set. Provided that this operand does not exist yet. If the new address already exists, the address is incremented until a free operand is found.

If the set device does not correspond to the device of the active line, then the standard operand type of the active device with the lowest address not yet used is used.

The operands can be entered in the German or English syntax. The first active input of an operand sets the syntax language. This means that if, for example, you change the operand "I0.0" to "E0.0", German syntax will be used from now on.

Deleting symbols (3)

The selected rows in the table are deleted.

Moving symbols (4)

The selected rows in the table are moved up or down in position.

Sorting the table (5)

The symbols are sorted by their operands and their addresses in ascending order. The sorting always takes place in the respective device. This process cannot be undone.

Select all unused symbols in the symbol-table (as of V1.8.4.0)

Display of the unused operands within the symbol table: The button "Select all unused symbols in the symbol table" can be used to display the symbols that are not used in any object. This is particularly useful if you want to check at the end of a project whether all relevant operands are used in the virtual plant.

Active device (6)

This list contains all devices available in this project. The symbols and operands inserted in the table are assigned to the selected device. The device operations to the right of the list also refer to the selected device, with the exception of changing the wiring.

Device settings (7)

When the currently active device has different setting options, you can open the dialog by clicking on this button.

Information about device (8)

When you move the mouse over this area, a tool tip appears with information about the active device. This includes a short description and the operands that are available in the device.

Creating a new device (9)

You can use this button to create a new device, provided that this is supported by the editon of PLC-Lab. The dialog that appears is shown below:

The device type can be selected on this screen. Different types are available depending on the edition.

Here we describe the devices available in PLC-Lab.

Once you have selected the type and entered a name, you can confirm the dialog by clicking OK.

After that a dialog appears. Its appearance depends on the selected device type. Below are the links to the description of the parameters to be set:

After confirming the configuration dialog, the name of the new device is inserted in the list and has also been preselected as the active device.

Info

Note: It is not possible to create simulation devices. Depending on the edition of PLC-Lab, these devices are available in the project by default.

Deleting a device (10)

When you click on this button, the currently active device with all available symbols is deleted. First a query is made. If it is confirmed, the process is executed. This process cannot be undone.

Info

Note: The simulation devices (Sim, PLCSim, PLCSim300) and the internal memory (IM) cannot be deleted.

Change the device of operands (11)

Using this function the operands of one device can be rewired to another device, if the operands are available there too.

Here this function is described

Import of symbols (12)

The symbols of a device can be imported from other programming tools such as TIA Portal, Simatic Manager, Grafcet Studio, etc..

Export of symbols (13)

The symbols of a device can be exported for using in other programming tools such as TIA Portal, Simatic Manager, Grafcet Studio, etc..

Use of symbols in objects

We mentioned at the beginning that defined symbols no longer have to be typed in manually when they are used. This is shown below.

Enter a symbol into the property of an object using Intellisense

In the symbol table the symbol "Start" was defined for the I0.0 of the device "PLCSim".

Now this symbol is to be used in a switch object that has been configured as a push-button. To do this, place the switch object and specify the device in the property "Operand", followed by a dot. Then press the key combination Ctrl + Space. Now a list with the symbols of the device appears. You can narrow down the list by specifying the first letter. Select the symbol you want to use with the cursor keys (up or down) and confirm with the return key. The selected symbol is then entered as an operand.

These steps are described below:

Drag & drop a symbol into the property of an object

Another way to add the symbol to a property is by drag & drop.

The starting point is the column to the right of the comment, which is marked with hatching. Click on this cell with the mouse and then start the drag & drop action.

Info

As of V1.5.2, the symbol for switch and lamp objects is entered as the object label text in addition to the operand.

Drag & drop a symbol directly into an object ( as of V1.5.2)

For some objects it is possible to drop the symbol directly onto the object using drag & drop. This is the case, for example, with switch objects. When a symbol is dragged & dropped over a switch in draw mode, the operand is used as the switch operand and the symbol is specified in the text field of the switch. You can see this below:

The symbol is selected in the symbol table and the drag & drop action is started via the hatched area. The target in the example is the upper switch object. When the action is complete, the switch has the symbol as its label and the operand is entered as the switch operand. The action is then performed with the "Stop" symbol and the lower switch object.

Once such an action has been executed, a message appears at the bottom edge of the PLC-Lab window for a short time indicating the property in which the operand was entered. For a switch this message reads as follows:

Info

As of V2.4.0, the adoption of the symbol as the object's caption text can be switched off. To do this, select the option "Do not use the symbol designation as a label" in the "Drawing Window Settings" dialogue. See also: Dialogue Draw-window settings

Objects which can be a direct target for a drag & drop action out of the symbol table

The following icons can be used as targets:

  • Switch objects: The operand is used as a switch operand and the symbol as the text of the switch.
  • Lamp objects: The operand is used as a lamp operand and the symbol as the text of the lamp.
  • Limit switch object: The operand is used as a limit switch operand.
  • Geometry objects: The operand is used as a limit switch operand.
  • Tubes: The operand is used as the operand for color changes.
  • Creator objects: The operand is used as the create-trigger operand.
  • Label: The operand is used as an operand and its text is the symbol followed by the value of the operand.
  • Tacho display: The operand is used as the operand for the current value.
  • Digital display: The operand is used as the operand for the current value.
  • Slider: The operand is used as the operand for the current value.
  • Digital gauge with pushwheel switch: The operand is used as the operand for the current value.

Changing the wiring of symbols or operands to other devices

Changing the wiring via the function "Change the wiring of operands to another device"

If you have created a system project for a certain device, e.g. an S7-300, and now want to use it for an S7-1500, then proceed as follows:

1) Save the system project under a different name. This is only necessary if you want to continue using the previous system with the old device. 2) Execute the function "Change the wiring of operands to another device" in the symbol table. 3=) A dialog appears. In the upper list "The wiring of the operands from the device:" select the previous device and in the lower list "will changed to the device:" select the new device. 4) Click OK to change the wiring.

After this action, all operands of the old device have been rewired to the new device, if this was possible. If only one operand is not present in the new device, then the action is not executed and an error is displayed. The action can be undone by executing the action again and specifying the two devices with swapped positions.

Info

Note: The rewiring is not only carried out for the operands within the symbol table, but also for the absolute addressed operands of the objects.

Manually changing the wiring in the symbol table

If you want to change the wiring of individual symbols in the symbol table to another device, proceed as follows:

1) Select the rows in the symbol table which are to be rewired to another device. 2) Select the new device for one of the selected symbols.

The wiring is only changed if all selected symbols (or their operands) can be rewired to the new device. If not, an error is displayed. Rewiring is only performed with the selected symbols or their operands. Other symbols or operands of the device remain unaffected.

Example

In the following example, the selected symbols are to be rewired from the device "PLCSim" to the device "PLCSim300".

Conclusion

If you only want to change the wiring of certain symbols to another device, you can do this manually in the symbol file.

If you want to change the wiring of all operands and symbols of one device to another device, use the function "Change the wiring of operands to another device". In this case, the operands not present in the symbol file, which are absolutely specified in the properties of the objects, are also included in the rewiring.

TIA Portal: Importing symbols from or exporting symbols to the Siemens TIA Portal

Importing symbols from an XML file generated by the TIA Portal

The variable table of the TIA Portal can be exported to an XML file. The symbols in this XML file can then be imported into PLC-Lab. The following steps are necessary:

  1. Open the PLC variables in the TIA project.
  2. Click the right mouse button to display the context menu. Select the menu item "Export file" in the context menu.

  3. Then the dialog "Export" of the TIA Portal appear. Select the export file on the dialog. Select a file with the tag ".XML ". Click the OK button to start the action.

  4. In PLC-Lab, select the device in the symbol table to which the imported symbols are to be assigned. In the example this is the device with the name "S71513". Then click on the icon for importing symbols.

  5. Now the dialog "import of symbols" shows the operand areas to be imported. You can now select the file with the symbols. Please note that only those operand ranges are listed which are supported by the set device.

  6. When you have started the action by clicking OK, a message appears indicating how many symbols have been imported. In addition, a log file is opened in which any import errors are recorded.

The imported symbols were inserted in the symbol table and assigned to the previously set device.

Exporting PLC-Lab symbols to an XML file

The Siemens TIA Portal can import symbols or variables from an XML file. To export the symbols from PLC-Lab to an XML file, proceed as follows:

  1. Select the device with the symbols you want to export to the XML file. Then click on the icon for exporting the symbols in the symbol table.

  2. The dialog "Export of symbols" appears, where you can select the operand areas of the device to be exported, as well as the file in which the symbols are to be written. Select a file with the tag ".XML ". If the file is intended for the TIA Portal.

  3. When the action was started and executed by clicking OK, a message window shows how many symbols were exported to the XML file.
  4. Now open the project in the Siemens TIA Portal and then the PLC variables. Via the right mouse button, you can display the context menu in the variables. Here you select the menu item "Import file".

  5. As a result, the "Import" dialog is displayed, in which you need to select the XML file previously generated by PLC-Lab. Click OK to start the import.

  6. After the import, the variables are available in the table of the TIA. Within the category "PLC variables" there is an independent entry with the name "Variable table from XML_".

Info

The import/export of PLC variables in the TIA portal can be used with all PLC families S7-300/400 and S7-1200/1500.

Simatic Manager: Importing symbols from or exporting symbols to the Siemens Simatic Manager

Importing symbols from an ASC file generated by the Simatic Manager

The Simatic Manager symbol table can be exported to an ASC file. The symbols in this ASC file can then be imported into PLC-Lab. The following steps are necessary:

  1. Open the symbol editor in the Simatic Manager project and choose "Table->Export" from the menu.
  2. In the "Export" dialog that appears, select "ASCII Format (.ASC)" as the file type and choose the file name and folder. Click the "Save" button to start the action.

  3. In PLC-Lab you first select the device to which you want to assign the symbols to be imported. In the example the device has the name "314PnDp". Then click the icon for importing symbols.

  4. As a result, the dialog "Import symbols" is displayed. Here you can select the operand types to be imported and the import file. The operand types depend on the device to which the symbols are assigned. Click the OK button to start the import action.

  5. After the import has been executed, a message shows how many symbols could be imported. Any errors are listed in a log file, which is displayed using a text editor.
  6. Now you can see the imported symbols in the symbol table; they have been assigned to the set device.

Exporting PLC-Lab symbols to an ASC file

The Siemens Simatic Manager can import symbols from an ASC file. To export the symbols from PLC-Lab to an ASC file, proceed as follows:

  1. Select the device with the symbols you want to export to the ASC file. Then click on the icon for exporting the symbols in the symbol table.

  2. The dialog "Export of symbols" appears, where you can select the operand areas of the device to be exported, as well as the file in which the symbols are to be written. Select a file with the suffix ".ASC".


  3. When the action was started and executed by clicking OK, a message window shows how many symbols were exported to the ASC file.
  4. Now open the project in the Siemens Simatic Manager and then the symbol editor. Then select the menu item "Table->Import". Via the appearing dialog "Import", you can select and open the ASC file previously generated by PLC-Lab. This starts the import process.
  5. Once the action has been executed, an information window appears with the statistics of the import.

  6. Now the symbols from the ASC file are in the symbol table of the Simatic Manager project.

Info

In the Simatic Manager, the length of the symbols is limited to 24 characters. A maximum of 80 characters is allowed for comments. When symbols are exported from PLC-Lab to an ASC file, symbols and comments are cut according to their maximum lengths.

WinSPS-S7 V6: Importing symbols from or exporting symbols to the WinSPS-S7 V6

Importing symbols from an ASC file generated by the WinSPS-S7 V6

The WinSPS-S7 symbol table can be exported to an ASC file. The symbols in this ASC file can then be imported into PLC-Lab. The following steps are necessary:

  1. Open the project folder and the project in WinSPS-S7 V6 and choose the menu item "File->Export->Export Symbol File as ASC/SDF File".
  2. In the "Select format" dialog that now appears, select "ASC format" as the format and confirm the dialog.
  3. In the next dialog, select the ASC file and the file storage location and confirm the dialog.
  4. In PLC-Lab you first select the device to which you want to assign the symbols to be imported. In the example the device has the name "314PnDp". Then click the icon for importing symbols.

  5. As a result, the dialog "Import symbols" is displayed. Here you can select the operand types to be imported and the import file. The operand types depend on the device to which the symbols are assigned. Click the OK button to start the import action.

  6. After the import has been executed, a message shows how many symbols could be imported. Any errors are listed in a log file, which is displayed using a text editor.
  7. Now you can see the imported symbols in the symbol table; they have been assigned to the set device.

Exporting PLC-Lab symbols to an ASC file

WinSPS-S7 V6 can import symbols from an ASC file. To export the symbols from PLC-Lab to an ASC file, proceed as follows:

  1. Select the device with the symbols you want to export to the ASC file. Then click on the icon for exporting the symbols in the symbol table.

  2. The dialog "Export of symbols" appears, where you can select the operand areas of the device to be exported, as well as the file in which the symbols are to be written. Select a file with the suffix ".ASC".


  3. When the action was started and executed by clicking OK, a message window shows how many symbols were exported to the ASC file.
  4. Open the project folder and the project in WinSPS-S7 V6 and choose the menu item "File->Import->Export Symbol File as ASC/SDF File". In the next dialog, enter the name of the new symbol file of the project.
  5. The next step is to select the ASC file generated by PLC-Lab.
  6. Now the symbols are available in the previously specified file. The symbol file can be selected as the active symbol file by double-clicking in the "Project contents" window.

Info

In the WinSPS-S7, the length of the symbols is limited to 24 characters. A maximum of 80 characters is allowed for comments. When symbols are exported from PLC-Lab to an ASC file, symbols and comments are cut according to their maximum lengths.

CodeSys V3: Importing symbols from or exporting symbols to the CodeSys V3

Import symbols from a CodeSys-file

The symbols of a global variable list from a CodeSys V3 project can be imported into PLC-Lab. The procedure is explained with the following example.

A CodeSys V3 project contains the following global variable list with the assignments of the variable names to the I/O hardware addresses

The variables to be imported into PLC-Lab are marked and copied to the clipboard.

Then any text editor is opened, e.g. the notepad-editor of Windows and the variables copied before are inserted there.

These are now saved in a file with the extension ".codesys". The extension must be correct so that the variables can be imported with PLC-Lab.

Info

Make sure that the extension is ".codesys". Some editors also add the extension with ".txt". If this is the case, this must be changed.

First select the device inside of PLC-Lab to which the symbols to be imported. In the example the Device has the designation "OpcUaCodeSys". Then the icon for the import of symbols is clicked.

As a result, the dialog "Import symbols" is displayed. Here you can select the operand types to be imported and the import file. The operand types depend on the Device to which the symbols are to be assigned. In the dialog shown in the following picture, the file previously created with the text editor was already selected.

The OK button starts the action and thus the import of the symbols. After completion, a message is displayed showing the number of imported symbols. Any errors are listed in a log file, which is displayed using a text editor.

Now the imported symbols can be seen within the symbol table, these were assigned to the set Device.

Export symbols into a Codesys-file

If you have defined symbols for inputs and outputs in PLC-Lab and want to use them in a CodeSys V3 project, proceed as follows:

  1. Select the device with the symbols you want to export to the codesys-file. Then click on the icon for exporting the symbols in the symbol table.
  2. The dialog "Export of symbols" appears, where you can select the operand areas of the device to be exported, as well as the file in which the symbols are to be written. Select a file with the suffix ".codesys".
  3. When the action was started and executed by clicking OK, a message window shows how many symbols were exported to the codesys file.
  4. The CodeSys file is an ordinary text file that can be opened with a text editor (e.g. the Windows notepad-editor). After opening, select the desired variables and copy them into a global variable list in the CodeSys V3 project.