0% found this document useful (0 votes)
42 views76 pages

CANopen Slave User Manual for HMI

Human machine interface CANopen Slave

Uploaded by

Jorge Valdivia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views76 pages

CANopen Slave User Manual for HMI

Human machine interface CANopen Slave

Uploaded by

Jorge Valdivia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

User Manual

Human machine interface


CANopen Slave

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.

WARNING, Failure to follow may lead to minor injury or damage /


malfunctioning of equipment

DANGER, Failure to follow may lead to injury or fatal accident to operating


personal or damage/malfunctioning of equipment

CAUTION, Failure to follow may lead to malfunctioning of equipment,


damage or repair

Protective Earth

DC Supply

PREFACE

Original equipment manufacturer reserves the right to change information available in


this document without notice. Original Equipment manufacturer is not liable for any
damages incurred to equipment/personal during installation or use of equipment as
explained in this document. User must acquire sufficient knowledge & skills prior to
use the equipment in the application and follow all the local standards & regulations
to meet safety requirements

TwinCAT , EtherCAT is registered trade mark of Beckhoff


Anybus-CC , is registered trade mark of HMS

2
TABLE OF CONTENTS
1. OVERVIEW....................................................................................................... 4
1.1 INTRODUCTION .................................................................................................. 4
1.2 COMMUNICATION .............................................................................................. 5
2. SPECIFICATIONS............................................................................................ 6

3. EXTENSION CARD INSTALLTION............................................................. 6

4. WIRING............................................................................................................ 10

5. QUICK SETUP ................................................................................................ 12

6. OBJECT ENTRIES ......................................................................................... 14


6.1 RXPDO PARAMETER AND MAPPING DETAILS ................................................... 14
6.2 TXPDO PARAMETER AND MAPPING DETAILS ................................................... 15
6.3 MANUFACTURER SPECIFIC OBJECTS ................................................................. 16
6.3.1 Example1, 4 TxPDO and 4 RxPDO mapping ......................................... 16
6.3.2 Example2, 32 TxPDO and 32 RxPDO mapping ..................................... 17
7. PLC CONFIGURATION................................................................................ 19
7.1 SETUP .............................................................................................................. 19
7.2 SCAN FOR CANOPEN SLAVE IN NETWORK ....................................................... 22
7.3 COB ID ........................................................................................................... 26
7.4 CONFIGURATION OF PROCESS DATA ................................................................. 29
8. HMI CONFIGURATION ............................................................................... 32

9. CONVERTER .................................................................................................. 37

10. EXAMPLES ..................................................................................................... 40


10.1.1 4 PDO Read/Write (1 Variable, Unit16 type in each PDO) ................. 40
10.1.2 4 PDO Read/Write (4 variables, Uint16 type in each PDO) ................ 48
10.1.3 16 bits Read, 16 bits write .................................................................... 66
11. FAQ ................................................................................................................... 75

3
1. OVERVIEW

1.1 Introduction

CANopen is a communication protocol and device profile specification for embedded


systems used in automation. In terms of the OSI model, CANopen implements the
layers above and including the network layer. The lower level protocol implementing
the data link and physical layers is usually Controller Area Network (CAN)

Fig: Typical configuration

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

Fig: Data exchange between master and slave

5
2. SPECIFICATIONS

Item Description

COM port number in HMI COM3 (for network option, extension card)

CANopen extension card name BC-CANopen

Master to Slave, maximum bytes 256

Slave to Master, maximum bytes 256

Total bytes 512

Supported baud rates 10 ,20, 50, 100,125, 250,500, 800 kbps


& 1 Mbps
Slave station number 1 to 127
Protocol CAN 2.0A
Standard DS-301, v4.02 compliant

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

3. EXTENSION CARD INSTALLTION

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

Fig: Typical dimensional drawing of HMI 750

7
Fig: Typical HMI 750 with CANopen module

1. Open HMI rear cover by removing all the screws

2. Remove M2 X 4 mm screws (2 nos.) and open network module blank cover

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

