CANopen LAYER_2 communication [EN]
Introduction
LAYER_2 communication can be implemented equally with the CANopen slave firmware and / or the CANopen master firmware.
If only LAYER_2 communication is required, the start behavior of both firmware (master / slave) must be set to "Controlled by Application" in the SYCON.net configuration.
The master will then only send a CAN telegram with CAN ID 0x700 + NODE ID.
The slave does not send this telegram. SYCON.net only takes over a part of the configuration.
Everything else (configuration, sending and receiving of CAN telegrams) is done exclusively via the mailboxes of the CIFX card, i.e. with the driver functions xChannelPutPacket () and xChannelGetPacket ().
Since it has to be configured via packages anyway, the whole configuration can also be implemented without SYCON.net (only the baud rate is defined by SYCON.net).
Application
The individual commands that are required for this are put dogether as a dump (all values in HEX) below.
These are packages that are taken from the API Manuals protocol.
CANopen Master Protocol API: CANopen Master
CANopen Slave Protocol API: CANopen Slave
The baud rate is 1MBaud in both cases.
CANopen-Master SetBusParam
DEST: 20
CMD: 2806
LEN: 2C
DATA: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
CANopen-Slave SetBusParam
DEST: 20
CMD: 2E04
LEN: 44
DATA: 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Channel Init
DEST: 20
CMD: 2F80
LEN: 0
DATA:
CAN_DL-Register
DEST: 20
CMD: 2A0A
LEN: 04
DATA: 00 00 00 00
CAN_DL-Enable RxID
DEST: 20
CMD: 2A12
LEN: 18
DATA: 03 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 FF 07 00 00 00 00 00 00
CAN_DL-Send Data
DEST: 20
CMD: 2A02
LEN: 14
DATA: 00 00 00 00 08 00 00 00 42 00 00 00 11 22 33 44 55 66 77 88 |
For the CANopen master (without SYCON.net) the following packets must be sent in the following order (the CAN telegram described above with CAN ID 0x700 + NODE ID is also sent here):
- CANopen master SetBusParam
- CAN_DL register
- CAN_DL-Enable RxID
- (CAN_DL-Send Data) - Exemplary sending of a CAN telegram
For the CANopen slave (without SYCON.net) the following packets must be sent in the following order:
- CANopen slave SetBusParam
- Channel Init
- CAN_DL register
- CAN_DL-Enable RxID
- (CAN_DL-Send Data) - Exemplary sending of a CAN telegram
CAN telegrams are then received by the customer application via the card's Receive Mailbox (CAN_DL_CMD_DATA_IND)
If SYCON.net is used, the SetBusParam and for the slave the Channel Init must be skipped.