Location>code7788 >text

CANopen Learning Notes (II) Communication Objects PDO and SDO, etc.

Popularity:660 ℃/2024-08-27 16:51:00

recipient of a communication

PDO

My opinion: a CANopen device can have up to 512 RPDOs and 512 TPDOs, for a total of up to 1024 PDOs.(confirmed by GPT4o)

CiA stack view: a CANopen device with only one logical device has a maximum of 512 PDOs.

Two uses of PDO:

  • TPDO: Producer PDO
  • RPDO: Consumer PDO
specificities

small but rapid

transfer mode
  • Synchronization transfer: Getting the synchronization signal via (SYNC object)

    Transmission multiplier for synchronized TPDO: n indicates that the next message is sent after n synchronization signals. (When 0, send after receiving the first synchronization signal after the trigger signal)

  • event-driven transmission

Trigger Mode

Trigger mode for messages

trigger method account for application scenario
event-driven Specific events to drive overlimit alarm
Timer Driver Sending at fixed intervals Periodic updating of data
remote request Other nodes request the device to send the corresponding PDO by sending an RTR frame. Allow nodes the flexibility to request data
synchronous trigger Triggered by a certain number of Sync and internal events Coordinate synchronized operation of multiple devices
PDO read and write
  • Write protocol (push mode): producer writes PDO data to 0 ~ n consumers (refer to spi write data)
  • Read protocol (pull mode): consumer sends RTR request to request data from producer (refer to spi read data)

PDO Write

parameters Request/execution Response/Acknowledgement
PDO No. obligatory
digital obligatory

image

PDO read

parameters Request/execution Response/Acknowledgement
PDO No. obligatory
digital obligatory

image

object description
  • Communication Parameters: defines the basic characteristics of the PDO, such as COB-ID, transmission type, forbidden time and event timer, etc. It determines in which way the PDO is sending and receiving data.

    • COB-ID: a PDO message can be uniquely identified by its COB-ID

      • The COB-IDs of TPDO and RPDO are different
      • When the highest bit of COB-ID is set to 1, it indicates that this PDO is disabled
    • Transmission Type: The transmission method of PDO messages.

      • synchronous transmission
      • asynchronous transfer

image

  • Inhibit Time: Minimum time interval between two PDOs (in ms)

  • Event Timer: The cycle time for an event to be triggered is set and sent by the PDO when it expires (indicating that no event has occurred).

  • Sync Counter: Used in synchronous transmission types to specify how many times a sync signal is received before it is sent.

  • Mapping Parameters: defines which object dictionary entries (variables) are included in the PDO message and where these variables are located in the message.

    • Number of mapping entries: defines the number of entries a PDO has in the object dictionary, each representing a data segment
    • Mapping objects: each mapping object consists of 32 bits
      • Index (Index, 16 bits): index in the object dictionary
      • Sub-Index (Sub-Index, 8 bits): Sub-index of the object dictionary entry
      • Bit Length (Bit Length, 8 bits): indicates the number of data bits of the mapping object (often integer multiples of bytes)
PDO transport example

Click me to view

Multiplex PDO (didn't understand and didn't finish reading due to lack of information)

There are two ways to use MPDO. The first isDestination Address Mode (DAM) PDOThe second isSource Address Mode (SAM) PDO

The devices that support ANope for receiving MPDO areMPDO consumers, the C that supports sending MPDOs isMPDO Producer

Sending MPDOs is event driven, timed, remote request and synchronized trigger modes are not supported

addressing mode
  • Destination Address Mode (DAM): a DAM-MPDO can be received simultaneously by all consumers of that MPDO (Similar to broadcasting) and no answer. If the object does not exist, an EMCY frame is generated.
  • Source Address Mode (SAM):
MPDO Read and Write

MPDO Write

parameters Request/execution Response/Acknowledgement
PDO No. obligatory
Address Type obligatory
Node-ID obligatory
Multiplexer obligatory
digital obligatory

image

SDO

specificities

big and slow

transfer mode
transfer mode summarize response mode
fast transfer Since the data is less than or equal to 4 bytes, one frame is enough to send it without segmentation. lit. one frame, one answer (idiom); fig. a series of questions and answers
segmentation Split the data into segments and send each segment in a separate frame every frame and every answer
block transfer Combine multiple segments into a sub-block, each sub-block is sent before the answer signal is accepted, and all sub-blocks form the block Per sub-block per answer

Fast transfer mode:Only one data sending and answering is needed to complete the data transmission, which is efficient, but the amount of data transmitted is small.

Segment Transmission:The data is divided into segments, each of which can contain up to 7 bytes of data. This mode is simpler to implement and is suitable for medium-length data transfers.

Block Transfer:Block transfer mode handles larger amounts of data and improves transfer efficiency compared to segment transfer mode. Data is divided into blocks, each of which can contain multiple segments. Block transfer also has a checksum mechanism to ensure data integrity and reliability.

For a detailed explanation of the protocol, see Or CiA301 Chinese Manual 43 pages

SYNC

  • Synchronized Producer Periodic Broadcastsynchronized object(SYNC)。
  • SYNC provides a basic network synchronization mechanism that follows the production-consumption model. there is no answer from this service.
  • Transmit 1 byte counter (optional)

TIME

  • TIME Producer Regular Broadcasttimestamp object(TIME)。
  • TIME provides simple network clocks. the CANopen device calibrates the local time with a timestamp object.
  • Transmits a 6-byte timestamp

EMCY

  • Emergency (EMCY) messages are triggered when a fatal error occurs inside the device
  • Sent by the application device to other devices with the highest priority. Any slave with emergency monitoring and processing capabilities will receive and process the emergency message.