D65GB
A u t o - I D Te c h n i c a l G u i d e
  SR-X300/X100/2000/1000
        SR-PN1
SIEMENS S7-1500/1200/300 SERIES
        Connection Guide: PROFINET Communication
             This manual explains how to use PROFINET communication to
              connect to the code reader and the Siemens PLC via SR-PN1
                                                                                           Chapter
          Table of Contents                                                                   3       CONFIGURING SIEMENS PLC SETTINGS
                                                                                           * TIA Portal V.11 or later is required to configure PROFINET settings.
Chapter 1 EQUIPMENT USED
Chapter 2 CONNECTION METHODS
Chapter 3 CONFIGURING SIEMENS PLC SETTINGS                                                 1      Use TIA Portal to create a new project.
Chapter 4 CREATING AND TRANSMITTING LADDER PROGRAMMES                                      Start TIA Portal, and then click “Project view” in the lower left of
Chapter 5 EXECUTING LADDER PROGRAMMES AND MONITORING READING DATA                          the screen.
                                                                                           Click the “new project” button  to display the “Create a new project”
                                                                                           screen. Enter a project name, and then click “Create.”
Chapter
  1       EQUIPMENT USED                                                                   Double-click “Add new device” under the new project that has been
                                                                                           added to the “Project tree.”
Prepare the following equipment.                                                           On the “Add new device” screen, click the PLC that you will use, and
                                                                                           then click “OK.” (You can specify an arbitrary value for “Device name.”
CPU module                                   Code Reader                                   Here, we have used “PLC_1.”)
SR-PN1                                       Ethernet cable
                                             OP-87230 (2 m)
Control cable*1                              Power cable
                                             OP-88782 (2m)
                                                                                           2      Set an IP address on the PLC.
                                                                                           Open the “Online access” branch in the “Project tree,” and then click
                                                                                           the network card of the PC that the PLC is connected to.
*1 OP-88776(2m)      (SR-X300/X100)
   OP-88779(2m)      (SR-2000/1000)                                                        Double-click “Update accessible devices” to automatically scan for
                                                                                           and display the devices that can be accessed from the selected
                                                                                           network card.
Chapter
  2       CONNECTION METHODS                                                               * If a firewall is enabled, the scan may not be performed correctly. In this situation,
                                                                                              temporarily disable the firewall.
Overall connection diagram
Connect the PLC and the code reader as shown below.
                                          PN-SR1                      Code reader
                          PLC                                                                                                                      When the scan completes
                                                                                                                                                   successfully, the devices on
                                                                                                                                                   the network are displayed.
                  Ethernet cable                      Control cable
            Power cable       Signal Name Wire Colour
                                   24 V        Brown                    24 VDC
                                   0V              Blue                 power supply
                                                                                           Open the detected PLC, and then double-click “Online & diagnostics.”
                                                                                       2
Click “Assign IP address” under “Functions,” set the IP address and                                Double-click a PLC device from within the list of PLC devices.
subnet mask, and then click “Assign IP address.”                                                   Double-click “Devices & networks.”
* If the PLC has already been set, you may not be able to assign the IP address. In
  this situation, click “Reset to factory settings” to return the PLC to its factory default
  status, and then return to step 2 of this procedure.
 3      Register the GSDML file (definitions file for code reader
        PROFINET) for the code reader to TIA Portal.                                               In the “Hardware catalog” field, click “Other field devices,” “PROFINET IO,”
* The GSDML file is in the AutoID Network Navigator installation folder.                           “Sensors,” “KEYENCE CORPORATION,” “Keyence Code Readers,” and
                                                                                                   then check that SR-PN1 is selectable.
On the “Options” menu, click “Install general station description file
(GSD).”
Specify the folder that contains the GSDML file for the “Source path.”
Select the check box of the corresponding GSDML file, and then click
“Install.”
                                                                                                    4 Add SR-PN1 to the Network view.
                                                                                                   In the “Devices & networks” field, click the “Network view” tab, and
                                                                                                   then drag “SR-PN1” from the catalogue to this tab.