5. Remove 5 mm hex screws for network extension card

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

8. Fix 5 mm hex screws (2 nos.) for COM1 port

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

12. Close the HMI rear cover

9
4. WIRING

DB9 male at extension card, pin details

Pin Signal Comments


1
2 CAN _L CAN Low
3 CAN-GND

5 CAN_SHLD
6 -
7 CAN_H CAN High
8 -
9 -
Shield CAN_SHIELD

10
Fig: CAN network connection scheme

Please make connections as per standard CANopen specifications

R = Terminating resistor, typical: 120 ohms


Maximum nodes, n = 127
Shielded twisted pair cable should be used for connecting CAN_H and CAN_L
Termination resistor should be used at both first and last nodes in network
CAN_H and CAN_L are different bus levels, CAN_GND is common reference

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.

5. Make sure HMI (COM3) is connected to PLC on CANopen. Download application


from PC to HMI

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

6.1 RxPDO parameter and mapping details

Index Object Name Sub- Description Data Access


Index Type

1400 h Receive PDO 00 h Largest sub-index supported U8 Read


--------- parameter only
141F h
01 h COB ID used by PDO U32 Read/
Write

02 h Transmission type U8 Read/


Write

1600 h - Receive PDO 00 h Number of mapped application U8 Read/


--------- mapping objects in PDO Write
161F h
01 h Mapped object #1 U32 Read/
Write

02 h Mapped object #2 U32 Read/


Write

03 h Mapped object #3 U32 Read/


Write

04 h Mapped object #4 U32 Read/


Write

05 h Mapped object #5 U32 Read/


Write

06 h Mapped object #6 U32 Read/


Write

07 h Mapped object #7 U32 Read/


Write

08 h Mapped object #8 U32 Read/


Write

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

Index Object Name Sub- Description Data Access


Index Type

1800 h Transmit 00 h Largest sub-index supported U8 Read


--------- PDO only
181F h parameter
01 h COB ID used by PDO U32 Read/
Write

02 h Transmission type U8 Read/


Write

1A00 h Transmit 00 h Number of mapped application U8 Read/


---------- PDO mapping objects in PDO Write
1A1F h
01 h Mapped object #1 U32 Read/
Write

02 h Mapped object #2 U32 Read/


Write

03 h Mapped object #3 U32 Read/


Write

04 h Mapped object #4 U32 Read/


Write

05 h Mapped object #5 U32 Read/


Write

06 h Mapped object #6 U32 Read/


Write

07 h Mapped object #7 U32 Read/


Write

08 h Mapped object #8 U32 Read/


Write

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

Index Object Sub- Description Data Access


Name Index Type

2001 h ADI 0001 h 00 h Number of entries U8 Read


-------- only
2040 h
01 h to Multiple elements represented Depends on
08 h as multiple sub indexes configuration

FF h Data type according to DS302 U32 Read


(V4.02) only

6.3.1 Example1, 4 TxPDO and 4 RxPDO mapping

PDO type Mapping object (Hex) Manufacturer specific objects


(Hex)
RxPDO1 1600 2001
RxPDO2 1601 2002
RxPDO3 1602 2003
RxPDO4 1603 2004

PDO type Mapping object (Hex) Manufacturer specific objects


(Hex)
TxPDO1 1a00 2005
TxPDO2 1a01 2006
TxPDO3 1a02 2007
TxPDO4 1a03 2008

Note: Data available in manufacturer specific objects in continuous locations.

16
6.3.2 Example2, 32 TxPDO and 32 RxPDO mapping

RxPDO mapping

Mapping object (Hex) Manufacturer specific objects


