Вы находитесь на странице: 1из 8

Technical Application Note

ePLC Connect for SiemensPLC: Step 7 code sample. April 15, 2014

Subject
ePLC Connect is an interface running on Adept ePLC robots or Adept SmartController EX. ePLC connect
allows an Allen Bradley or a Siemens PLC to connect to Adept robots. This note describes a simple
Siemens Step 7 program running a Pick & Place on an Adept Robot.

Applicable Products
- Works for ePLC Robots with eV+ 2.1 B45 or later
- Works for SmartController EX with eV+ 2.1 B45 or later

Notes and Procedures


Requirements:

The following items are required:

1. Adept SmartController with ePLC Connect license enabled OR Adept ePLC robots.
2. Siemens PLC CPU315 family
3. Step 7 v12 TIA Portal
4. Archive of the example S7_v12_PickPlace_Example.zip

Warning: This document is not a tutorial to program Siemens PLC, the reader must have some
background in programming Siemens PLC with Ladder logics. This example provides some information
on how to connect a Siemens PLC to an Adept Robot controller and proposes one way of moving the
robot through ePLC.

Load the example in step 7 and the PLC:

1. TIA Portal: Project>Retrieve, select S7_v12_PickPlace_Example.zap12. This will open the


example workspace as follow:
System function block to communicate with Adept robots
Application function block editable and used to run the pick & place
Memory allocated for the different structures and function blocks
Type definition, some provided with the Adept_RobotComm Function block, some created
for the Pick & Place application
Force and watch tables to display all the data necessary to run this application

2. Configure the hardware by double/clicking on Device Configuration under PLC_1 in the


workspace (Configuration of the IP address of the PLC, Type of hardware, IO definitions,
etc.)
3. Click right on the PLC_1 [CPU 315-2 PN/DP] in the workspace and compile the project
4. Download all the programs/data in the memory of the PLC Siemens. By clicking Download
to Device in the tool bar

Getting started: Connection between the PLC and the robot


1. Enable the connection between the PLC and the Adept Robot. This can be done through the
Connection Command variable table:
If we take the example of the following robot IP address 172.21.3.46, you need to:
- Set 172 in IP_Address[1]
- Set 21 in IP_Address[2]
- Set 3 in IP_Address[3]
- Set 46 in IP_Address[4]
- Sent the modified values in the PLC memory
- Set the bit: Enable Connection

2. Verify that the PLC is communicating with the robot by opening the Connection Status
Variable table:

The CONN variable should be true (indicates the communication has been established), and the
SR_DONE should blink indicating that the PLC and the robot exchanges data.
3. Ladder code to setup the communication between the PLC and the robot. This part of the code
is based on the ADEPT_RobotComm provided by Siemens, and can be seen by just double

clicking on the System Block OB1 (Main PLC Cycle)

- SendRcv input arguments ask for a pulse


- ComData provides the necessary information for the connection such as the IP address
- DataCommand corresponds to the robot commands to be sent to the Adept Robot
- DataStatus corresponds to the robot status sent back by the Adept Robot

Getting started: Power up the robot


1. Enable robot power. If the robot is not in error, the robot may power up right after the
connection is established. But more often, the robot will be in error when establish the
connection. The error needs to be reset. For that, you need to open the Robot Commands
and Robot Status variables tables. If the robot is in fault state, setting the cmd_reset will
clear this error and the robot will power up indicating a true in the cmd_high_power bit.
2. The auto power up after the reset is managed by the following Function block (called in OB1
function block):
Getting started: Teaching Pick and place position

1. Open the Pick&Place Example variable table

2. Push ESTOP button of the robot, move the robot to the desired pick position, set the
Pick.Teach bit, then reset it, the current location must appear in the Locations.Pick registers.
3. Place the robot in the place position, set Place.Teach and reset it. The place location must
appear in the Locations.Place registers
4. The Ladder functional block for teaching position is named Teach Position and is placed in the
OB1 system block:
Getting started: Set Speed/Acceleration/Deceleration/profiles
1. Open up the Robot Commands Variable table. Set the speed/acceleration/deceleration/profile
registers.

Getting started: Start the pick and place


1. Open up the Pick&Place Example Variable table. Set the StartCycle bit. The pick & place must
start

2. The Cycle must start.


3. Ladder function block for the Pick&Place application called in the OB1 system block
Reference Documentation

[1] Adept ePLC Connect User Guide (P/N: 11464-000 Rev B)


[2] SIMATIC FB "ADEPT_RobotComm" (Entry ID: 79100154)
[3] ADEPT Robot Control using a SIMATIC S7-300 Controller (Entry ID: 79100154)

Вам также может понравиться