After the GSDML file is read, you will be prompted to restart, so save
the project, and then restart the setup software.
Click “Project view” in the lower left of the screen, and then click
“Open” on the “Project” menu.
Click on a project, and then click “Open.”
After the “Open existing project” screen is displayed, click a project,
and then click “Open.”
                                                                                               3
Click the green box in the upper left of the SR-PN1 to create a line,
and then extend this line to the green box in the lower left of the PLC.                        6     Set the PLC IP address.
                                                                                                Click the “Network view” tab, and then double-click the PLC image.
                                                                                                On the “General” tab, click “Profinet interface,” click “Ethernet addresses,”
                                                                                                and then set the IP address of the PLC.
This connects the SR-PN1 and the PLC.
                                                                                                7     Transmit the setting information to the PLC.
                                                                                                Click the “Network view” tab, right-click the PLC, point to “Compile,”
 5      Configure the code reader settings.                                                     and then click “Hardware and software (only changes)” to execute the
                                                                                                compilation.
On the “Network view” tab, click the SR-PN1 image.
In the “Device overview” window of the “Device view” tab, enter into                                           Right-click
the top of the table the Profinet device name that you set with AutoID                                            here.
Network Navigator.
Double-click the SR-PN1 image, click the “General” tab, click
“PROFINET interface,” click “Ethernet addresses,” and then set the IP
address of the SR-PN1.                                                                          After the compilation is finished, right-click the PLC, point to
* If you attempt to specify the IP address that belongs to the PLC that you will set            “Download to device,” and then click “Hardware and software (only
  later, the warning “The IP address is not unique within the subnet.” will be displayed.       changes)” to transmit the compiled programme to the PLC.
  Change the address of the PLC or SR.
* If the IP address that you set for the code reader on this screen is different from the
  IP address that you set with AutoID Network Navigator, the IP address will be forcibly                       Right-click
  changed to the one that you set here.                                                                           here.
                                                                                            4
On the “Extended download to device” screen, select the interface        Chapter
                                                                                   CREATING AND TRANSMITTING LADDER
that is connected to the PLC. Click the target PLC, and then click          4      PROGRAMMES
“Load.”
                                                                         This chapter explains how to transmit ladder programmes.
                                                                         (An example without handshaking is explained.)
                                                                         1      Set the PLC tags.
                                                                         To check the address of the PLC device assigned to the SR-PN1, on the
                                                                         “Network view” tab, click the SR-PN1, and then click the “Device view”
                                                                         tab.
                                                                         * For details on assigning functions to each module, see the SR-PN1 User's Manual.
                                                                         * The addresses are assigned to each module automatically (you can assign these
                                                                           addresses manually). The assignments shown in the image below are used in the
                                                                           explanation that follows.
If “Different modules” is displayed on the “Load preview” screen,
select “Accept all,” and then click “Load.”
                                                                                      Module names                   Process memory assignments
                                                                         Operation instruction Control Bits_1 is assigned to Q address 1.
                                                                         Set bit 0 of Operation instruction Control Bits_1 to “TRUE” to start
                                                                         code reader reading.
After the “Load results” screen is displayed, click “Finish.”
When PROFINET communication is established between the SR and            Read Complete is assigned to bit 0 of I address 1.
the PLC, the PLC ERROR LED turns off.                                    The data of the code read by the code reader is written starting from I
                                                                         address byte 42.
                                                                          Q address: output address (PLC → SR-PN1)
                                                                          I address: input address (PLC ← SR-PN1)
                                                                          Q address                                        15 14 13 12 11 10 9   8   7   6   5   4   3   2   1   0
                                                                              1       Operation instruction Control Bits
                                                                                                                      Read Request (starts reading)
                                                                          I address                                        15 14 13 12 11 10 9   8   7   6   5   4   3   2   1   0
                                                                              1            Completion Status Bits
                                                                                                                    Read Complete (reading complete)
                                                                             B42
                                                                             B43                 Result Data
                                                                             B44
                                                                                                                     Read Data (reading result data)
                                                                     5
                                                                                3