(Hex)
RxPDO1 1600 2001
RxPDO2 1601 2002
RxPDO3 1602 2003
RxPDO4 1603 2004
RxPDO5 1604 2005
RxPDO6 1605 2006
RxPDO7 1606 2007
RxPDO8 1607 2008
RxPDO9 1608 2009
RxPDO10 1609 200A
RxPDO11 160a 200B
RxPDO12 160b 200C
RxPDO13 160c 200D
RxPDO14 160d 200E
RxPDO15 160e 200F
RxPDO16 160f 2010
RxPDO17 1610 2011
RxPDO18 1611 2012
RxPDO19 1612 2013
RxPDO20 1613 2014
RxPDO21 1614 2015
RxPDO22 1615 2016
RxPDO23 1616 2017
RxPDO24 1617 2018
RxPDO25 1618 2019
RxPDO26 1619 201A
RxPDO27 161a 201B
RxPDO28 161b 201C
RxPDO29 161c 201D
RxPDO30 161d 201E
RxPDO31 161e 201F
RxPDO32 161f 2020

Note: Data available in manufacturer specific objects in continuous locations

17
TxPDO mapping

Mapping object (Hex) Manufacturer specific objects


(Hex)
TxPDO1 1a00 2021
TxPDO2 1a01 2022
TxPDO3 1a02 2023
TxPDO4 1a03 2024
TxPDO5 1a04 2025
TxPDO6 1a05 2026
TxPDO7 1a06 2027
TxPDO8 1a07 2028
TxPDO9 1a08 2029
TxPDO10 1a09 202A
TxPDO11 1a0a 202B
TxPDO12 1a0b 202C
TxPDO13 1a0c 202D
TxPDO14 1a0d 202E
TxPDO15 1a0e 202F
TxPDO16 1a0f 2030
TxPDO17 1a10 2031
TxPDO18 1a11 2032
TxPDO19 1a12 2033
TxPDO20 1a13 2034
TxPDO21 1a14 2035
TxPDO22 1a15 2036
TxPDO23 1a16 2037
TxPDO24 1a17 2038
TxPDO25 1a18 2039
TxPDO26 1a19 203A
TxPDO27 1a1a 203B
TxPDO28 1a1b 203C
TxPDO29 1a1c 203D
TxPDO30 1a1d 203E
TxPDO31 1a1e 203F
TxPDO32 1a1f 2040

Note: Data available in manufacturer specific objects in continuous locations.

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.

It is expected user is fully aware of TwinCAT software. If any questions on


TwinCAT software, please check TwinCAT documentation

Fig: Test setup

7.1 Setup

1. Install TwinCAT software in PC

2. Copy EDS file from CD to path C:\TwinCAT\Io\CANopen, where C is partition in


your hard drive.

3. Open TwinCAT software. Right click icon at taskbar and click system manager.

19
4. Create a new project

5. Click icon to enter Configuration mode. In task bar, it should show


configuration mode as shown below

6. To configure the network card in the computer select “Options->Show Real


Time Ethernet Compatible Devices”.

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

Complete HMI configuration as per procedure explained in next chapter, download


application to HMI, connect Slave to Master on CANopen and then Run the application.
Slave should be connected to the Master for configuration purpose.

1. Connect BC1100 to PC via Ethernet. Start TwinCAT as shown below

2. Open System manager, click on icon and enter to Configuration mode.

3. Select “I/O Devices” and click “Scan sub devices” icon

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.

Fig: Scanning for boxes, i.e. slaves on the CANopen network

Click “Yes”

23
Click “OK”

Wait for few minutes to scan the slave devices

Click “No” here

6. Free run option to go into operational mode. Select No in this dialogue.

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

TwinCAT software automatically assigns COB ID for PDO1 to PDO4 automatically.

Object PDO
COB-ID Type Size
Index Name

1800h TxPDO1 384 + Node ID Input 8 bytes

1801h TxPDO2 640 + Node ID Input 8 bytes

1802h TxPDO3 896 + Node ID Input 8 bytes

1803h TxPDO4 1152 + Node ID Input 8 bytes

1804h All master configuration software don’t


TxPDO5 to
to allocate COB ID automatically
TxPDO32
181Fh

1400h RxPDO1 512 + Node ID Output 8 bytes

1401h RxPDO2 768 + Node ID Output 8 bytes

