Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Siemens PLC Driver Instructions for EasyPLC v.

5:

With Siemens_PLC driver for EasyPLC you will be able to connect your PC where is running EasyPLC
software with a physical (or simulated, see Appendix section) Siemens PLC via Ethernet protocol.
Siemens_PLC driver for EasyPLC uses the free open-source code from Sharp7
(http://snap7.sourceforge.net/sharp7.html)

Compatibility

S7 300 / S7 400 / WinAC / S7 1200 / S7 1500 PLCs

S7 300/400/WinAC

No special consideration has to be made about these CPU, the driver has full access to these PLC either directly
(with the integrated interface 3xx-PN or 4xx-PN) or via the CPX43 interface.

S7 1200/1500

To access a DB in S71500 some additional setting plc-side are needed.


1. Only global DBs can be accessed.
2. The optimized block access must be turned off.
3. The access level must be “full” and the “connection mechanism” must allow
GET/PUT.
Let’s see these settings in TIA Portal V12

DB property

Select the DB in the left pane under “Program blocks” and press Alt-Enter (or in the
contextual menu select “Properties…”)
Uncheck Optimized block access, by default it’s checked.

Protection
Select the CPU project in the left pane and press Alt-Enter (or in the contextual menu
select “Properties…”).
In the item Protection, select “Full access” and Check “Permit access with PUT/GET ….” as in figure.

Instructions

1. Select Hardware -> Add new Hardware

2. In the Add New I/O Device window select the Siemens Drivers Category, open the mode and make click on
the Siemens_PLC, then press OK button.
3. Make click on the Hardware -> I/O Devices -> SimaticS7_PLCSIM Driver, and make click on the Configure
Button.

4. A new Window appears showing the Siemens_PLC Driver configuration Window, here you must to set up the
following Siemens PLC parameters:
Note:

In some configurations is neccesary to map the Digital I/O Start bytes to 2, due 0 and 1 address are
reserved. If you experience problems and can not communicate, set in TIA PORTAL the start address to
I/O to 2 for digital I/O.

Communication Parameters

Connects the client to the hardware at (IP, Rack, Slot) Coordinates.


IP Address: PLC/Equipment IPV4 Address ex. “192.168.1.12” (or 127.0.0.1) if is used in simulated mode.
Rack: PLC Rack number (see below)
Slot: PLC Slot number (see below)

Rack and Slot


In addition to the IP Address, that we all understand, there are two other parameters that index the unit:
Rack (0..7) and Slot (1..31) that you find into the hardware configuration of your project, for a physical
component, or into the Station Configuration manager for WinAC.
There is however some special cases for which those values are fixed or can work with a default as you can
see in the next table.

S7 Inputs/EasyPLC Driver Outputs

Take note to this important issue: the PLC inputs will be the EasyPLC outputs and the PLC outputs
will be the EasyPLC inputs, this is due the PLC inputs are entities to be written by the EasyPLC Driver and
the PLC outputs are entities to be read by the EasyPLC Diver. This is common for all the I/O analog and
digital.
Start Byte: sets the starting byte to write in the PLC digital inputs. Take note that you can’t set a physical
(real) address, due the PLC will read the image of the real inputs and cannot be written by the EasyPLC
Driver. You must to configure an address do not used by the real inputs card of PLC.

Byte Length: sets the number of bytes to be written (1 Byte -> 8 digital inputs).

For example, in this project:

The PLC uses one digital input card of 16 inputs, addressed by I0.0 to I1.7. Then you must not use byte 0
and 1 because are reserved to physical inputs.
For example, you can use byte 9, and use a length of 3 bytes in order to use (write) 24 digital outputs:
Inputs I0.0 to I1.7 are used by the PLC to read physical inputs

Inputs I9.0 to I11.7 can be used by the driver to write in simulated digital inputs

S7 Outputs/EasyPLC Driver Inputs

Here you must use the real physical address, due the EasyPLC Driver will use to read the PLC outputs

Start Byte: sets the starting byte to read for the PLC digital outputs.
Byte Length: sets the number of bytes to be read (1 Byte -> 8 digital outputs).

Data Block for Analogic Inputs


Similar to digital inputs, the analog inputs are written by the EasyPLC Driver in the PLC, to do it, is used
one PLC DB, this DB must to be configured as REAL type.

DB number to write: sets here the DB number used by EasyPLC driver for write the analog inputs values.
DB Length: set the number elements this DB has.

Data Block for Analogic Outputs

Similar to digital outputs, the analog outputs are written by the PLC and read by the EasyPLC Driver, to do
it, is used one PLC DB, this DB must to be configured as REAL type.

DB number to write: sets here the DB number used by PLC to write the analogic outputs values and be read
by the EasyPLC driver.
DB Length: set the number elements this DB has.

In the previous example the inputs bytes E9.0 to E9.7, E10.0 to E10.7 and E11.0 to E11.7 are linked
between the PLC and EasyPLC. In total 24 Inputs.
The output bytes O0.0 to O0.7 and O1.0 to O1.7 are linked between PLC and EasyPLC. In total 16 Outputs.

Take note how the 24 S7 Inputs are Outputs in EasyPLC, and the 16 Outputs are inputs in EasyPLC.
The Data Blocks works different because are read by elements. In the example we are going to write 4
analogic inputs (DB1) and read 4 analogic outputs (DB2).
5. Press OK button when to save the configuration.

Then you will see the digital and analogic I/O number configured:

You can Press then Test Mode Button to start test the digital and analog I/O reading and writing:

Press Exit from Test Mode Button to finish the test mode.

Now you will be ready to use Siemens PLC digital/analog I/O in your EasyPLC programs.
APPENDIX

Using Siemens_PLC driver in simulated mode (without physical PLC)

Follow the same procedure explained in this manual, but once your project will be finished compile and transfer
to Siemens PLCSIM (PLSIM v.5.4 or PLCSIM v12/13/14)

You need to use the free tool NetToPLCSim, add a new Server, configure your local IP Address as 127.0.0.1
and the PLCSIM address, start the server and you will be ready to connect Simatic S7/TIA Portal with
EasyPLC Siemens_PLC driver.

www.nirtec.com
Valencia – Spain

You might also like