Register this address information to PLC tags.
Under “PLC tags,” double-click “Add new tag table.”                                    Compile and transmit the programme.
                                                                                Double-click “Devices & networks” in the “Project tree,” right-click the
                                                                                PLC, point to “Compile,” and then click “Hardware and software (only
                                                                                changes)” to execute the compilation.
                                                                                * You cannot compile in Online mode. Click    to switch to Offline mode.
                                                                                                 Right-click
                                                                                                    here.
Tag table_1 is added. Enter the arbitrary names of the data in the
“Name” column, the data types in the “Data type” column, and the
device addresses in the “Address” column.
You can download the Tag Description CSV file on the WEB
(barcodereader.com).
Please copy the CSV file data and paste Tag table.(Before copy and
paste, please fit the column between CSV file and your Tag table.)
                                                                                After the compilation is finished, right-click the PLC, point to
                                                                                “Download to device,” and then click “Hardware and software (only
                                                                                changes)” to transmit the compiled programme to the PLC.
                                                                                                 Right-click
                                                                                                    here.
To start the ladder programme, register “Start Ladder Bit” to the M1.0
address as well.
 2      Create the ladder programme.
Under “Program blocks,” double-click “Main [OB1]” to open the
programme block, and then enter the following ladder programme.
                                                                                On the “Extended download to device” screen, select the interface
                                                                                that is connected to the PLC. Click the target, and then click “Load.”
                                                                                * This screen may not be displayed.
Explanation
 When Start Ladder Bit is changed to “TRUE,” Read Request (the
 trigger ON instruction) is executed, which starts the reading operation.
                                                                            6
If “Different modules” is displayed on the “Load preview” screen,                             Chapter
                                                                                                        EXECUTING LADDER PROGRAMMES AND
select “Accept all,” and then click “Load.”                                                     5       MONITORING READING DATA
                                                                                              This chapter explains how to start SR reading through PROFINET
                                                                                              and how to check that the reading results are written to the data map.
                                                                                              1       Register devices to the Watch table.
                                                                                              Click “Watch and force tables,” and then double-click “Add new watch
                                                                                              table.”
                                                                                              In Watch table_1, enter the tag names registered to PLC tags in the
After the “Load results” screen is displayed, click “Finish.”                                 “Name” column. For each reading result (Result Data) entry, change
                                                                                              the value in the “Display format” column to “Character.” (When you
* If you select the “Start all” check box and click “Finish,” the ladder programme will
  start.                                                                                      write a name registered to PLC tags in the “Name” column, the data
                                                                                              is written to the other columns automatically. You can also copy data
                                                                                              from the Tag Table.)
  If the PROFINET communication doesn't succeed, please set the
  following and try again.
                                                                                              2       Switch to online mode and start monitoring.
                                                                                              Click               to switch to online mode.
                                                                                              On the “Online” menu, click “Monitor all.”
                                                                                          7
Click “RUN” on the CPU operator panel.
In the Watch table, right-click the value in the “Monitor value” column
for Start Ladder Bit, point to “Modify,” and then click “Modify to 1” to
start reading.
                                             Right-click
                                                here.
When the sample code is read, the data read is stored in the “Result
Data” area as shown below. Also, you can check whether reading is
complete by checking whether “Read Complete” has changed to
“TRUE.”
To complete reading without reading the code, use “Modify to 0” to
set “Start Ladder Bit” to “FALSE.”
Sample code
                             KEYENCE
                                                                           8
Copyright (c) 2022 KEYENCE CORPORATION. All rights reserved. 193355GB 2122-1 D65GB Printed in Japan