26
1402h RxPDO3 1024 + Node ID Output 8 bytes

1403h RxPDO4 1280 + Node ID Output 8 bytes

1404h All master configuration software don’t


RxPDO5 to
to allocate COB ID automatically
RxPDO32
141Fh

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

Sample COB ID’s for different slaves based on ID number

COB-ID, COB-ID, COB-ID, COB-ID,


Object PDO COB-ID (Hex) (Hex) (Hex) (Hex)
Index Name (Dec) Slave, Slave, Slave, Slave,
ID=1 ID=2 ID=3 ID=4
384 + Node
1800h TxPDO1 0x181 0x182 0x183 0x184
ID
640 + Node
1801h TxPDO2 0x281 0x282 0x283 0x284
ID
896 + Node
1802h TxPDO3 0x381 0x382 0x383 0x384
ID
1152 + Node
1803h TxPDO4 0x481 0x482 0x483 0x484
ID
1804h All master configuration software don’t allocate COB ID
TxPDO5 to
to automatically
TxPDO32
181Fh
512 + Node
1400h RxPDO1 0x201 0x202 0x203 0x204
ID
768 + Node
1401h RxPDO2 0x301 0x302 0x303 0x304
ID
1024 + Node
1402h RxPDO3 0x401 0x402 0x403 0x404
ID
1280 + Node
1403h RxPDO4 0x501 0x502 0x503 0x504
ID
1404h All master configuration software don’t allocate COB ID
RxPDO5 to
to automatically
RxPDO32
141Fh

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

Fig: TwinCAT screen in Free run mode

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

Fig: HMI screen in Run time

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

Fig: TwinCAT screen in Free run mode

31
8. HMI CONFIGURATION

1. In project explorer, double click at “Connections”

2. Click to add a new connection.

3. Select Type= Other Networks. Select Protocol = CANopen, then click apply icon
to save this setup

4. Click “Config” to open CANopen slave configuration

5. Select Communication and enter settings

Address: Enter unique slave address in CAN network.


Address range: 1 to 127

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

6. Select “Block” and add required blocks as per requirement.

Fig: HMI, CANopen slave configuration screen

Each Block is linked with one PDO.

Length indicates variables in specific PDO. By default, length = 1, Type = Uintt16

Maximum size of one PDO is 8 bytes.

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

It is possible to do scaling in HMI application for Read/Write blocks

Task1: Read (Master to Slave)


PLC Value range=-32767 to 32767.
Convert this to 0 to 100 and display in HMI
Use Block1, Signed integer 16 type in HMI configuration

Task2: Write (Slave to Master)


Write 0 to 100 in HMI. Convert this to -32767 to 32767 and send to PLC
Use Block2, Signed integer 16 type in HMI configuration

Read, Block1_0 Write, Block2_0


Value at Value Value write Value at
PLC Read in in HMI PLC
HMI
0 0 0 0
32767 50 50 32767
65535 100 100 65535

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

Range Low: Define value range low to/from PLC

Range High: Define value range high to/from PLC

Click button.

Click tab “Tag”.

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

Fig: Expression selected for variable in all Blocks

39
Click button to close Conversion configuration screen

10. EXAMPLES

10.1.1 4 PDO Read/Write (1 Variable, Unit16 type in each PDO)

Data type PLC address HMI HMI tag HMI Description


block name IO
address type
UInt16 Tag1 (RxPDO) Block1 Block1 Read Master to
Slave
UInt16 Tag2 (RxPDO) Block2 Block2 Read Master to
Slave
UInt16 Tag3 (RxPDO) Block3 Block3 Read Master to
Slave
UInt16 Tag4 (RxPDO) Block4 Block4 Read Master to
Slave
UInt16 Tag101 (TxPDO1) Block5 Block5 Write Slave to
Master
UInt16 Tag102 (TxPDO2) Block6 Block6 Write Slave to
Master
UInt16 Tag103 (TxPDO3) Block7 Block7 Write Slave to
Master
UInt16 Tag104 (TxPDO4) Block8 Block8 Write Slave to
Master

