CANopen Slave User Manual for HMI
CANopen Slave User Manual for HMI
UMCOPA
Rev 1.0, 07/2011
GRAPHIC SYMBOLS
INFORMATION, it helps users with more details about the topic and failure to
follow may lead to unpredictable results.
Protective Earth
DC Supply
PREFACE
2
TABLE OF CONTENTS
1. OVERVIEW....................................................................................................... 4
1.1 INTRODUCTION .................................................................................................. 4
1.2 COMMUNICATION .............................................................................................. 5
2. SPECIFICATIONS............................................................................................ 6
4. WIRING............................................................................................................ 10
9. CONVERTER .................................................................................................. 37
3
1. OVERVIEW
1.1 Introduction
HMI supports CANopen communication via optional extension card. Supported models are
HMI 450, HMI 750, HMI 1050 & HMI 1550
EDS file will be supplied for the slave (4 TxPDO, 4 RxPDO with 4 variables in each PDO,
UInt16 type)
4
1.2 Communication
5
2. SPECIFICATIONS
Item Description
COM port number in HMI COM3 (for network option, extension card)
TxPDO 32 Nos.
RxPDO 32 Nos.
PDO mapping customization Network configuration tool at Master
Transmission method CAN
EDS file name EDS_BC_COP_EXAMPLE_1
Vendor ID 0x1B h
Product ID 0x66 h
6
COM3 is dedicated for extension card. It is clearly marked on rear side of HMI.
Extension card is supported in HMI 450, HMI 750, HMI 1050 & HMI 1550
COM3,
Extensio
n card
7
Fig: Typical HMI 750 with CANopen module
3. Remove 5 mm hex screws (2 nos.) for COM1 port using tool 5mm Hex nut
screwdriver
4. Remove COM1 cover. At this time, COM1 enclosure will be opened. Note down the
direction of enclosure carefully as it need to fit in same direction later
6. Now, insert network extension card into main board and make sure it is properly
inserted with in guider pins
8
7. Fix COM1 cover properly and make sure that PCB is locked with in locking holes
9. Fix network module cover. Remember, these covers are different for different
network extension modules. You will receive specific network module cover along
with network extension card
10. Fix 5 mm hex screws (2 nos.) for network extension card. If required gently push
network extension card downside to allow screws go inside properly
11. Fix M2 X 4 mm screws (2 nos.) on network module cover. If required gently push
network extension card downside to allow screws go inside properly
9
4. WIRING
5 CAN_SHLD
6 -
7 CAN_H CAN High
8 -
9 -
Shield CAN_SHIELD
10
Fig: CAN network connection scheme
11
5. QUICK SETUP
12
Tips
Steps
1. First decide how much data to be exchanged between Master and Slave.
2. In HMI configuration, create required Read blocks (Maser to Slave) first, then, write
blocks (Slave to Master). Read blocks means RxPDO’s, Write blocks means
TxPDO’s
3. Open Tag data base from Project explorer. It is possible to modify blocks to Tag
names at Tag database here. Once block name is changed to Tag name, never attempt
to delete the CANopen setup from connection as you will loose all the Tag names.
4. Link tags with Objects like Label, Text box etc... Once Tag is linked with objects,
never attempt to delete CANopen configuration from Connections.
6. Switch OFF power supply to HMI. Press your finger on HMI active screen area and
then switch ON the power. On Control center, press “Run”.
7. Now, in CANopen master software, enter configuration mode, then, scan the devices.
CANopen Slave should be detected by the Master device
13
6. OBJECT ENTRIES
Note: Maximum size of each PDO is 8 bytes. Number of mapped objects depends on data
type for the variables used
14
6.2 TxPDO parameter and mapping details
Note: Maximum size of each PDO is 8 bytes. Number of mapped objects depends on data
type for the variables used
15
6.3 Manufacturer specific objects
16
6.3.2 Example2, 32 TxPDO and 32 RxPDO mapping
RxPDO mapping
17
TxPDO mapping
18
7. PLC CONFIGURATION
In this case the Beckhoff PLC has been used as a Master on the CANopen network. To
configure the PLC and CANopen network “TwinCAT” software is used. HMI will be
configured as CANopen slave.
7.1 Setup
3. Open TwinCAT software. Right click icon at taskbar and click system manager.
19
4. Create a new project
20
Select the Ethernet device you wish to use for EtherCAT and press “Install”. Both
“Compatible” and “Incompatible” devices may be used. They may differ in performance.
Note: If you are using a compatible network card the IP-traffic in that sub-network can
be blocked and you will be not able to access Internet when TwinCAT is in running
mode or free run mode
21
7.2 Scan for CANopen slave in network
4. Select the Ethernet interface you wish to use and click “OK”.
22
5. Select “Yes” when asked if you wish to scan for boxes. Boxes in this case refer to
slaves.
Click “Yes”
23
Click “OK”
24
If you cannot find slave device, then, there might be problems with Slave
configuration in HMI or HMI is not running or HMI is not connected properly to
Master on CANopen or problems with installation of EtherCAT driver for Ethernet
network card in specific PC.
25
7.3 COB ID
Object PDO
COB-ID Type Size
Index Name
26
1402h RxPDO3 1024 + Node ID Output 8 bytes
In this example, TwinCAT automatically allocated COB-ID for first 4 PDO. Some
Master software packages allocate COB-ID for only first two PDO automatically. If more
PDO’s are required, the COB-IDs need to be allocated manually. Please refer documentation
of Master configuration tool for more information about COB ID to be used
27
28
7.4 Configuration of process data
1. Select Master and click “Process Data”. Check size of Outputs and Inputs. It should
be same as configuration set in HMI device.
2. If Slave configuration is not same at HMI and TwinCAT, please try to download
HMI sample application (Analog) from PC to HMI with correct CANopen slave
configuration. Switch OFF power supply to HMI. Switch ON power supply to HMI.
Then, at control center, press “Run”. Now, CANopen slave is active in network.
Create new project in TwinCAT and repeat all the above procedure
3. Alternatively, then, click “Load PDO info. From device” and wait (normally up to 1
minute depending on network connections) for a while to load configuration from
device.
4. If still there are problems, you may need to set Mail box settings and Input/Output
settings manually and then click “Reload” icon to use new configurations.
Please check TwinCAT documentation for more information about this setup
29
5. Select “Yes” when asked if you wish to activate free run and go into operational
mode.
6. TwinCAT is now running and I/O data to and from the CANopen slave can be
manually monitored
7. If you wish to write value from Master to Slave, Select RxPDO in TwinCAT, select
variable, select Tab- Online, click “Write” and enter value. Then, you should be able
to monitor this value in Slave in following screen
8. If you wish to write value from Slave to Master, write value in following screen at
HMI and then it should show value at TxPDO in TwinCAT software as below
30
Fig: HMI screen in Run time
31
8. HMI CONFIGURATION
3. Select Type= Other Networks. Select Protocol = CANopen, then click apply icon
to save this setup
32
Baud rate: By default, 500 kbps. Others allowed are 10, 20, 50, 100, 125, 250, 500,
800 Kbps, 1 Mbps and auto baud rate detection
In given example, 4 nos. TxPDO and 4 nos. RxPDO, with length=1, it means, 1
variable (UInt16 type) in each PDO is used
33
Fig: Variables in RxPDO are linked with Blocks in HMI configuration in given
example
34
Fig: Variables in TxPDO are linked with Blocks in HMI configuration in given
example
7. Make sure that all the required blocks are entered in HMI slave configuration screen
in HMI editing software. Then, click “OK” to finish block configuration
8. In project explorer, double click “Tags” and check all the network tags. If required, it
is possible to modify Tag names here. Once tag names are modified and linked with
objects, do not attempt to modify configuration of blocks again at connections in
Project explorer. Before modification of tag names in tag data base, make sure block
settings are completely finished at Connections
35
After application download to HMI, it is a must to recycle power to HMI.
Switch OFF power supply to HMI and switch ON power supply to HMI. Then only
networking application works properly. At power on, it might show message
“Extension card fail” in HMI. Press “OK”. If tags are linked with text boxes, it may
show “Error” while reading data from Master to Slave. Once Master is started,
communication will be established with slave and “Error” message disappears in
objects and show real time data
36
9. CONVERTER
Click button
37
Name: Define name for this converter function
Engineering Low: Define user display range low for the process value
Engineering High: Define user display range high for process value
Click button.
38
Fig: Expression link to the blocks
Select the Required expression for the blocks. Click “OK” alternatively, if user attempt to
select expression for another block, it will automatically link earlier block with selected
expression properly
39
Click button to close Conversion configuration screen
10. EXAMPLES
40
Fig: CANopen slave tags in HMI database
Please download above setup from PC to HMI. Restart HMI. Then, open TwinCAT, scan the
devices
41
Fig: PLC Control
42
43
Fig: Variable in TxPDO1 linked with PLC tag -- Main.Tag101
Scan devices in TwinCAT software and link variables at TxPDO and RxPDO with PLC tags
44
Read (Master to Slave) - RxPDO
Fig: 4 variables read from Master to Slave, label Tag binding with Block, design time
45
Fig: HMI in Run time
Fig: Write from Slave to Master, NumberUpDown, Tag binding with Block, design time
46
Fig: HMI in Run time
47
10.1.2 4 PDO Read/Write (4 variables, Uint16 type in each PDO)
PLC address HMI Length Data type HMI tag HMI Description
block name IO
address type
Tag1 (RxPDO) Block1 4 UInt16 Block1_0 Read Master to
to Slave
Block1_3
Tag2 (RxPDO) Block2 4 UInt16 Block2_0 Read Master to
to Slave
Block2_3
Tag3 (RxPDO) Block3 4 UInt16 Block3_0 Read Master to
to Slave
Block3_3
Tag4 (RxPDO) Block4 4 UInt16 Block4_0 Read Master to
to Slave
Block4_3
Tag101 (TxPDO1) Block5 4 UInt16 Block5_0 Write Slave to
to Master
Block5_3
Tag102 (TxPDO2) Block6 4 UInt16 Block6_0 Write Slave to
to Master
Block6_3
Tag103 (TxPDO3) Block7 4 UInt16 Block7_0 Write Slave to
to Master
Block7_3
Tag104 (TxPDO4) Block8 4 UInt16 Block8_0 Write Slave to
to Master
Block8_3
48
Fig: CANopen slave block configuration in HMI
Please download above setup from PC to HMI. Restart HMI. Then, open TwinCAT, scan the
devices
49
Fig: PLC Control
50
51
Fig: Variable in TxPDO1 linked with PLC tag -- Main.Tag101
Similarly, link all other tags between PLC and TxPDO’s
52
Similarly, link all other tags between PLC and TxPDO’s
SDO entries
If you wish to use more than one variable in each PDO, then, it required to enter SDO
configuration manually as below
53
54
RxPDO1 configuration settings
Note: Please follow the same sequence as above in TwinCAT software otherwise you may
get error in communication
RxPDO1, Reset
RxPDO1, VarIn-0
55
Object: 2001, Sub index: 01, Data type = 10 (Uint16)
RxPDO1, VarIn-1
RxPDO1, VarIn-2
RxPDO1, VarIn-3
56
Object: 2001, Sub index: 04, Data type = 10 (Uint16)
57
RxPDO4 configuration settings
58
59
TxPDO1 configuration settings
60
TxPDO3 configuration settings
61
Read (Master to Slave) - RxPDO
Fig: 4 variables read from Master to Slave, label Tag binding with Block, design time
62
Fig: HMI in Run time
63
Write (Slave to Master) – TxPDO
Fig: Write from Slave to Master, NumberUpDown, Tag binding with Block, design time
64
Fig: Read values at PLC in Run time
65
10.1.3 16 bits Read, 16 bits write
66
Fig: TxPDO linked with PLC tag -- Main.Tag1
Scan devices in TwinCAT software and link PLC Tags with variable available at TxPDO
67
Fig: RxPDO linked with PLC tag -- Main.Tag2
Scan devices in TwinCAT software and link PLC Tags with variable available at RxPDO
68
Read (Master to Slave) - RxPDO
Fig: 16 bits read from Master to Slave, Bit lamp Tag binding with Block, design time
69
Fig: HMI in Run time
Fig: 16 bits Write from Slave to Master, Check box Tag binding with Block, design time
70
Fig: HMI in Run time
Button application (On/OFF from HMI) linked with ladder program in PLC
71
Fig: ON button configuration, design time
72
Fig: OFF button configuration, design time
73
Fig: HMI run time
74
11. FAQ
1. Can we order HMI first and then network extension card later? Can I fix network
extension card my self?
Yes, it is possible.
3. After inserting network extension card, HMI is Master or Slave on specific network?
Slave
7. What is the maximum data I can exchange between Master and Slave
Master to Slave: 256 bytes
Slave to Master: 256 bytes
Total: 512 bytes
11. How many blocks I can add in HMI configuration. What is the relation between PDO
and block
By default, block length=1 and it occupies 1 PDO.
For ex: if you wish to transfer 4 TxPDO from Slave to Master, then, you can define 4
blocks of type Write, type=Unit16
12. I am getting message “Extension card fail” in HMI after power on.
Please switch OFF power supply to HMI and Power ON again after downloading
application from PC to HMI.
75
14. I have 2 HMI configured as CANopen slave. Can I connect both these HMI’s to
CANopen network and exchange data with Master?
Yes, it is possible. Make sure that connections are made properly between all the
Master and Slave devices
15. Can I exchange data between two slaves directly with out Master?
No, it is not possible. You must do this via Master only
By default, one variable is available in each PDO, which is Uint16 type. If more
variables are required, it is required to enter SDO entries manually and examples are
available in this user manual
For example,
If each variable is byte type, then, you can use max. 8 variables in each PDO
If each variable is Int16 type, then, you can use max. 4 variables in each PDO
If each variable is Int32, then, you can use max. 2 variables in each PDO
76