First of all, we are going to take a look at the base station and make sure you can get it connected to your PLC.
Open a workspace and load the public system called “Production Line: Base station”.
Base system components
The system has some assemblies that we are going to take a look at.
The base assembly includes just the table where the rest of the components are placed.
The conveyor_1 to conveyor_3 assemblies are almost identical and they all include a little conveyor with a sensor and a DC motor. The motor is connected to a DC contactor in the control box and the conveyor. While the sensor is connected to the PLC.
Inside the control box we have the power supply, circuit breaker, safety relay, PLC and the contactors for the conveyor motors. We will take a closer look at some of these components during the course.
Finally, the assembly called HMI includes some pushbuttons, a selector and an emergency stop. The pushbuttons, their lights and the selector are connected to the PLC.
Connect to PLC
As mentioned before, inside the control assembly you will find the PLC. It has 16 digital inputs and outputs and 4 analog inputs and outputs. This PLC component uses OPCUA for communicating with real CPUs or SoftPLCs.
[If you don’t know how to connect to a PLC using OPCUA, take a look at these other courses that may be interesting for you][e]
In this stations just digital inputs and outputs are used, so you can take a look at the drawings, the port connections or the IO list below to understand how all components are connected to the PLC.
S01 Start button
H01 Start light
S02 Stop button
H02 Reset Light
S03 Reset button
S04 Manual selector
KM01 Conveyor 1 forward
S04 Automatic selector
KM02 Conveyor 2 forward
Emergency Circuit OK
KM03 Conveyor 3 forward
B01 Sensor conveyor 1
B02 Sensor conveyor 2
B03 Sensor conveyor 3
In order to transfer the digital inputs and outputs between Simumatik and the PLC we just need to define the specific variable names. By default, these variables are called digital_input_1, digital_input_2, digital_output_1, and digital_output_2.
Check connection: Green light
Before we continue to the next step, let’s create a project for your PLC. Define the necessary variables, set up the OPCUA communication and create a program in the language you prefer. Something very simple is enough to check the communication in both ways between the PLC and Simumatik, so let’s make the Green button light (S01) switch on when the button is pressed.
The example below shows the result when programming a simple network in LADDER language using Codesys.