Frequently Asked Question
Semca PLC Configuration Siemens
How to create PLC configurations for Siemens PLC’s
Introduction
This manual describes the process of creating a PLC configuration for a Siemens 1510SP series PLC with some analog and digital IO cards.
Siemens TIA Portal is used in this example.
This is not a manual for using Siemens TIA Portal or a how to learn about PLC programming.
We do not provide support and services in relation to PLC configurations. This document is only an introduction in how to create configuration for usage with Semca Automation software.
Other addressing layouts are technically possible! This is just a basic template to get you going!
How does Semca Automation connect to a PLC?
Semca Automation uses Modbus over TCP/IP to connect to the PLC. It reads the inputs and outputs, and writes to outputs. The PLC is being used like remote IO. Except for a watchdog function and some conversions.
Of course, you can also add your custom program to a PLC that is being used with Semca Automation. However, it is up to you to make sure that no undesired side effects occur. Such is an overloaded PLC, or simultaneous use of a port by Semca and the PLC.
How does the addressing work?
We map the logical addresses to Modbus addresses. This can be a bit confusing at first. But it is rather simple.
First, we declare a block of registers. A good start is to declare an array called ‘Read’ of 100 words, and an array called ‘Write’ of also 100 words. We name this data block ‘Registers’ as shown below.
Then we connect this data block to Modbus by using the MB_SERVER object. In this way, the data block is made available on Modbus.
Now it is time to connect the registers to the actual PLC IO. This will be explained into detail later in this guide. For an example see below.
The only thing left to do that will help you, is to create a list with all IO, and the Modbus addresses. In this list you note which IO is connected to which Modbus address.
This is a manual action which we strongly recommend.
Hardware configuration
Create a Device Configuration in Siemens TIA Portal, which matches your electrical drawings and the actual hardware. Siemens TIA Portal does not tolerate differences between the actual hardware and your Siemens TIA Portal project.
Add all expansion cards.
Make the correct settings for the potential groups!
An example is shown below.
We assume that the order of the expansion cards is
- Digital Inputs
- Digital Outputs
- Analog Inputs
- Analog Outputs
Network configuration
Select ‘PROFINET interface (X1)’ of the CPU unit.
In this example, the IP address of the PLC is 192.168.0.1 with a subnet mask of 255.255.255.0.
A router has been defined with address 192.168.0.15. This can also be a router which provides remote access to your setup.
Software configuration
Blocks
Create the following program blocks:
- Main [OB1]
- Analog_In
- Analog_Out
- Connection
- Digital_In
- Digital_Out
- Watchdog
In ‘Main’ you will run all other blocks.
In ‘Connection’ you will run the Modbus process as described in chapter 3.
In ‘Watchdog’ you can run a watchdog process as will be described in chapter 8.
The other blocks will be explained in the chapter 7.
Tags
It is advisable to create tag lists for AI, AQ, DI and DQ, in which you can name the specific IO points. This will improve readability and will aid you in debugging as well.
IO configuration
Digital In
In program block Digital_In, you can connect each digital input as shown below.
Analog In
In program block Analog_In, you can connect each analog input as shown below.
This will take care of a proper value conversion.
Digital Out
In program block Digital_Out, you can connect each digital output as shown below.
This includes an automatic shutoff whenever the watchdog is triggered.
Analog Out
In program block Analog_Out, you can connect each analog output as shown below.
This includes an automatic shutoff whenever the watchdog is triggered.
Watchdog
To create a proper watchdog function, you can add the following code to the Watchdog function block.