Fig: CANopen slave block configuration in HMI

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

Fig: Variable in RxPDO1 linked with PLC tag -- Main.Tag1

44
Read (Master to Slave) - RxPDO

Fig: 4 variables read from Master to Slave, label Tag binding with Block, design time

Fig: Write values at PLC in Run time

45
Fig: HMI in Run time

Write (Slave to Master) – TxPDO

Fig: Write from Slave to Master, NumberUpDown, Tag binding with Block, design time

46
Fig: HMI in Run time

Fig: Read values at PLC 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

Fig: CANopen slave tags in HMI database

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

Fig: Variable in RxPDO1 linked with PLC tag -- Main.Tag1

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

PDO message format: [Object] [Sub index] [Data type]

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

Object: 2001, Sub index: 02, Data type = 10 (Uint16)

RxPDO1, VarIn-2

Object: 2001, Sub index: 03, Data type = 10 (Uint16)

RxPDO1, VarIn-3

56
Object: 2001, Sub index: 04, Data type = 10 (Uint16)

Sub index 0 entries

Number of mapped application objects = 4

RxPDO2 configuration settings

RxPDO3 configuration settings

57
RxPDO4 configuration settings

58
59
TxPDO1 configuration settings

TxPDO2 configuration settings

60
TxPDO3 configuration settings

TxPDO4 configuration settings

61
Read (Master to Slave) - RxPDO

Fig: 4 variables read from Master to Slave, label Tag binding with Block, design time

Fig: Write values at PLC in Run 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

Fig: HMI in Run time

64
Fig: Read values at PLC in Run time

65
10.1.3 16 bits Read, 16 bits write

Data type PLC address HMI HMI tag HMI Description


block name IO
address type
UInt16 Tag2 (RxPDO) Block1 Block1 Read Master to Slave
UInt16 Tag1 (TxPDO) Block2 Block2 Write Slave to Master

Fig: CANopen slave block configuration in HMI

Fig: CANopen slave tags in HMI database

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

Fig: Write values at PLC in Run time

69
Fig: HMI in Run time

Write (Slave to Master) - TxPDO

Fig: 16 bits Write from Slave to Master, Check box Tag binding with Block, design time

70
Fig: HMI in Run time

Fig: Read values at PLC in Run time

Button application (On/OFF from HMI) linked with ladder program in PLC

71
Fig: ON button configuration, design time

Fig: ON button events configuration, design time

72
Fig: OFF button configuration, design time

Fig: OFF button events configuration, design time

73
Fig: HMI run time

Fig: PLC ladder in 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.

2. All HMI support network extension card


All HMI support network extension card except HMI 730

3. After inserting network extension card, HMI is Master or Slave on specific network?
Slave

4. Is it possible to have more than 1 HMI in CANopen network


Yes, it is possible.

5. Is it possible to connect 1 HMI to 2 Masters on CANopen?


No, it is not possible.

6. Can I access TwinCAT, PLC addressing areas directly in HMI software


No, it is not possible

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

8. Is EDS file is required to configure CANopen slave


Depends on Master

9. What are the settings required in CANopen slave


ID number, baud rate and block configuration is required.

10. How many PDO’s are supported by HMI?


Maximum 32 nos. TxPDO and 32 Nos. RxPDO are supported.

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.

13. TwinCAT did not find CANopen slave device


Make sure CANopen network module is properly inserted in HMI. Download demo
program (Analog) to HMI, Now, make sure CANopen cable is connected COM3 port
to Master device. Now press “RUN” at HMI from Control center. At this time, create
a new project in TwinCAT, make sure, it is in configuration mode and then scan the
devices again

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

16. What is the maximum size of PDO?


8 bytes

17. Can I exchange more than one variable in each PDO?


Yes, it is possible. Make sure maximum length of all variables is with in maximum
size of PDO, which is 8 bytes

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

You might also like