Читать книгу Engineering Autonomous Vehicles and Robots - Shaoshan Liu - Страница 38
2.4.4 Communication Models
ОглавлениеCAN bus, the data link layer of CANopen, can only transmit short packages consisting of an 11-bit identifier, a remote transmission request (RTR) bit and 0–8 bytes of data. The CANopen standard divides the 11-bit CAN frame identifier into a 4-bit function code and 7-bit CANopen node ID. This limits the number of devices in a CANopen network to 127 (0 being reserved for broadcast). An extension to the CAN bus standard (CAN 2.0 B) allows extended frame identifiers of 29 bits but in practice CANopen networks big enough to need the extended identifier range are rarely seen. In CANopen the 11-bit identifier of a CAN-frame is known as a communication object identifier, or COB-ID. In the case of a transmission collision, the bus arbitration used in the CAN bus allows the frame with the smallest identifier to be transmitted first and without a delay. Using a low code number for time critical functions ensures the lowest possible delay.
Different kinds of communication models are used in the messaging between CANopen nodes. In a master–slave relationship, one CANopen node is designated as the master, which sends or requests data from the slaves. The NMT protocol is an example of a master–slave communication model. A client–server relationship is implemented in the SDO protocol, where the SDO client sends data (the object dictionary index and subindex) to an SDO server, which replies with one or more SDO packages containing the requested data (the contents of the object dictionary at the given index). A producer–consumer model is used in the Heartbeat and Node Guarding protocols. In the push model of producer–consumer, the producer sends data to the consumer without a specific request, whereas in the pull model, the consumer has to request the data from the producer.