Advantech CANopen User Manual
Advantech CANopen User Manual
V1.04
April 2013
Table of Contents
1. Introduction ......................................................................................................................................... 1
1.1. CANopen architecture ........................................................................................................ 1
1.2. Object Dictionary setting .................................................................................................... 4
1.2.1. Service Data Objects (SDO) ....................................................................................... 4
1.2.2. Process Data Objects (PDO) ....................................................................................... 5
1.2.3. SYNC setting .............................................................................................................. 7
1.2.4. Heartbeat ..................................................................................................................... 7
1.3. Reference ............................................................................................................................ 8
2. Advantech CANopen Protocol Library .............................................................................................. 9
2.1. Overview ............................................................................................................................. 9
2.2. Object Diagram ................................................................................................................. 10
2.3. Runtime Environment ........................................................................................................11
2.4. API Functions ................................................................................................................... 12
2.4.1. Overview ................................................................................................................... 12
2.4.2. Flow chart ................................................................................................................. 14
2.4.3. Definition and Structures .......................................................................................... 16
2.4.4. Error codes ................................................................................................................ 18
2.4.5. acoapi Functions ....................................................................................................... 23
3. Advantech CANopen Examples ....................................................................................................... 74
3.1. Overview ........................................................................................................................... 74
3.2. Example usage .................................................................................................................. 74
4. Advantech CANopen Network Utility ............................................................................................. 76
4.1. Overview ........................................................................................................................... 76
4.2. Configure CANopen Network .......................................................................................... 77
4.2.1. Create CANopen Network ........................................................................................ 77
4.2.2. Create slave node ...................................................................................................... 78
4.2.3. Configure Node......................................................................................................... 79
4.2.4. Import EDS File ........................................................................................................ 79
4.2.5. Create new data type ................................................................................................. 79
4.2.6. Configure the communication parameters ................................................................ 80
4.2.7. Create and configure SDO ........................................................................................ 82
4.2.8. Create and configure PDO ........................................................................................ 82
4.2.9. Create manufacture variable ..................................................................................... 85
4.2.10. Save the configuration .............................................................................................. 86
4.3. Manger CANopen network ............................................................................................... 87
4.3.1. Enter run mode.......................................................................................................... 87
4.3.2. Monitor Node Data ................................................................................................... 88
4.3.3. Control Network ....................................................................................................... 90
4.3.4. Exit Run Mode .......................................................................................................... 92
APPENDIX ............................................................................................................................................... 93
1. Introduction
CANopen, application layer communication protocol based on CAN bus, is widely used in distributed
industrial automation system, medical system, maritime system, etc. CANopen is made up of a
series of sub-protocol sets which can be divided into two parts. The first part is communication
sub-protocol set that defines the basic communication modes and objects of all the devices. This
part consists of DS-301, DS-302, DS-306, etc., among which DS-301 mainly describes
specifications and definitions of CANopen application layer communication objects and other
protocols are supplements to CANopen network on the basis of DS-301. The other part, device
sub-protocol set, defines the function and data definition of standard devices which are of different
types. These sub-protocols contain DS-401, DS-402, etc. Each device of CANopen describes its
property and functions in standard Electronic Data Sheets (EDS) files. CANopen devices must
strictly take the definitions in EDS files as their specifications and support perfect device exchange.
Application Layer
Device Profiles
CAN Bus
OD (Object Dictionary), generated from the devices’ EDS files, and describes all properties and
communication objects of the device. It’s the core definition of CANopen devices. Object
-1-
Dictionary is composed of sequential object lists. Each object applies a 16-bit index as its
addressing. Each object can be made up of several elements or a single element uses an 8-bit sub-
index as its addressing.
SDO (Service Data Object) can access and configure Object Dictionary in remote nodes via index
and sub-index of Object Dictionary. The object that requests to access is regarded as Client, and
the object which is requested is Server. The length of request messages and response messages
remains 8 bytes, including SDO command (1 byte), index of the object to be accessed (2 bytes),
sub-index of the object to be accessed (1 byte) and 4 bytes of data to be transmitted. The SDO
protocol can transmit data of any size. If the data is over 4 bytes, the message will be segmented
into several parts.
The term SDO Read means SDO upload protocol, the client of a SDO uploads data from the server.
SDO Write means SDO download protocol; the client of a SDO downloads data to the server.
PDO (Process Data Object) is used for high speed data exchange. The length of transmitted data is
limited to 1-8 bytes. PDO contains many transmitting trigger ways, such as cycle transmitting
(synchronized, time driven), triggered by remote frame, triggered by particular events, etc.
NMT (Network Management) belongs to master-slave mode. One NMT master can correspond to
several NMT Slaves. NMT master detects status of each node of the network and completes status
conversion. It supports the function of monitoring the device’s status by heartbeat, Node guarding
or Life guarding. The diagram in Figure 1 illustrates the major states a slave node can be in. Starts
the CANopen network or power on a node, it goes into NMT state Initialisation. At the end of
initialization the slave node tries to transmit its boot-up message to NMT master to report that
boot-up has been finished and has entered pre-operation status. An NMT master can switch
individual slave node or all nodes back and forth between the three major states: Pre-operational,
Operational, and Stopped.
-2-
Initialisation
Pre-Operational
Stopped
Operational
SYNC (Synchronization) makes the devices in the network possess synchronous capability. Only
one node can produces the SYNC signal in a system as SYNC producer, which can be NMT master
or other slave node. It is the time period in microseconds with which the SYNC signal occurs; the
node has this value available in the OD entry [1006h, 00h].
Heartbeat or Node Guarding is a method to detect the node is live or not, and retrieves the
status of a node. Recommend using heartbeat instead of node guarding less bandwidth, is more
flexible. The node as heartbeat producer transmits heartbeat message cyclically, consisting of a 1-
byte the current NMT state the node is in.
EMCY (Emergency) will be triggered if fatal errors occur inside the device, similar to error interrupt
mode.
The relation between NMT states and communication objects shows in Table 1: NMT states and
communication objects. It defines the communication objects can be serviced in the appropriate
NMT state if the CANopen devices support. For example: the PDO is a critical message can be
transmitted only in NMT state Operational otherwise can not.
PDO V
-3-
SDO V V
SYNC V V
TIME V V
EMCY V V
NMT V V V
The object dictionary is generated from the EDS file, describes all properties and communication
object of the CANopen device. It is the core that the behavior of the CANopen device depends on.
Detail information reference CiA DS301 [1] Communication profile. This section describes how to
configure the Object Dictionary for a node to be a SDO client or SDO server, can transmit/receive
PDO message, and send SYNC message and heartbeat.
Generally in CANopen network, each node implements only one SDO server (object 1200h) that
handles read and write request its object dictionary from other nodes as SDO client. SDO client
defined at object 1280h to 12FFh.
-4-
1.2.2.Process Data Objects (PDO)
PDO can be distinguishing between Transmit Process Data Object (TPDO) and Receive Process Data
Object (RPDO). One node produces a PDO, which is a TPDO for that node. Other nodes receive the
PDO, which is an RPDO (consumer).
The communication parameters for a TPDO are at object dictionary of index 1800h to 19FFh
(indicating which CAN message is used for the PDO and how is it triggered), but index 1804h –
19FFh default are disabled by CiA DS301 [1]. And the mapping parameters are at index 1A00h to
1BFFh. acoapi library supports above 4 PDOs up to 512 PDOs. The COB-ID of above 4 PDOs can
be self-defined and/or using CAN2.0B CAN message format that means the 29-bit of COB-ID could
be 1, and lower 7 bit is defined as NodeId.
The transmit trigger method is defined in sub-index 02h transmission type. The value is 0-240 and
252 means that the PDO is transferred synchronously and cyclically. The transmission type 254
means that defined by manufacturer specific (manufacturer specific part of the object dictionary),
255 means defined by device profile. In transmission type 254 and 255 that can use event timer
for trigger in an elapsed timer that are in sub-index 05h of the TPDO, and also support Change-Of-
State (COS) transmission method simply transmits a TPDO message if the process data is in
changes else not transmits even the event timer or inhibited timer is expired .
PDO Parameters
04h Reserved
For example: A node that node identifier is 2h, another node is 5h. Figure 2: PDO Linking
illustrates the relation of the PDO linking that Node 2h transmits TPDO_1 to Node 5h, Node 5h
receives the PDO as RPDO and update the data to object dictionary of specified index and sub-
index.
-5-
Node 2h Node 5h
Node 2h OD
TPDO_1 RPDO_1 Node 5h OD
[6000h,03]
TPDO_2 RPDO_2 [6000h,03]
[2010h,21]
TPDO_3 RPDO_3 [2010h,21]
Following is the example to describe how to set the value to the PDO in object dictionary.
A node with node identifier 0x02, the PDO is transmitted on synchrony. It contains 6 bytes of data:
DataX (2 bytes) and DataY (4 bytes). DataX is defined at index 6000h sub-index 03h. DataY is
defined at index 0x2010 sub-index 21h. The result of object dictionary setting about TPDO1 is
shown in Table 2: TPDO1 setting example.
Sub-index 00h 2
Sub-index 00h 2 write the number of data embedded in the PDO (1byte)
01h 0x60000308 Where to find of data embedded and the size. (8 bytes)
Format: index(2 bytes) – sub-index(1 byte) – size in bits(1 byte)
DataX is at object [6000h, 03h] with 8 bits
02h 0x20102120 where to find the second data embedded an the size (8bytes)
DataY is at object [2010h, 21h] with 32 bits
Another node 0x05 needs to be configured to directly listen for the TPDO1 transmitted by node
0x02. RPDO1 of node 0x05 should be used to receive TPDO1 of node 0x02.
Sub-index 00h 2
-6-
Index [1600h] value description
Sub-index 00h 2 write the number of data embedded in the PDO (1byte)
01h 0x60000308 Where to find of data embedded and the size. (8 bytes)
Format: index(2 bytes) – sub-index(1 byte) – size in bits(1 byte)
DataX is at object [6000h, 03h] with 8 bits
02h 0x20102120 where to find the second data embedded an the size (8bytes)
DataY is at object [2010h, 21h] with 32 bits
1.2.3.SYNC setting
A node as SYNC producer broadcasts the synchronization object periodically, which provides the
basic network synchronization. The time period in μs between SYNC is defined at index 1006h
Communication cycle period of object dictionary. And mandatory if the node generates the SYNC
object, the allow bit 30 at object 1005h must to be set.
The time period is 0 means do not transmit the SYNC object. Other
0
value in μs means the node generate the SYNC object in every <t>
DefaultValue or
μs if allow bit 30 is set at index 1005h.
t
Example: DefaultValue=0x001E8480, transmit every 2 seconds
1.2.4.Heartbeat
According to CiA DS301 [1], a CANopen node must support either heartbeat or node guarding
protocol that can be monitoring the node is live or not. The heartbeat protocol is preferred since
with the less bandwidth, so that the producer heartbeat time at index 1017h must be implemented.
-7-
t between transmissions of heartbeat messages.
Example: DefaultValue=0x1388, the node transmits the heartbeat
message every 5 seconds.
Other nodes (heartbeat consumers) can monitor the node whether the heartbeat is transmitted in
specified time as heartbeat consumer time. If the heartbeat is not received within the heartbeat
consumer time, a heartbeat error event will be trigger. The index 1016h of object dictionary
specifies the maximum time to wait for a heartbeat from a specific node, which maximum 7Fh
nodes. The consumer heartbeat time should be greater than the producer heartbeat time.
1.3. Reference
1 [CiADS301] CANopen Application Layer and Communication Profile, CiA Draft Standard Proposal
301 Version 4.2, 7. Dec 2007
2 [CiADS203-1] CAN Application Layer for Industrial Application, CiA/DS203-1, Feb 1996
3 [CiADS306] Electronic data sheet specification for CANopen, CiA Draft Standard 306 Version 1.3,
01 Jan 2005
-8-
2. Advantech CANopen Protocol Library
2.1. Overview
Advantech CANopen Protocol Library (acoapi) provides a C application programming interface (API)
for accessing the CANopen network protocol stack of nodes. It is easy to use, configure, start and
monitor the CANopen devices careless CAN bus, developer just focused on CANopen application
functionality. The acoapi library architecture is shown in Figure 3, at present, the library practices
the specification DSP 301 v4.2 [1] defined by CiA, communication profile.
CAN Bus
Base on the acoapi library to develop a CANopen node as master or slaves, the functionality of
slaves and of a master specified by CANopen can configure and manage remote nodes is covered
by the library:
-9-
Emergency objects
The acoapi library uses event-driven to notify the application to complete the tasks, indicate that
an event has occurred. For example: Notify the application when the NMT state of a master/slave
node has changed that can decide to do something in state changing, notify SYNC message
received or transmitted, or PDO frame transmitted, the CANopen node object dictionary of object
index and sub-index data has changed, etc.
The acoapi library references CiA DS203-1 NMT Service Specification [2] to deal with the CANopen
network aspect. Figure 4: The NMT model illustrates the NMT model of a CANopen network the
acoapi library implemented.
For each slave there must exist one remote node object with the same node identifier on the
network object that master node in. A slave node object and the remote node object that has the
same node identifier are called peers. A unique node identifier is assigned to a slave node object
and its peer by the master (network object). Master in the network object communicates with each
remote node object via CANopen protocol to its peer slave node.
Windows 2000
- 11 -
2.4. API Functions
2.4.1.Overview
The acoapi DLL implements a set of functions which together provide CANopen functionality. Each
function of first parameter is an object handles that pointer to master/slave node, remote node or
network object. Network object is in master side for management the CANopen network; it must
need a master node for creating a CANopen network and at most 126 remote slave nodes included,
totally nodes is 127 in CANopen network. Remote slave node can be inserted to network object
first before starting network, or inserted later if receiving the slave node boot-up message.
Table 8: acoapi function list
Function Description
acoNetworkReadSDO Send SDO frame in async mode to read the object dictionary of remote
slave node, it will call specified callback function after receiving the
acoNetworkWriteSDO Send SDO frame in async mode to write the data to the object dictionary
- 12 -
completing the process
Node
acoStartNode Start a slave node into Pre-Operational state that waiting NMT message
acoGetODentry Read local object dictionary info (SDO upload) or read remote slave node
acoSetODentry Write data to local object dictionary (SDO download) or write remote
acoReadSDO A slave node reads other slave node of OD by sending SDO frame in
async mode
acoWriteSDO A slave node writes the data to other slave node of OD by sending SDO
acoRegODDataChangedEvent Register an event for the entry [index, subindex] of Object Dictionary
changed
heartbeat message
- 13 -
2.4.2.Flow chart
Master side
acoCreateNode
acoNodeImportEDS
acoCreateNetwork
acoNetworkAddSlave
acoRegHeartbeatErrorEvent
acoRegBootupEvent
Regist Event
acoRegODDataChangedEvent
acoRegGeneralEvent
acoOpenCANPort
acoSetNodeId
acoGetNodeId
acoGetNodeState
acoGetNodeRole
acoStartNetwork acoReadSDO
acoWriteSDO
acoGetODentry
acoSetODentry
Run state acoSendData
acoReqNodeGuard
acoStartRemoteNode
acoStopRemoteNode
acoStopNetwork acoRemoteNodeExist
acoGetRemoteNodebyPos
acoGetRemoteNode
acoNetworkRemoveSl acoGetRemoteNodeCount
ave
acoFreeNetwork
acoCloseCANPort
acoFreeNode
- 14 -
Slave side
acoCreateNode
acoNodeImportEDS
acoRegHeartbeatErrorEvent
Regist Event acoRegODDataChangedEvent
acoRegGeneralEvent
acoOpenCANPort
acoSetNodeId
acoStartNode
acoGetNodeId
acoSetNodeId
acoGetNodeState
Run state acoGetNodeRole
acoGetODentry
acoSetODentry
acoSendData
acoStopNode
acoCloseCANPort
acoFreeNode
- 15 -
2.4.3.Definition and Structures
Definition Description
HACONODEOBJ Pointer to a node object, may be slave node object, master node object or remote
node object
- 16 -
ACODT_INT56 0x14, a 56-bit integer
};
};
function definition:
};
e_GeneralEventType;
- 17 -
typedef void (*TCOnGeneralEvent)( HACONODE hNode , LPVOID pvArg );
Notify if the value with specified object index and sub-index of object dictionary has changed
(HACONODE hNode, UNS16 wIndex, UNS8 SubIndex, UNS8 DataType, UNS32 DataLen, void * pData ,
LPVOID pvArg);
UNS8 dataType, UNS32 dataLen, void* pData, UNS32 abortCode , LPVOID pvArg);
( HACONODEOBJ hNode, NODEID_t NodeId, UNS16 wIndex, UNS8 SubIndex, UNS32 abortCode ,
LPVOID pvArg);
Notify if the slave node receives the emergency message from other nodes
(HACONODE hNode, NODEID_t NodeID, UNS16 errCode, UNS8 errReg, UNS8 errManufacField[5],
LPVOID pvArg);
Notify while not receive heartbeat message within the consumer heartbeat time.
Notify while receiving a heartbeat message from heartbeat producer (remote slave nodes.)
typedef void (*TCOnHeartbeatEvent)
(HACONODE hNode, int rpdoIndex, UNS32 cobId, UNS8 bRTR, UNS8 size, void *pData, LPVOID
pvArg);
2.4.4.Error codes
ACOERR_SUCCESS 0 Success
- 18 -
ERROR_INVALID_DATA 13 The data or input parameter is invalid or NULL
ACOERR_SDO_READ_FAILED 0x25100002 SDO read operation failed. Ex: no SDO entry in EDS
NMT_MAX_NODE_ID
ACOERR_REMOTE_STATE_OPER 0x25100009 Remote node is in operational state that can not do this
operation
ACOERR_REMOTE_NODES_OVER 0x2510000C Remote nodes count is over the limit in list, maximum
ACOERR_TIMER_FULL 0x25100010 The timer is full that can not set alarm.
ACOERR_PDO_IN_INHIBIT_TIME 0x25100011 The TPDO exist inhibit time that can not transmit PDO
immediately.
ACCERR_PDO_TRANS_FAILED 0x25100015 Can not transmit PDO, the node could be not in
- 19 -
Table 10: SDO abort codes
Definition Value Description
only)
ACOSDOABT_TOGGLE_NOT_ALTERNED 0x05030000
ACOSDOABT_TIMED_OUT 0x05040000
application.
- 20 -
Emergency error codes
- 21 -
ACOEMCYERR_ADDITIONAL_FUNC 0xF000 Additional functions
- 22 -
2.4.5.acoapi Functions
acoCreateNode
Create Master or Slave CANopen node.
HACONODE acoCreateNode(
char *pCANDriverName
);
Parameters
pCANDriverName
[in] Input the CAN driver dll path and name. (Ignore)
Return Values
If the function succeeds, the return value is the master or slave node object handle. If the function fails, the
return value is NULL. The generality of failed reason could be allocating memory failed. Could call GetLastError()
Remarks
Example
hSlaveNode = acoCreateNode(NULL);
if (hSlaveNode)
else
acoFreeNode
Free the handle of a node that created by acoCreateNode(), the function will close the CAN port first if it is
opening .
void acoFreeNode(
- 23 -
HACONODE hNode
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode()
Return Values
None
Example
acoFreeNode(hSlaveNode);
hSlaveNode = NULL;
acoOpenCANPort
Open the CAN port by specified port name and then set the baud rate. Should be open the CAN port first before
start the CANopen network.
UNS32 acoOpenCANPort(
HACONODE hNode,
char *pPortName,
int kbits
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that is the returned by acoCreateNode()
pPortName
[in] Specifies the CAN port name that is null-terminated string to open. For example, specify CAN1 , CAN2
kbits
[in] The baud rate (Kbits) of the CAN port. According to CiA Draft Standard 301 [1] recommend bit rates are
listed below:
10 Kbit/s 10
- 24 -
20 Kbit/s 20
50 Kbit/s 50
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
Example
UNS32 ret;
HACONODE hSlaveNode;
hSlaveNode = acoCreateNode(NULL);
if (hSlaveNode)
else
}else
- 25 -
acoCloseCANPort
Close the CAN port.
UNS32 acoCloseCANPort(
HACONODE hNode
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that is the returned by acoCreateNode()
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Example
if(hSlaveNode)
acoStopNode(hSlaveNode);
acoCloseCANPort(hSlaveNode);
acoFreeNode(hSlaveNode);
hSlaveNode = NULL;
acoSetBaudrate
Set the CAN port baud rate.
UNS32 acoSetBaudrate(
HACONODE hNode,
int kbits
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that is the returned by acoCreateNode()
- 26 -
kbits
[in] The baud rate (Kbits) of the CAN port. According to CiA Draft Standard 301 [1] recommend bit rates are
listed below:
10 Kbit/s 10
20 Kbit/s 20
50 Kbit/s 50
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
acoNodeImportEDS
Import the device profile for this node object handle and assign the node id.
UNS32 acoNodeImportEDS(
HACONODE hNode,
char * pProfile,
NODEID_t * pNodeId
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that is the returned by acoCreateNode().
pProfile
[in] Device profile path and file name.
pNodeId
[in, out] Specified the node id, or return the Id if included in Profile. Also can be changed by acoSetNodeId().
- 27 -
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, the returns value is acoapi
error codes.
Remarks
EDS describes the behavior of CANopen device with respect to the contents of object dictionary. Its content
should be conforming to CANopen standard, necessary to avoid incomplete or erroneous data sheets. Else the
working model of the device in CANopen network may not running well as you expected. Use external test tool
called CANchkEDS.exe to check the valid content of EDS first before importing EDS, or use a configuration
Example
acoGetNodeId
Get node identifier of the Master or Slave node object handle.
NODEID_t acoGetNodeId(
HACONODE hNode
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that is the returned by acoCreateNode()
Return Values
Return the node identifier of the node object handle that be set by acoNodeImportEDS() or acoSetNodeId().
Remarks
The node identifier is unique identifier for each CANopen device in the network, a value in the range of [1..127]
Example
- 28 -
UNS32 NodeId;
if (hSlaveNode)
NodeId = acoGetNodeId(hSlaveNode);
acoSetNodeId
Assign a unique node identifier to the Master or Slave node object handle.
UNS32 acoSetNodeId(
HACONODE hNode,
NODEID_t NodeId
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
NodeId
[in] Specified a unique node identifier in a range of [1..127].
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
The node identifier is unique identifier for each CANopen device in the network, a value in the range of [1..127]
Changing the node identifier, the related COB-ID included Node-ID of object dictionary will be updated too.
Example
UNS32 NodeId;
if (hSlaveNode)
NodeId = acoGetNodeId(hSlaveNode);
- 29 -
}
acoGetNodeState
Get the NMT state of the Master or Slave node object handle.
e_acoNodeState acoGetNodeState(
HACONODE hNode
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
Return Values
Return the NMT state of the Master or Slave node object handle.
Remarks
The NMT state of the Slave node will be auto into Pre-Operational state after calling acoStartNode(). Later the
state of the Slave node can be changed by receiving the NMT messages from a NMT master. If using
acoRegGeneralEvent() function to register a state changed event function, the event will be called by notify the
state has been changed and understand which current state is in.
Example
e_acoNodeState NodeState;
if (hSlaveNode)
NodeState = acoGetNodeState(hSlaveNode);
if(NodeState == ns_Operational)
- 30 -
}
acoStartNode
Start the Slave node into Initialization and then Pre-Operational state to join the CANopen network.
UNS32 acoStartNode(
HACONODE hNode
);
Parameters
hNode
[in] Pointer to the Slave node object handle that returned by acoCreateNode().
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
Before starting the Slave node, calls acoImportEDS() to import EDS of device profile and calls
acoOpenCANPort() to open CAN port is necessary. The Slave node transmits a boot-up message to signal that
it has entered the state Pre-operational after Initializing, then it joins the CANopen network. Depending on NMT
state machine, the Slave node later waits the NMT command specifier from NMT master to switch its state.
Master node auto started by acoStartNetwork() and stopped by acoStopNetwork() that does not necessary to
Example
HACONODE hSlaveNode=NULL;
hSlaveNode = acoCreateNode(NULL);
if (hSlaveNode)
- 31 -
// should be ImportEDS first than OpenCANPort
if (acoStartNode(hSlaveNode) == ACOERR_SUCCESS)
printf("StartNode success!");
else
printf("StartNode failed!");
acoCloseCANPort(hSlaveNode);
acoFreeNode(hSlaveNode);
hSlaveNode = NULL;
else
acoFreeNode(hSlaveNode);
hSlaveNode = NULL;
else
acoFreeNode(hSlaveNode);
hSlaveNode = NULL;
acoStopNode
Stop the slave node into Stop state by local control.
UNS32 acoStopNode(
HACONODE hNode
);
Parameters
- 32 -
hNode
[in] Pointer to the Slave node object handle that returned by acoCreateNode().
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
The Slave node can be call acoStopNode() that enter into Stop state by local control. But also in CANopen
network that means NMT master can transmit any NMT command to switch its state. Use acoCloseCANPort()
function that can exit the CANopen network without receiving any CAN frames.
Master node is stopped by acoStopNetwork() function that does not necessary to call acoStartNode() or
acoStopNode().
Example
If(hSlaveNode)
acoStopNode(hSlaveNode);
acoCloseCANPort(hSlaveNode);
acoFreeNode(hSlaveNode);
hSlaveNode = NULL;
acoGetNodeRole
Identifier the role of a node is Master, Slave or remote node.
e_nodeRole acoGetNodeRole(
HACONODEOBJ hNode
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode() or pointer to
Return Values
- 33 -
Return the node role: Master, Slave, Remote Node or unknown role.
Example
if (acoGetNodeRole(hSlaveNode) == Master)
//To do.
//To do.
acoGetODentry
Read an entry with specified index and sub-index from the local object dictionary. This function is a synchronous
method, it returns the result until completed or timeout occurs.
UNS32 acoGetODentry(
HACONODE hNode,
UNS16 wIndex,
UNS8 SubIndex,
UNS8 *pDataType,
UNS32 *pDataLen,
void* pData
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode()
wIndex, SubIndex
[in] Which index (16bits) and sub-index (8bits) of entry in the object dictionary want to read.
pDataType
[out] the data type of the [index, sub-index] value. See data type constant in acodef.h.
pDataLen
- 34 -
[in, out] Input is the memory size of the pData allocated; output is the real data length of pData. The input
data length should be equal to the length of [index, sub-index] value in object dictionary or zero for
pData
[out] the data of [index, sub-index] value in object dictionary. If input is NULL, do not output the value,
return current data type and data length that the entry [index, sub-index] is.
Return Values
If the function succeeds, the return value is ACOOD_SUCCESSFUL. If the function fails, please reference acoapi
Remarks
According to the content of object dictionary, need to check access type before reading the entry. Does not
allow to read the entry if the access type of [index, sub-index] is write-only (WO). Retrieve the data if the
Use acoSetODentry() function to write the data of [index, sub-index] in local object dictionary.
Asynchronous method, acoReadSDO() and acoWriteSDO() function is to read/write the data of [index, sub-
Example
UNS32 ret;
UNS8 data[16]={0};
UNS8 DataType=0;
UNS32 DataLen=8;
if (ACOOD_SUCCESSFUL == ret)
else
acoSetODentry
Write an entry to the local object dictionary. This function is a synchronous method, it is blocked and returns the
result until the operation is complete or timeout occurs.
UNS32 acoSetODentry(
- 35 -
HACONODE hNode,
UNS16 wIndex,
UNS8 SubIndex,
UNS8 DataType,
UNS32 DataLen,
void* pData
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
wIndex, SubIndex
[in] Which index (16bits) and sub-index (8bits) of entry in the object dictionary want to write.
DataType
[in] the data type of the pData value. See data type constant in acodef.h.
DataLen
[in] the data length of the pData.
pData
[in] data
Return Values
If the function succeeds, the return value is ACOOD_SUCCESSFUL. If the function fails, please reference acoapi
Remarks
According to the content of object dictionary, need to check access type before writing data to the entry. Does
not allow to update data of the entry if the access type of [index, sub-index] is read-only (RO). Can be
writeable if the [index, sub-index] permission of access type is write-only (WO) or read-write (RW).
Use acoGetODentry() function to read the data of [index, sub-index] in local object dictionary.
Synchronous read/write object dictionary means that the method is blocked until the operation is complete,
and then the method returns its data. Recommend that use synchronous method is well access in the local
object dictionary, but use asynchronous method is better by access remote object dictionary. Reference
Example
- 36 -
UNS32 ret;
UNS8 data=255;
UNS8 DataType=ACODT_UINT8;
UNS32 DataLen=sizeof(data);
if (ACOOD_SUCCESSFUL == ret)
printf ("WriteObjDict succ: DataType=%x, DataLen=%d, Data=%x ", DataType, DataLen, data);
else
acoReadSDO
Read an entry with specified index and sub-index from remote object dictionary of specified node identifier
through SDO protocol. This function is an asynchronous method, it starts a task is returned immediately without
waiting for a result. When the task finishes, the library notifies the application that the message was successfully
processed and pass the result to the callback function.
UNS32 acoReadSDO (
HACONODE hNode,
NODEID_t NodeId,
UNS16 wIndex,
UNS8 SubIndex,
UNS8 DataType,
TCOnReadSDOResult pf
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode()
NodeId
[in] specified a SDO server node identifier, read its object dictionary
wIndex, SubIndex
[in] Which index (16bits) and sub-index (8bits) of entry in the object dictionary want to read.
DataType
[in] the data type of the [index, sub-index] value. See data type constant in acodef.h.
pf
- 37 -
[in] Pointer to the application-defined function of type TCOnReadSDOResult; represents the starting address
of the function. The function will be executed if SDO request is responded or timeout occurs.
Return Values
If the function succeeds, the return value is ACOOD_SUCCESSFUL. If the function fails, please reference acoapi
Remarks
Asynchronous read/write object dictionary means that the function does not block the procedure, return
immediately. Application can continue doing other work. To be informed the callback function when receiving
the SDO responded or timeout occurs, pass the result of entry [index, sub-index] of object dictionary whose
node identifier is NodeId to the callback function, application would get the value of entry and SDO abort code
to understand the result of SDO request. If the operation is success, the abort code is ACOOD_SUCCESSFUL;
otherwise, SDO abort code is returned that defined by CiA DS-301 v4.02. The node with specified node
identifier must have the capability of SDO server; it is described in index 1200h – 127Fh of EDS.
According to the content of object dictionary, also need to check access type before reading the entry in
remote object dictionary. Does not allow to read the entry if the access type of [index, sub-index] is write-only
(WO). Retrieve the data if the [index, sub-index] permission of access type is read-only (RO) or read-write
(RW).
Use acoWriteSDO() function to write the data of entry [index, sub-index] to remote object dictionary which
acoNetworkWriteSDO() are for network object to request the remote slave node.
Example
void OnReadSDOResult(
UNS16 wIndex, UNS8 bSubIndex, UNS8 dataType, UNS32 dataLen, void *pData, UNS32 abortCode,
LPVOID pvArg)
if (ACOOD_SUCCESSFUL == abortCode) {
} else
- 38 -
printf("ReadSDOResult failed: %x", abortCode);
UNS32 ret;
UNS8 DataType=ACODT_UINT8;
NODEID_t OtherNode=0x05;
if (ACOOD_SUCCESSFUL == ret)
else
acoWriteSDO
Write the value at the index and sub-index to remote object dictionary of the node whose node identifier is NodeId
through SDO protocol. This function is an asynchronous method, it starts a task is returned immediately without
waiting for a result. When the task finishes, the function notifies the application that the message was successfully
processed and pass the result to the callback function.
UNS32 acoWriteSDO (
HACONODE hNode,
NODEID_t NodeId,
UNS16 wIndex,
UNS8 SubIndex,
UNS8 DataType,
UNS32 DataLen,
void* pData
TCOnWriteSDOResult pf
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode()
NodeId
[in] specified a SDO server node identifier, write to its object dictionary
- 39 -
wIndex, SubIndex
[in] Which index (16bits) and sub-index (8bits) of entry in the object dictionary want to write.
DataType
[in] the data type of the pData value. See data type constant in acodef.h.
DataLen
[in] the data length of pData.
pData
[in] the data of [index, sub-index] value.
pf
[in] Pointer to the application-defined function of type TCOnWriteSDOResult; represents the starting address
of the function. The function will be executed if SDO request is responded or timeout occurs.
Return Values
If the function succeeds, the return value is ACOOD_SUCCESSFUL. If the function fails, please reference acoapi
Remarks
Asynchronous read/write object dictionary means that the function does not block the procedure, return
immediately. Application can continue doing other work. To be informed the callback function when receiving
the SDO responded or timeout occurs, pass the result to the callback function, application would get the SDO
abort code to understand the result of SDO request. If the operation is success, the abort code is
ACOOD_SUCCESSFUL; otherwise, SDO abort code is returned defined by CiA DS-301 v4.02. The node with
specified node identifier must have the capability of server SDO; it is described in index 1200h – 127Fh of EDS.
According to the content of object dictionary, also need to check access type before writing the data to the
entry in remote object dictionary. Does not allow to write the entry if the access type of [index, sub-index] is
Use acoReadSDO() function to read the data of entry [index, sub-index] from remote object dictionary which
acoNetworkWriteSDO() are for network object to request the remote slave node.
Example
void OnWriteSDOResult(
- 40 -
{
if (ACOOD_SUCCESSFUL == abortCode) {
} else
void main()
UNS32 ret;
UNS8 transType=0x255;
UNS8 DataType=ACODT_UINT8;
if (ACOOD_SUCCESSFUL == ret)
else
acoStopNode(hSlaveNode);
acoCloseCANPort(hSlaveNode);
acoFreeNode(hSlaveNode);
hSlaveNode = NULL;
- 41 -
acoRegODDataChangedEvent
Register an event for the local object dictionary entry; event will be called while the data of entry [index, sub-index]
is changed, pass the changed data of the entry to the application-defined function.
UNS32 acoRegODDataChangedEvent(
HACONODE hNode,
UNS16 wIndex,
UNS8 SubIndex,
TCOnODDataChangedEvent cb,
LPVOID pvArg
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
wIndex, SubIndex
[in] Which index (16bits) and sub-index (8bits) of entry in the object dictionary want to monitor.
cb
[in] Pointers to the application-defined function to execute by the library while the data of the entry [index,
pvArg
[in] Pointer to the data to be passed to the callback function or pointer to NULL; the type is a void that
allows the application to declare, define, and initialize a structure or argument to hold any information.
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
Application can monitor the data of local object dictionary with specific index and sub-index through register a
callback function without polling. If the data is changed without respect to by local or by remote SDO Client,
application can get notify and to do something. But if register too many callback function for the data changed,
Example
- 42 -
UNS32 OnODDataChanged(HACONODE hNode, UNS16 wIndex, UNS8 SubIndex,
//To do.
Return 0;
void RegNodeEvents(void)
acoUnRegODDataChangedEvent
Un-register an event for the local object dictionary entry, do not get notify if the data is changed.
UNS32 acoUnRegODDataChangedEvent(
HACONODE hNode,
UNS16 wIndex,
UNS8 SubIndex
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
wIndex, SubIndex
[in] Which index and subindex of the object dictionary
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Example
void UnRegNodeEvent()
- 43 -
acoRegGeneralEvent
Register a callback function for general event that the node is in state changed, after transmitting or receiving
SYNC message or after transmitting PDO message synchronously.
UNS32 acoRegGeneralEvent(
HACONODE hNode,
e_GeneralEventType et,
TCOnGeneralEvent cb,
LPVOID pvArg
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
et
[in] which event type being trigger an callback function. The event type can be node in initialization state,
preoperational state, and operational state, stop state, post SYNC and post PDO.
cb
[in] Pointer to the application-defined function to be called by the library while specific the event is triggered.
hNode argument is pointer to Master or Slave node object handle; indicates which the node enters this
event. pvArg argument [in] pointer to an argument that is passed through from the callback function.
pvArg
[in] Pointer to the data to be passed to the callback function or pointer to NULL; the type is a void that
allows the application to declare, define, and initialize a structure or argument to hold any information.
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
- 44 -
Remarks
Master or Slave node can be aware its current state by notify automatically, do not need to call
something in the state. For example, Master can change transmission type of slave Transmit PDO as it’s
Example
//To do.
//To do.
//To do.
//To do.
void RegNodeEvents(void)
acoSendData
Transmit a raw message to other nodes.
UNS32 acoSendData(
- 45 -
HACONODE hNode,
UNS32 CobId,
bool bRTR,
UNS32 dataLen,
void * pData
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
CobId
[in] Specified Cob-ID of the CAN message. The format of Cob-ID is defined by CiA DS-301 v4.02:
10 7 6 0
bRTR
[in] Identify the message is Remote Transmission Request or not
dataLen
[in] the length of the pData, maximum length is 8 in CAN message.
pData
[in] the value to be sent
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Example
acoSendEmcy
Transmit an emergency message from an emergency producer on the CANopen device. Emergency objects are
triggered by occurrence of a CANopen device internal error situation, and the error register (1001h) are specified;
- 46 -
the messages shall contain the error field with pre-defined error and additional information.
UNS32 acoSendEmcy(
HACONODE hNode,
UNS16 errCode,
UNS8 errRegMask,
UNS16 addInfo
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
errCode
[in] emergency error codes
errRegMask
[in] This value is filled in at the location of object 1001h (error register). That means it must include object
1001h in EDS.
0 M Generic error
1 O Current
2 O Voltage
3 O Temperature
6 O Reserved (always 0)
7 O Manufacturer-specific
addInfo
[in] Application-specific additional information is defined by other profile specifications.
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
If CAN device internal triggers an error interrupt, acoapi library transmits an emergency message with FF00h
device specific error in errCodes, 11h communication error in error register. May use
- 47 -
triggered and CAN device internal error occurs. The new error codes will be filled in at the top of the array of
After transmitting an emergency message, need to use acoResetEmcy() function to reset error, the CANopen
device enters the error free state and transmit an ‘reset error / no error’ emergency object. For example, a
node generates a temperature emergency (measured temperature exceeds the limits), only when the
temperature has returned within limits the node transmit another emergency message, this time
Use acoRegEmcyEvent() to register an event for the emergency consumer that the callback function will be
Example
acoResetEmcy
Deletes specific error code and clears corresponding bits in Error register. If all errors are clear, the CANopen
device enters the error Free State.
UNS32 acoResetEmcy(
HACONODE hNode,
UNS16 errCode
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
errCode
[in] emergency error codes
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
After transmitting an emergency message, need to use acoResetEmcy() function to reset error, the CANopen
device enters the error free state and transmit an ‘reset error / no error’ emergency object.
- 48 -
Example
acoRegEmcyEvent
One or more emergency consumers (master or slaves) register an event for trigger if receiving an emergency
message from emergency producer (other nodes.)
UNS32 acoRegEmcyEvent(
HACONODE hNode,
TCOnPostEmcyEvent pf,
LPVOID pvArg
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
pf
[in] Pointer to the application-defined function of type TCOnPostEmcyEvent; represents the starting address
of the function. The function would to be called by the library while the node receives an emergency
message.
typedef void (*TCOnPostEmcyEvent)(HACONODE hNode, NODEID_t NodeID, UNS16 errCode, UNS8 errReg,
hNode argument [in] is the pointer to the node object handle is the same as hNode argument of
acoRegEmcyEvent() as a emergency consumer. NodeID argument [in] is the node identifier that which the
slave node producers the emergency message. errCode, errReg and errManufacField argument [in] is
emergency error codes and error register that the slave node producers. pvArg argument [in] pointer to an
pvArg
[in] Pointer to the data to be passed to the callback function or pointer to NULL; the type is a void that
allows the application to declare, define, and initialize a structure or argument to hold any information.
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
- 49 -
Example
void DoRecvEmcyEvent(HACONODE hNode, NODEID_t NodeID, UNS16 errCode, UNS8 errReg, UNS8
printf("Receives an emergency message from Node[%d]: %04x %02x\r\n"), NodeID, errCode, errReg);
acoRegHeartbeatEvent
Heartbeat consumer (the node) registers an event for trigger if receiving a heartbeat message from heartbeat
producer (remote slave nodes.)
UNS32 acoRegHeartbeatEvent (
HACONODE hNode,
TCOnHeartbeatEvent cb,
LPVOID pvArg
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
cb
[in] Pointer to the application-defined function of type TCOnHeartbeatEvent; represents the starting address
of the function. The function would to be called by the library while master node receives a heartbeat
message.
LPVOID pvArg);
hNode argument [in] is the pointer to the node object handle as a heartbeat consumer. NodeID argument
[in] is the node identifier that which the remote slave node producers the heartbeat message, currState
argument [in] is the current NMT state of the remote slave node. pvArg argument [in] pointer to an
pvArg
[in] Pointer to the data to be passed to the callback function or pointer to NULL; the type is a void that
allows the application to declare, define, and initialize a structure or argument to hold any information.
Return Values
- 50 -
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
A heartbeat producer transmits a heartbeat message cyclically; so the application-defined function would be
called cyclically. Therefore, be carefully using this function that may cause the system decrease the efficiency.
Through heartbeat message, can know the remote node it’s presently NMT state, generally used in NMT master
node.
The heartbeat producer time and heartbeat consumer time can be configurable via object dictionary (EDS). The
Example
acoRegHeartbeatErrorEvent
Register an event for heartbeat error in network object; event will be called while not receive heartbeat message
within the heartbeat consumer time.
UNS32 acoRegHeartbeatErrorEvent(
HACONODE hNode,
TCOnHeartbeatErrorEvent cb,
LPVOID pvArg
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
cb
- 51 -
[in] Pointer to the application-defined function of type TCOnHeartbeatErrorEvent; represents the starting
address of the function. The function would to be called by the library while master node not receives a
hNode argument [in] is the pointer to the node object handle as a heartbeat consumer. NodeID argument
[in] indicates is the node identifier that does not receive a heartbeat message from the node within the
heartbeat consumer time. pvArg argument [in] pointer to an argument that is passed through from the
callback function.
pvArg
[in] Pointer to the data to be passed to the callback function or pointer to NULL; the type is a void that
allows the application to declare, define, and initialize a structure or argument to hold any information.
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
The configuration of about heartbeat consumer must be in object dictionary of object 1016h and sub-index 01h
above, so that the node just could be a heartbeat consumer. The value of heartbeat consumer time indicates
the expected heartbeat cycle times. If the heartbeat time is equal to 0, no heartbeat error event will be
triggered. If the heartbeat time is unequal 0, a heartbeat error event will be generated if the heartbeat is not
Example
- 52 -
acoRegRecvPDOEvent
Register a event is for receiving a PDO message; This function should be called every time a PDO has received
from foreign nodes.
UNS32 acoRegRecvPDOEvent(
HACONODE hNode,
TCOnRecvPDOEvent cb,
LPVOID pvArg
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
cb
[in] Pointer to the application-defined function of type TCOnRecvPDOEvent; represents the starting address
of the function. The function would to be called by the library while the node receives a PDO message.
typedef void (*TCOnRecvPDOEvent)(HACONODE hNode, int rpdoIndex, UNS32 cobId, UNS8 bRTR, UNS8
hNode argument [in] is the pointer to the node object handle. rpdoIndex argument [in] indicates Which
RPDO offset [0..511] of the object dictionary [1400..15FF] to received. cobId argument [in] indicates the
COB-ID of the RPDO message. bRTR argument [in] is the RTR flag of RPDO message. size argument [in] is
the data length of pData in bytes. pData argument [in] is the data of RPDO message. pvArg argument [in]
pvArg
[in] Pointer to the data to be passed to the callback function or pointer to NULL; the type is a void that
allows the application to declare, define, and initialize a structure or argument to hold any information.
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
Example
- 53 -
// CALLBACK function for RPDO
void OnRecvPDOEvent(HACONODE hNode, int rpdoIndex, UNS32 cobId, UNS8 bRTR, UNS8 size, void *pData,
LPVOID pvArg)
int i, j;
acoSendPDOwithCOS
Send PDOs if any data has changed (Change-Of-State), only transmission type 255 (0xFF) is supported yet. This
function should be called every time a PDO has changed and sent to foreign nodes immediately.
UNS32 acoSendPDOwithCOS(
HACONODE hNode,
int tpdoIndex
);
Parameters
hNode
[in] Pointer to the Master or Slave node object handle that returned by acoCreateNode().
tpdoIndex
[in] Which TPDO offset [0..511] of the object dictionary [1800..19FF] to be sent if the data has changed, or
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
- 54 -
The change-of-state transmission method simply transmits a TPDO message if the process data in it changes
and transmission type is 255 (0xFF). But it could be affected by inhibited time if it exists. Even the data has
been changed but it may not send the TPDO until the inhibit time expired. So if the process data actually
changes several times while the timer is running not all of these changes will be transmitted, that means
Example
int tpdoOffset = 0;
acoCreateNetwork
Create a CANOpen network object in NMT master with the requested attributes.
HACONETWORK acoCreateNetwork(
HACOMASTER hMasterNode
);
Parameters
hMasterNode
[in] Assign a Master node for this CANopen network. A node created by acoCreateNode().
Return Values
If the function succeeds, the return value is a network object handle. If the function fails, the return value is
Network object includes a Master node and remote node set. Master node should be ready first before creating
Example
HACONETWORK hNetworkObj;
HACOMASTER hMasterNode;
NODEID_t MasterNode=0x01;
hMasterNode = acoCreateNode(NULL);
- 55 -
if (ACOERR_SUCCESS == acoNodeImportEDS(hMasterNode, “Master.eds”, &MasterNode))
hNetworkObj = acoCreateNetwork(hMasterNode);
if (hNetworkObj)
acoRegBootupEvent(hNetworkObj, DoBootupEvent);
acoStartNetwork(hNetworkObj);
// do something…
acoStopNetwork(hNetworkObj);
acoFreeNetwork(hNetworkObj);
acoFreeNode(hMasterNode);
if (!acoRemoteNodeExist(hNetworkObj, id))
if (pRemoteNode)
acoStartRemoteNode(pNetworkObj, id);
acoFreeNetwork
Free CANopen network object and its remote nodes list. Before release the network object, it will stop all remote
- 56 -
nodes first by broadcasting NMT stop message and then stop the master node.
void acoFreeNetwork(
HACONETWORK hNetworkObject
);
Parameters
hNetworkObject
[in] Pointer to network object handle that return by acoCreateNetwork().
Return Values
None
acoStartNetwork
Start the CANopen network to operation, start master node enter NMT state Operational and then start all remote
nodes in remote list by broadcasting NMT start remote node message.
UNS32 acoStartNetwork(
HACONETWORK hNetworkObject
);
Parameters
hNetworkObject
[in] Pointer to network object handle that returned by acoCreateNetwork().
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
Start CANopen network, master firstly enter NMT state Operational, and continue to demand other remote
slave nodes enter NMT state Operational if online. Offline remote slave nodes can be demanded if receiving the
boot up message, reference acoRegBootupEvent(). Call acoStartRemoteNode() only start remote slave node.
All of nodes must be in NMT state Operational can transmit PDO object. In other words, any process data can
be transferred the node must be in state Operational; else the process data can not be transferred.
- 57 -
State
Pre-operational Operational Stopped
Object
PDO V
SDO V V
SYNC V V
TIME V V
EMCY V V
NMT V V V
Example
acoStopNetwork
Stop the CANopen network, stop all remote nodes in remote list by broadcasting NMT stop message and then
stop master node, all of nodes would be enter NMT state Stopped.
UNS32 acoStartNetwork(
HACONETWORK hNetworkObject
);
Parameters
hNetworkObject
[in] Pointer to network object handle that returned by acoCreateNetwork().
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Example
acoGetRemoteNodeCount
Return the number of remote nodes in network object of remote node list.
UNS32 acoGetRemoteNodeCount(
HACONETWORK hNetworkObject
- 58 -
);
Parameters
hNetworkObject
[in] Pointer to network object handle that returned by acoCreateNetwork().
Return Values
acoGetRemoteNode
Get remote node object handle by specified node identifier in remote node list.
HACOREMOTE acoGetRemoteNode(
HACONETWORK hNetworkObject,
NODEID_t NodeId
);
Parameters
hNetworkObject
[in] Pointer to network object handle that returned by acoCreateNetwork().
NodeId
[in] the node identifier of remote node.
Return Values
If the remote node with specified node identifier is exist in network object of remote node set, return value is
Remarks
According to remote node object handle, use acoGetRemoteNodeId() function to get node identifier or use
acoGetRemoteNodebyPos
Get remote node object at a specified position in remote node list.
HACOREMOTE acoGetRemoteNodebyPos(
HACONETWORK hNetworkObject,
- 59 -
size_t _Pos
);
Parameters
hNetworkObject
[in] Pointer to network object handle that returned by acoCreateNetwork().
_Pos
[in] the index number of the remote node. The base is 0.
Return Values
The return value specifies the remote node object in the remote node list of position. If the position is over the
Example
acoGetRemoteNodeId
Get node identifier of the remote node object handle.
NODEID_t acoGetRemoteNodeId(
HACOREMOTE hRemoteNode
);
Parameters
- 60 -
hRemoteNode
[in] Pointer to remote node object handle.
Return Values
Return the node identifier of the remote node object handle that be set by acoNetworkAddSlave(). Return
Remarks
The node identifier is unique identifier for each CANopen device in the network, a value in the range of [1..127]
Example
acoRemoteNodeExist
Check the node identifier whether exist in remote node list or not.
BOOL acoRemoteNodeExist(
HACONETWORK hNetworkObject,
NODEID_t NodeId
);
Parameters
hNetworkObject
[in] Pointer to network object handle that returned by acoCreateNetwork().
NodeId
[in] Specified a unique node identifier in a range of [1..127].
Return Values
Nonzero indicates the remote node with specified node identifier exists in remote node list of network object.
Zero indicates the node identifier does not exist in remote node list.
Example
- 61 -
acoNetworkAddSlave
NMT master creates a remote node object with the requested attributes and inserts it to the remote node set of
the network object.
HACOREMOTE acoNetworkAddSlave(
HACONETWORK hNetworkObject,
NODEID_t NodeId,
char *pFileName
);
Parameters
hNetworkObject
[in] Pointer to network object handle that returned by acoCreateNetwork().
NodeId
[in] a node identifier.
pFileName
[in] Device profile path and file name of remote slave node, it can be NULL.
Return Values
If the function succeeds, the return value is a remote node object handle. If the function fails, the return value
Remarks
The node identifier should be a unique value in a range of [1..127] defined by CiA DS-301. So that the
maximum count of the remote nodes in network object is 126, one node identifier is reserved for Master node.
Inserting a node to remote node list, the remote node list in network object would re-sort by node identifier so
that the memory location would be rearranged. If the application keeps the pointer of the remote node, that
caused to pointer to different remote node. Therefore, recommends that call acoGetRemoteNode() or
acoGetRemoteNodebyPos() each time to retrieve the current pointer of the remote node object from the list, do
Example
- 62 -
acoNetworkRemoveSlave
NMT master removes the remote node object identified by NodeId from the remote node list of the network object.
NMT master demands the remote node would be enter the NMT state Stopped and then remove it from list.
UNS32 acoNetworkRemoveSlave(
HACONETWORK hNetworkObject,
NODEID_t NodeId
);
Parameters
hNetworkObject
[in] Pointer to network object handle that returned by acoCreateNetwork().
NodeId
[in] a node identifier in a range of [1..127].
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
Before removing the remote node from list in network object, firstly transmitting NMY message to the remote
slave node entered NMT state Stopped and then remote it from list. The remote node list in network object
would re-sort by node identifier so that the memory location would be rearranged. If the application keeps the
pointer of the remote node, that caused to pointer to different remote node. Therefore, recommends that call
acoGetRemoteNode() or acoGetRemoteNodebyPos() each time to retrieve the current pointer of the remote
node object from the list, do not keep the pointer of the remote node.
Example
acoNetworkRemoveSlave(hNetworkObj, 0x02);
acoNetworkSetState
NMT master change the remote slave node to new state by NMT message. Node identifier is 0 means
- 63 -
broadcasting NMT message to all remote slave nodes to change its state.
UNS32 acoNetworkSetState(
HACONETWORK hNetworkObject,
NODEID_t NodeId,
e_acoNodeState newState
);
Parameters
hNetworkObject
[in] Pointer to network object handle that returned by acoCreateNetwork().
NodeId
[in] the remote slave node identifier in range [0..127], 0 means all remote slave nodes.
newState
[in] the new NMT state.
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Example
acoGetRemoteNodeState
Get the NMT state of the specified remote node object handle that kept in NMT master side, not really remote
slave node state.
e_acoNodeState acoGetRemoteNodeState(
HACOREMOTE hRemoteNode
);
Parameters
hNetworkObject
[in] Pointer to network object handle that returned by acoCreateNetwork().
- 64 -
Return Values
Return the currently NMT state of the remote node. If return value is ns_Unknown_state, indicates the remote
slave node may be offline that can not response any message or just request its node guard message and
acoReqNodeGuard
NMT master request the remote slave node an extra a node guard message. If the slave replies the node guard
message, the state of the remote node will be updated in network object.
UNS32 acoReqNodeGuard(
HACONETWORK hNetworkObject,
NODEID_t NodeId
);
Parameters
hNetworkObject
[in] Pointer to network handle that created by acoCreateNetwork().
NodeId
[in] the remote slave node identifier in range [0..127], 0 means all remote slave nodes.
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
NMT master application transmit guarding requests single to remote slave node or all nodes, the state of asked
remote nodes in network object would be into ns_Unknown_state state, update the newly state until the
guarding is achieved if the slave node supports node guarding protocol. For a later a cycle of CAN message,
The state of remote slave nodes update cyclically if the device supports the heartbeat mechanism, does not
need to request the node guarding alone. The heartbeat mechanism for a device is established by cyclically
transmitting the heartbeat message by the heartbeat producer. If the heartbeat cycle fails for the heartbeat
producer, the heartbeat consumer will be informed the event, reference acoRegHeartbeatErrorEvent().
Example
- 65 -
extern HACOREMOTE hRemoteNode;
Sleep(1000L);
switch(NodeState)
case ns_Initialisation:
break;
case ns_Pre_operational:
break;
case ns_Operational:
break;
case ns_Stopped:
break;
default:
break;
acoStartRemoteNode
The NMT master uses the NMT service start remote node specified by node identifier to change the NMT state.
The state of the remote slave node shall be entering NMT state Operational.
UNS32 acoStartRemoteNode(
HACONETWORK hNetworkObject,
NODEID_t NodeId
);
Parameters
hNetworkObject
- 66 -
[in] Pointer to network handle that created by acoCreateNetwork().
NodeId
[in] the remote slave node identifier in a range [0..127]. CBROADCAST_NODEID (0) means broadcast NMT
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
By broadcasting NMT start remote node message, all remote slave nodes shall be enter NMT state Operational
even if the remote node is not exist in the remote node list of network object. Therefore, application needs to
maintain the remote node list in the network object by self. The service start remote node is unconfirmed, can
not get really the NMT state after starting, application can use other method to know which state the remote
Need to use acoStartNetwork() firstly to start CANopen network and master node. Use acoStopRemoteNode()
Example
acoStartRemoteNode(hNetworkObj, 0x02);
acoStopRemoteNode
The NMT master uses the NMT service stop remote node specified node specified to change NMT state. The
state of the remote slave node shall be entering NMT state Stopped.
UNS32 acoStopRemoteNode(
HACONETWORK hNetworkObject,
NODEID_t NodeId
);
Parameters
hNetworkObject
- 67 -
[in] Pointer to network handle that created by acoCreateNetwork().
NodeId
[in] the remote slave node identifier in a range [0..127]. CBROADCAST_NODEID (0) means broadcast NMT
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Example
acoStopRemoteNode(hNetworkObj, 0x02);
acoRegBootupEvent
Register an event for receiving Slave boot up message in network object; event will be called while master
receiving a slave boot up message.
UNS32 acoRegBootupEvent(
HACONETWORK hNetworkObject,
TCOnBootupEvent cb,
LPVOID pvArg
);
Parameters
hNetworkObject
[in] Pointer to network handle that created by acoCreateNetwork().
cb
[in] Pointer to the application-defined function of type TCOnBootupEvent; represents the starting address of
the function. Library will call this function while the master receiving a slave node boot up frame.
hNode argument [in] is the pointer to the master node object handle. NodeID argument [in] is the slave
node with the node identifier transmits a boot-up message. pvArg argument [in] pointer to an argument
pvArg
- 68 -
[in] Pointer to the data to be passed to the callback function or pointer to NULL; the type is a void that
allows the application to declare, define, and initialize a structure or argument to hold any information.
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
The NMT slave transmits a boot-up message to indicate the state transition occurred from the NMT state
Initialisation to the NMT state Pre-operational. It is ready to CANopen network. In application-defined function,
Master can change the object dictionary settings of remote slave node by SDO request, or request the remote
Example
acoNetworkReadSDO
Read an entry with specified index and sub-index from remote object dictionary of specified node identifier
through SDO protocol. This function is an asynchronous method, it starts a task is returned immediately without
waiting for a result. When the task finishes, the library notifies the application that the message was successfully
processed and pass the result to the callback function.
UNS32 acoNetworkReadSDO(
HACONETWORK hNetworkObject,
NODEID_t NodeId,
UNS16 wIndex,
UNS8 SubIndex,
UNS8 DataType,
TCOnReadSDOResult pf
);
Parameters
hNetworkObject
[in] Pointer to network handle that created by acoCreateNetwork().
NodeId
[in] specified a SDO server node identifier, read its object dictionary
- 69 -
wIndex, SubIndex
[in] Which index (16bits) and sub-index (8bits) of entry in the object dictionary want to read.
DataType
[in] the data type of the [index, sub-index] value. See data type constant in acodef.h.
pf
[in] Pointer to the application-defined function of type TCOnReadSDOResult; represents the starting address
of the function. The function will be executed if SDO request is responded or timeout occurs.
Return Values
If the function succeeds, the return value is ACOERR_SUCCESS. If the function fails, please reference acoapi
error codes.
Remarks
This asynchronous function is for the master node asks other remote slave node the value of object dictionary
with object index and sub-index. The application-defined function of type TCOnReadSDOResult will be called if
receiving the responded value of specified wIndex and sub-index from the remote slave node as SDO server.
Therefore, SDO parameters should be described in both master node and remote slave node at object
dictionary of object 1280h to 12FFh SDO client parameter, and object 1200h to 127Fh SDO server parameter.
Else there is not receiving any responded message from the remote slave node.
typedef void (*TCOnReadSDOResult)( HACONODEOBJ hNode, NODEID_t NodeId, UNS16 wIndex, UNS8
hNode argument [in] is the pointer to the remote slave node object handle with node identifier is NodeID.
NodeID argument [in] is the remote slave node identifier. wIndex and SubIndex arguments [in] indicate which
object to be read. dataType argument [in] indicates the data type of the pData. dataLen argument [in] is the
data length of pData. pData argument [in] is the data of object [index, sub-index]. abortCode argument is the
return value, ACOOD_SUCCESSFUL means success, else get fails, reference acoapi error codes and SDO abort
codes.
Example
void OnReadSDOResult(
UNS16 wIndex, UNS8 bSubIndex, UNS8 dataType, UNS32 dataLen, void *pData, UNS32 abortCode)
- 70 -
if (ACOOD_SUCCESSFUL == abortCode) {
Data=%02x"
} else
acoNetworkWriteSDO
Write the value at the index and sub-index to remote object dictionary of the node whose node identifier is NodeId
through SDO protocol. This function is an asynchronous method, it starts a task is returned immediately without
waiting for a result. When the task finishes, the function notifies the application that the message was successfully
processed and pass the result to the callback function.
UNS32 acoNetworkWriteSDO(
HACONETWORK hNetworkObject,
NODEID_t NodeId,
UNS16 wIndex,
UNS8 SubIndex,
UNS8 DataType,
UNS32 DataLen,
void *pData,
TCOnWriteSDOResult pf
);
Parameters
hNetworkObject
[in] Pointer to network handle that created by acoCreateNetwork().
NodeId
[in] specified a SDO server node identifier, write to its object dictionary
wIndex, SubIndex
[in] Which index (16bits) and sub-index (8bits) of entry in the object dictionary want to write.
- 71 -
DataType
[in] the data type of the pData value. See data type constant in acodef.h.
DataLen
[in] the data length of pData.
pData
[in] the data of [index, sub-index] value.
pf
[in] Pointer to the application-defined function of type TCOnWriteSDOResult; represents the starting address
of the function. The function will be executed if SDO request is responded or timeout occurs.
Return Values
If the function succeeds, the return value is ACOOD_SUCCESSFUL. If the function fails, please reference acoapi
Remarks
This asynchronous function is for the master node writes the value of object dictionary with object index and
sub-index to other remote slave node. The application-defined function of type TCOnWriteSDOResult will be
called if receiving the responded from the remote slave node as SDO server. Therefore, SDO parameters
should be described in both master node and remote slave node at object dictionary of object 1280h to 12FFh
SDO client parameter, and object 1200h to 127Fh SDO server parameter. Else there is not receiving any
typedef void (*TCOnWriteSDOResult)( HACONODEOBJ hNode, NODEID_t NodeId, UNS16 wIndex, UNS8
hNode argument [in] is the pointer to the remote slave node object handle with node identifier is NodeID.
NodeID argument [in] is the remote slave node identifier. wIndex and SubIndex arguments [in] indicate which
object to be write. abortCode argument is the return value, ACOOD_SUCCESSFUL means success, else get fails,
Example
void OnWriteSDOResult(
HACONODEOBJ hNode, UNS8 NodeId, UNS16 wIndex, UNS8 bSubIndex, UNS32 abortCode)
if (ACOOD_SUCCESSFUL == abortCode) {
- 72 -
printf("WriteSDOResult: succ: RemoteNode[%02x] object [%04x:%02x] \n\r" \
} else
UNS8 data=255;
- 73 -
3. Advantech CANopen Examples
3.1. Overview
Advantech CANopen provides C#, VB.NET, VC.NET, VC and BCB examples for your reference.
The C#, VB.NET, VC.NET examples are developed by Microsoft Visual Studio 2005.
There are tow examples for each language :acoMaster and acoSlave.
When user installs the advantech windows CANopen package, all examples will be installed in
C:\Program Files\Advantech\Advantech CANopen by default.
- 74 -
Figure 5: Master Example Main Window
- 75 -
4. Advantech CANopen Network Utility
4.1. Overview
The Advantech CANopen network utility is a utility to configure CANopen network node, to control
and monitor the whole CANopen network. The main functions of Advantech CANopen Network
Utility can be described as follows.
An EDS file editor:configure network nodes, export EDS file that needed by CANopen library
API when user develop application based on CANopen library.
CANopen network manger: user can use the utility to create a CANopen network and do a
simple test, it can also to control and monitor the CANopen network.
- 76 -
4.2. Configure CANopen Network
Firstly, Create the CANopen network, Click the “File->New CANopen NetWork” menu item, the
utility will display a wizard to create network, user only need to input network name, master node
device, master node id, network baud rate. These setting can also be changed after network is
created.
If user wants to set more about new network before create network, click the “Advanced Setting”
button, advanced setting dialog support create network From EDS File, and user also can set the
SDO, PDO number for master node, the setting dialog as follows.
Click “OK” button, a new CANopen network will be created according to the user’s setting. The left
view of the utility shows the structure of the new network as follows.
- 77 -
Figure 10: CANopen Network Tree View
When create CANopen network, only the master node is create in new network, user should to add
slave node.
Select the “Slave Nodes” node, right click the mouse, a menu will display as follows.
There are two ways to create slave node, from EDS file or create empty slave node.
When clicking the “Add Slave Node”, the following dialog will be displayed.
- 78 -
Figure 12: Add Save Node Dialog
User input the name and node id, click “OK”, and then the empty slave node will be created and
add to network.
When clicking the “Add Slave Node from EDS File”, user should give an EDS file path then the slave
node will be created according to EDS file and add to network.
4.2.3.Configure Node
After create network and add slave node, user can configure them further, for example, create new
data type, add communication parameters, PDO, SDO and so on, modify the setting, even import
another EDS file for the master node or slave node. After finishing the configuration, the network
configuration can be saved; each port configuration can export to EDS file.
Figure 13: Import EDS File for Master Node and Slave Node
User can import EDS file to configure each CAN node. After import EDS file, the original
configuration is replace by the new EDS file.
User can define new data type and use it when adding manufacture data, select the “Data Type”
tree node of the CAN port, right click the mouse, and then click the “Create New Type” menu item.
- 79 -
Figure 14: Create New Data Type Menu
User can input the new data type name and index, the index value must be between 0x40 and
0xFFF.For example, we create a new data type named “AI” in index 0x40.
Select the “Communication Parameters” tree node, right click the mouse and click “Add/Remove
Communication” menu item.
- 80 -
Figure 17: Add/Remove Communication Menu Item
Then a dialog displays and user can add or remove the communication parameters.
- 81 -
Figure 19: configure communication parameters
User can add SDO server or SDO client by click “Add SDO Server” or “Add SDO Client”, and then
user need to configure the new SDO Server and SDO Client.
User can add transmit PDO or receive PDO by click “Add Receive PDO” or “Add Transmit PDO”
- 82 -
menu item,and then user need to configure the new PDO to meet the user’s requirement.
- 83 -
Figure 24: Add PDO Mapping Variable
User can remove PDO by click “Remove this PDO” menu item, and also can change PDO
parameters number by click “PDO parameter Configuration”.
- 84 -
Figure 26: PDO Parameter Configuration Dialog
User can add manufacture data by “Add Mapping Variable” menu item. The following dialog will
display.
- 85 -
Figure 28: Add Manufacture Data Variable
After finished configuration, user can save the whole network by “File->Save Project” or “File Save
Project As” menu item. The saved project file can also be opened by utility for later use if need.
If user only needs to save one node setting, “Export EDS file” is the way. The EDS file is also need
for CANopen application development based on acoapi library, so user can edit and export the EDS
file in the utility for later use.
The export EDS file can be imported if needed.
- 86 -
Figure 34: Save the Network Configuration
Utility can enter run mode to manger the CANopen network, it control and monitor the whole
CANopen network by sending CANopen messages to slaves through Master node, that is to say, We
can get slave node state, node id, PDO data value, read and write the local or remote object
dictionary.
Click “Run” menu item to enter the run mode and start the whole CANopen network after
configuration.
- 87 -
Figure 36: Run Mode Main Window
Then user can select master node or slave node to monitor its data.
The following picture is the slave node monitor view. We can see its state and PDO data.
Please note that the utility can only control the network through master node, user should run
slave node application to communicate with the utility if necessary, for example to run acoSlave
example in the slave node, and then the utility can communication with slave node opened by
acoSlave. Utility can also communicate with other manufacture CAN device base on CANopen
protocol.
The following picture is slave node monitor view.
- 88 -
Figure 37: Run Mode Slave Node Window
The following picture is Master node monitor view.
- 89 -
Figure 38: Run Mode Master Node Window
From above Figure, we can see left-top view of the utility show the CANopen network topology
structure, when use select one node, its node id and status will be shown as follows.
The right view display the selected node PDO Mapping data value , if any data changed, this
monitor view will update the data value in time.
4.3.3.Control Network
Master Node can send message to any node in the network by “send message” function tab. The
entire node in the network (Master or slave) can read value from object dictionary by “Read Value”
- 90 -
function in second tab and write value to node object dictionary by “Write Value” function in third
tab page.
The following picture is send message tab.
The following picture is read value tab. User can read the local or remote object dictionary as
follows, only input the index and sub index then click the “Read” button.
User can use the menu to change the remote node state.
- 91 -
Figure 43: Change slave node state
Click “Network->Exit Run Mode” to exit run mode, then it will return configuration mode, user can
configure the network again.
- 92 -
APPENDIX
This appendix describes all the Objects and Data types supported by Advantech CANopen stack.
Data Type according to Object Dictionary Data Types of CANopen DS 301 v4.02 p.80.
Data Type Value Comment
BOOLEAN 0x01 Boolean,1-bit
- 93 -
Object Support list
Object according to Overview Object Dictionary Entries for Communication of CANopen DS 301
v4.02 p.84.
- 94 -
[1200sub1] COBID Client to Server 0x600 + $NODEID ro
80000200h+$Node-ID
1401h: 300h + $Node-ID, rw, 1401h: 300h + $Node-
ID,
80000300h+$Node-ID
1402h: 400h + $Node-ID, rw, 1402h: 400h + $Node-
ID,
80000400h+$Node-ID
1403h: 500h +$ Node-ID rw, 1403h: 500h + $Node-
ID,
80000500h+$Node-ID
…… ……
[1400-15FF sub2] transmission type NO rw
[1400-15FF sub3] inhibit time 0 rw
- 95 -
[1600-17FF sub0] number of mapped NO rw,1-40h
application objects in PDO
[1600-17FFsub1h–40h] PDO NO rw
mapping for the nth application object to
be mapped
[1800-19FF] TxPDO Parameter 512 TxPDO
[1800-19FF sub0] largest sub-index 5 ro
supported
[1800-19FF sub1] COB-ID used by 1800h: 180h + $Node-ID, rw 1800h: 180h + $Node-
PDO ID,
80000180h+$Node-ID
1801h: 280h + $Node-ID, rw 1801h: 280h + $Node-
ID,
80000280h+$Node-ID
1802h: 380h + $Node-ID, rw 1802h: 380h + $Node-
ID,
80000380h+$Node-ID
1803h: 480h + $Node-ID rw 1803h: 480h + $Node-
ID,
80000480h+$Node-ID
…… ……
[1800-19FF sub2] transmission type NO rw
[1800-19FF sub3] inhibit time 0 rw
[1800-19FF sub4] reserved 0 rw
[1800-19FF sub5] event timer 0 rw
[1A00-1BFF] transmit PDO mapping 512 TxPDO
[1A00-1BFF sub0] NO ro, 1-40h
[1A00-1BFF sub1h–40h] NO ro
- 96 -