TPM
EasyPAC Application Guide
EasyPAC EPC-1000 Application Guide Version: V1.0 2011S30
Configure an HMI to communicate with an EasyPAC via MODBUS/TCP.
Part NO.: 81-00EPC10-010
1
TPM
EasyPAC Application Guide
Revision History Date
Revision
Description
2011/5/5
1.0
Document Creation
2011/9/1
1.1
Update MyConfig figures to the latest version.
2
TPM
EasyPAC Application Guide
© Copyright 2011 TPM The product, including the product itself, the accessories, the software, the manual and the software description in it, without the permission of TPM Inc. (“TPM”), is not allowed to be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language in any form or by any means, except the documentation kept by the purchaser for backup purposes. The names of products and corporations appearing in this manual may or may not be registered trademarks, and may or may not have copyrights of their respective companies. These names should be used only for identification or explanation, and to the owners’ benefit, should not be infringed without any intention. The product’s name and version number are both printed on the product itself. Released manual visions for each product design are represented by the digit before and after the period of the manual vision number. Manual updates are represented by the third digit in the manual vision number.
Trademark
MS-DOS and Windows 95/98/NT/2000/XP, Visual Studio, Visual C++, Visual BASIC are registered trademarks of Microsoft.
BCB (Borland C++ Builder) is registered trademark of Borland. MULTIPROG is registered trademark of KW software. Other product names mentioned herein are used for identification purposes only and may be trademarks and/or registered trademarks of their respective companies.
3
TPM
EasyPAC Application Guide
Electrical safely
To prevent electrical shock hazard, disconnect the power cable from the electrical outlet before relocating the system. When adding or removing devices to or from the system, ensure that the power cables for the devices are unplugged before the signal cables are connected. Disconnect all power cables from the existing system before you add a device. Before connecting or removing signal cables from motherboard, ensure that all power cables are unplugged. Seek professional assistance before using an adapter or extension card. These devices could interrupt the grounding circuit. Make sure that your power supply is set to the voltage available in your area. If the power supply is broken, contact a qualified service technician or your retailer.
Operational safely
Please carefully read all the manuals that came with the package, before installing the new device. Before use ensure all cables are correctly connected and the power cables are not damaged. If you detect and damage, contact the dealer immediately. To avoid short circuits, keep paper clips, screws, and staples away from connectors, slots, sockets and circuitry. Avoid dust, humidity, and temperature extremes. Do not place the product in any area where it may become wet. If you encounter technical problems with the product, contact a qualified service technician or the dealer.
4
TPM
EasyPAC Application Guide
Contents CONTENTS .................................................................................................................................................................................. 5 1. APPLICATION OVERVIEW ........................................................................................................................................................ 6 2. CONFIGURE PROCEDURES ...................................................................................................................................................... 7 2.1. CONFIGURE IP ADDRESS FOR PC ..................................................................................................................................................... 7 2.2. CONFIGURE EASYPAC IP ADDRESS THROUGH MYCONFIG .................................................................................................................... 7 2.3. CERMATE HMI ............................................................................................................................................................................ 9 2.3.1. Configure HMI Driver via Modbus/TCP Driver .................................................................................................... 9 2.3.2. Configure HMI Driver via TPM/EPC-1000 Driver ............................................................................................. 11 2.3.3. Communicate with EasyPAC via MODBUS/TCP Driver.................................................................................... 12 2.3.4. Communicate with EasyPAC via TPM/EPC-1000 Driver ................................................................................... 13 2.4. CREATE A NEW PROJECT WITH TPM TEMPLATE................................................................................................................................ 13 3. HMI SAMPLE VIA MODBUS/TCP DRIVER ............................................................................................................................... 14 3.1. DIGITAL INPUT / OUTPUT ............................................................................................................................................................. 14 3.2. SINGLE AXIS MOTION.................................................................................................................................................................. 14 3.3. GROUPED MOTION OPERATION .................................................................................................................................................... 15 4. HMI SAMPLE VIA TPM/EPC-1000 DRIVER ............................................................................................................................. 18 4.1. DIGITAL INPUT / OUTPUT ............................................................................................................................................................. 18 4.2. SINGLE AXIS MOTION.................................................................................................................................................................. 18 4.3. GROUPED MOTION OPERATION .................................................................................................................................................... 19 5. MULTIPROG EXPRESS PROGRAM .......................................................................................................................................... 22 5.1. POU........................................................................................................................................................................................ 22 5.2. VARIABLES LIST .......................................................................................................................................................................... 22 6. PROGRAM CONTROL HANDLES ............................................................................................................................................. 24 7. OPERATING SEQUENCE ......................................................................................................................................................... 25 8. PROGRAM ATTACHMENTS .................................................................................................................................................... 26 8.1. MULTIPROG EXPRESS ............................................................................................................................................................... 26 8.2. PM DESIGNER ........................................................................................................................................................................... 26
5
TPM
EasyPAC Application Guide
1. Application Overview This document is intended to guide users through the steps of configuring a Cermate HMI (Human-Machine Interface) as the MODBUS master communicating with EasyPAC as the slave. This application note was created with a PV series HMI with PM Designer 1.2.89 software. The EasyPAC has MODBUS/TCP slave version 11.219.0.1 and MULTIPROG Express 5.35. The sample HMI application sends motion commands to EasyPAC and read axis command position, encoder position and current velocity. It’s also sends DO command and gets DIO status back.
Figure 1-1: overview of the Start-Kit
Start-Kit component list: Controller
EasyPAC
HMI
Cermate PV Series – PV070-WAT
Hardware
16 DI / 16 DO, Motion Connector * 2, Test Module, Switch Hub
Software
MULTIPROG Express, PM Designer
6
TPM
EasyPAC Application Guide
2. Configure Procedures Before using of the EasyPAC Start-Kit, it is necessary to set the IP address for devices EasyPAC, HMI and PC. The recommended default IP addresses are EasyPAC: 192.168.1.100, HMI: 192.168.1.96 and PC: 192.168.1.101. The setting of each device is introduced in the following section.
2.1. Configure IP Address for PC 1. 2. 3. 4.
Click on the “Start” button and select “Control Panel”. Type “adapter” in the search box and double click on the “View network connections” under Network and Sharing Center. Right-click on the connection to be changed and click “Properties”. Select the “Networking” tab and click on the “Properties” of “Internet Protocol Version 4 (TCP/IPv4). Input the IP address 192.168.1.101 and click OK to finish the setting.
2.2. Configure EasyPAC IP Address through MyConfig 1.
Switch the rotary switch SW1 to position 1 and power on EasyPAC.
Figure 2-1: rotary switch setting
2.
Execute MyConfig to configure EasyPAC.
Figure 2-2: icon of the MyConfig.exe executable
3.
Login and the EasyPAC setup data will be loaded automatically.
Figure 2-3: login page 7
TPM
EasyPAC Application Guide
Figure 2-4: EasyPAC system information page
4. 5.
Setup EasyPAC IP address by key in the IP address and press “Save” button. The default IP address is 192.168.1.100. Configure parameters of Modbus and TCP at “Modbus Parameters” tab. The screenshot is as follows.
Figure 2-5: configure Modbus and TCP parameters 8
TPM
EasyPAC Application Guide
The default slave ID is 1 and default port is 502 of EasyPAC. The parameter values will be changed after the “Save Settings” button is pressed, but it will take effect after reboot.
2.3. Cermate HMI Configure the HMI IP address on the panel as shown in the figure below.
Figure 2-6: the configuration page of the Cermate HMI
2.3.1. Configure HMI Driver via Modbus/TCP Driver 1. 2. 3.
Double click on the “Link1” and select “Direct Link (Ethernet)” as “Link Type”. Select “Modicon Corp.” and “ModBus Device/Slave (TCP/IP)” as “Device/Server”. Select “Ethernet1” as “Link Port”.
9
TPM
EasyPAC Application Guide
Figure 2-7: configure the link properties
4.
Configure parameters in the tab “Parameter”.
Figure 2-8: link parameters
5.
Configure the parameter as the configuration in EasyPAC by using MyConfig. Cermate HMI
EasyPAC
IP Address
PAC Info → IP Address
Port
Modbus parameters → TCP Parameters → Port
Node Address
Modbus parameters → Slave ID 10
TPM
EasyPAC Application Guide
2.3.2. Configure HMI Driver via TPM/EPC-1000 Driver 1. 2. 3.
Double Click Link1, and select “Direct Link (Ethernet)” as “Link Type”. Select “TPM” and “EPC-1000” as “Device/Server”. Select “Ethernet1” as “Link Port”.
Figure 2-9: configure the link properties
4.
Configure parameters in the tab “Parameter”.
Figure 2-10: link parameters
5.
Configure the parameter as the configuration in EasyPAC by using MyConfig.
11
TPM
EasyPAC Application Guide
Cermate HMI
EasyPAC
IP Address
PAC Info → IP Address
Port
Modbus parameters → TCP Parameters → Port
Node Address
Modbus parameters → Slave ID
2.3.3. Communicate with EasyPAC via MODBUS/TCP Driver In MULTIPROG Express, the new project template including globe I/O groups and drivers allows EasyPAC to respond to the incoming ModBus messages. The following table shows the Modbus memory map and how it relates to the global variables in MULTIPROG Express. Users also can use “MyDataCheck” to convert memory addresses between MULTIPROG and ModBus. Note that function code 01 and 03 return data sent to EasyPAC from the master and do not reflect data from the Global Variables in application program. The Modbus data memory is copied to the Global Variables at the task update rate. Modbus coil 0 equates to the MULTIPROG Express address at %QX0.0, coil 1543 equates to the address at %QX192.7, coil 1544 equates to the address at %MX3.0.0, coil 9735 equates to the address at %MX3.1023.7. 9735 coils are available. Discrete input 0 equates to the address at %IX0.0, discrete input 1543 equates to the address at %IX192.7, discrete input 1544 equates to the address at %MX3.2048.0, discrete input 9735 equates to the address at %MX3.3071.7. 9735 discrete inputs are available. Holding register 0 equates to the address at %QW193, holding register 127 equates to the address at %QW447, holding register 128 equates to the address at %MW3.1024, holding register 639 equates to the address at %MW3.2046. 639 holding registers are available. Input register 0 equates to the address at %IW193, input register 127 equates to the address at %IW447, input register 128 equates to the address at %MW3.3072, input register 639 equates to the address at %MW3.4094. 639 input registers are available. As shown in the table below, the physical input and output memory is in a different location even though they have the same numerical addressing. MULTIPROG Memory Address Type
Begin
Access Tag
End
Access Tag
Begin
End
1
%IB 0
%IX 0.0
%IB 0
%IX 0.7
0(BOOL)
7(BOOL)
192
%IB 1
%IX 1.0
%IB 192
%IX 192.7
8(BOOL)
1543(BOOL)
AI
256
%IB 193
%IW 193
%IB 448
%IW 447
0(WORD)
127(WORD)
Y(Local DO)
1
%QB 0
%QX 0.0
%QB 0
%QX 0.7
0(BOOL)
7(BOOL)
192
%QB 1
%QX 1.0
%QB 192
%QX 192.7
8(BOOL)
1543(BOOL)
AO
256
%QB 193
%QW 193
%QB 448
%QW 447
0(WORD)
127(WORD)
MB(Coil)
1024
%MB 3.0
%MB 3.1023
1544(BOOL)
9735(BOOL)
1024
%MB 3.1024
%MB 3.2047
128(WORD)
639(WORD)
MB(Discrete Input)
1024
%MB 3.2048
%MB 3.3071
1544(BOOL)
9735(BOOL)
MB(Input Register)
1024
%MB 3.3072
%MB 3.4095
128(WORD)
639(WORD)
X(Local DI) INPUT(%I)
ModBus Memory Address
Length(BYTE)
X
OUTPUT(%Q) Y
449
449
MB(Holding Register) VARCONF(%M)
4096
12
TPM
EasyPAC Application Guide
2.3.4. Communicate with EasyPAC via TPM/EPC-1000 Driver The user can use TPM/EPC-1000 driver to design HMI page. The following table shows the MULTIPROG memory map. Users can directly access data by using MULTIPROG memory access tag without converters. MULTIPROG Memory Address Type
Length(BYTE) Begin
End
1
%IX 0.0
%IX 0.7
192
%IX 1.0
%IX 192.7
AI
256
%IW 193
%IW 447
Y(Local DO)
1
%QX 0.0
%QX 0.7
192
%QX 1.0
%QX 192.7
AO
256
%QW 193
%QW 447
Bit R/W
1024
%MX3.0.0
%MX3.1023.7
1024
%MW3.1024
%MW3.2047
Bit R
1024
%MX3.2048.0
%MX3.3071.7
Word/Dword R
1024
%MW3.3072
%MW3.4095
X(Local DI) INPUT(%I)
OUTPUT(%Q)
X
Y
449
449
Word/Dword R/W VARCONF(%M)
4096
2.4. Create a New Project with TPM Template Select “TPM Template” as “New Project” to create a new project with I/O drivers and allocated memory to read and write data in the controller. These memory areas are generic, i.e., no variables are automatically created beside default axes configure data and POU. Users can decide on the arrangement and type of data to populate within the communications memory region. A word coming from the HMI will be mapped from register 40001 in Cermate to %QW193 via MODBUS driver, or directly using %QW193 via TPM/EPC-1000 driver. Users should verify the data type used for data transfer. Examples are provided and explained in the sample program given later in this document.
13
TPM
EasyPAC Application Guide
3. HMI Sample via MODBUS/TCP Driver The sample application attached with this document is intended to implement a basic operation interface.
3.1. Digital Input / Output Users can use the “Bit Button” to read and write Coil and use the “Bit Lamp” to read discrete inputs. For example, the first bit button in the sample HMI project is mapped to the first bit on the DO module with MNet IP 0. The first bit lamp is mapped to the first bit on the DI module. Double click the object, the configuration can be seen as shown in the following figure.
Figure 3-1: Bit Button and Bit Lamp properties dialog box
3.2. Single Axis Motion Input
Distance / Position
Velocity
Relative Move
Absolute Move
Stop 14
TPM
EasyPAC Application Guide
Output
Command Position
Encoder Position
Current Velocity Users can use the “Numeric Entry” to read and write the holding register and use the “Numeric Display” to read the input register. For example, the AXIS_01’s “Distance” in the sample HMI project is mapped to MULTIPROG memory address %MD 3.1024. The AXIS_01’s “Command Position” is directly mapped to the Modbus input register 640. Double click the object, the configuration can be seen as shown in the following figure.
Figure 3-2: Numeric Entry and Numeric Display properties dialog box
3.3. Grouped Motion Operation Input Distance / Position Velocity Relative Move Absolute Move Stop
15
TPM
EasyPAC Application Guide
Output Command Position Encoder Position Current Velocity The user interfaces on the HMI screen are as shown below.
Figure 3-3: the main screen
Figure 3-4: digital input / output
16
TPM
EasyPAC Application Guide
Figure 3-5: single axis motion
Figure 3-6: grouped axes motion
17
TPM
EasyPAC Application Guide
4. HMI Sample via TPM/EPC-1000 Driver The sample application attached with this document is intended to implement a basic operation interface.
4.1. Digital Input / Output Users can use the “Bit Button” to read and write Coil and use the “Bit Lamp” to read discrete inputs. For example, the first bit button in the sample HMI project is mapped to the first bit on the DO module with MNet IP 0. The first bit lamp is mapped to the first bit on the DI module. Double click the object, the configuration can be seen as shown in the following figure.
Figure 4-1: Bit Button and Bit Lamp properties dialog box
4.2. Single Axis Motion Input
Distance / Position
Velocity
Relative Move
Absolute Move
Stop 18
TPM
EasyPAC Application Guide
Output
Command Position
Encoder Position
Current Velocity Users can use the “Numeric Entry” to read and write MULTIPROG memory address, and use the “Numeric Display” to read the axis data. For example, the AXIS_01’s “Distance” in the sample HMI project is using %MD 3.1024. The AXIS_01’s “Command Position” is using AXIS_01.1. Double click the object, the configuration can be seen as shown in the following figure.
Figure 4-2: Numeric Entry and Numeric Display properties dialog box
4.3. Grouped Motion Operation Input Distance / Position Velocity Relative Move Absolute Move Stop Output 19
TPM
EasyPAC Application Guide
Command Position Encoder Position Current Velocity
The user interfaces on the HMI screen are as shown below.
Figure 4-3: the main screen
Figure 4-4: digital input / output
20
TPM
EasyPAC Application Guide
Figure 4-5: single axis motion
Figure 4-6: grouped axes motion
21
TPM
EasyPAC Application Guide
5. MULTIPROG Express Program The sample application attached with this document is intended to implement a basic operation.
5.1. POU
INIT_AXES This is created by TPM template automatically. Users are not necessary to modify it. When variable “AXES_READY” becomes true, all the axes in the system are ready to go.
INIT This is a sample that how to initialize an axis as PLCOpen motion control system.
SingleMove This is a sample shows how to move a single axis as PLCOpen motion control system.
GroupMove This is a sample shows how to move grouped axes as PLCOpen motion control system.
5.2. Variables List Modbus
MULTIPROG
one-base Address
Address
Variable Name
Description
Distance_1
40129
%MD 3.1024
AXIS_01 Move Distance and Position
Distance_2
40131
%MD 3.1028
AXIS_32 Move Distance and Position
MaxVel_1
40135
%MD 3.1036
AXIS_01 MaxVelocity
MaxVel_2
40137
%MD 3.1040
AXIS_32 MaxVelocity
R_MOVE_X
01548
%MX 3.0.3
AXIS_01 Relative Move
R_MOVE_Y
01549
%MX 3.0.4
AXIS_32 Relative Move
A_MOVE_X
01553
%MX 3.1.0
AXIS_01 Absolute Move
A_MOVE_Y
01554
%MX 3.1.1
AXIS_32 Absolute Move
STOP_X
01550
%MX 3.0.5
AXIS_01 Stop
STOP_Y
01551
%MX 3.0.6
AXIS_32 Stop
MaxVel
40133
%MD 3.1032
Grouped Motion MaxVelocity
G_R_MOVE
01545
%MX 3.0.0
Grouped Motion Relative Move
G_Path_MOVE
01546
%MX 3.0.1
Grouped Motion Path Move 22
TPM
EasyPAC Application Guide
Modbus
MULTIPROG
one-base Address
Address
Variable Name
Description
G_STOP
01552
%MX 3.0.7
Grouped Stop
G_A_MOVE
01555
%MX 3.1.2
Grouped Absolute Move
AXIS_01 Command Position
30641
AXIS_01.1
AXIS_01 Encoder Position
30643
AXIS_01.2
AXIS_01 Current Velocity
30645
AXIS_01.3
AXIS_32 Command Position
30920
AXIS_32.1
AXIS_32 Encoder Position
30922
AXIS_32.2
AXIS_32 Current Velocity
30924
AXIS_32.3
Note that Cermate HMI MODBUS/TCP driver follows one-base MODBUS protocol.
23
TPM
EasyPAC Application Guide
6. Program Control Handles
Using MODBUS driver, please open the file of “TCP_7_20110223.pm2” by using PM Designer, compile and download to the HMI.
Using TPM/EPC-1000 driver, open the file of “TPM_7_20110223.pm2” by using PM Designer, compile and download to the HMI.
Open the file of “GA_SK_20110223.mwe” by using MULTIPROG Express 5.35, compile and download to EasyPAC. Click “Warm Start”, and set MULTIPROG Express in debug mode.
The application is ready for use.
24
TPM
EasyPAC Application Guide
7. Operating Sequence The user can operate MNet DIO module at the page of “Digital Input / Output”. Bit Lamp is to monitor DI, and Bit Button is to control DO. The page of “Single Axis Motion” is for operating single axis motion, and “Grouped Axes Motion” is for grouped axes motion. The user can specify the distance and velocity, and execute absolute and relative motion, path moving in grouped motion. Also can monitor the axes command position, encoder position, and current velocity.
25
TPM
EasyPAC Application Guide
8. Program Attachments 8.1. MULTIPROG Express
8.2. PM Designer
26