PDUs
- Updated2023-09-14
- 4 minute(s) read
PDUs
Introduction to Protocol Data Units
Protocol Data Units (PDUs) are encapsulated network data that are a way to communicate information between independent protocols, such as in a CAN-FlexRay gateway. You can think of them as containers of signals. The container (PDU) can be in multiple frames. A single frame can contain multiple PDUs.
NI-XNET supports only a one-to-one relationship between frames and PDUs for CAN and LIN protocols, and does not support an update bit for PDUs.
Signals returned from the frame are the same as signals returned from the mapped PDU. In this case, you can deactivate the Use PDUs option in the NI-XNET Database Editor tool to hide PDUs. But if the database file contains frames with advanced PDU configuration (using a one-to-n or n-to-one relationship or update bits), the Use PDUs option cannot be deactivated.
Frames and PDUs
The frame element contains an arbitrary number of non-overlapping PDUs. A frame can have multiple PDUs, and the same PDU can exist in different frames. The following figure shows the one-to-n (one PDU in n number of frames) and n-to-one (n number of PDUs in one frame) relationships.
Signals and PDUs
A PDU acts like a container for a logical group of signals.
The following figure represents the relationship between frames, PDUs, and signals.
Protocol Data Unit Properties
Start Bit: The start bit of the PDU within the frame indicates where in the frame the particular PDU data starts.
Length: The PDU length defines the PDU size in bytes.
Update Bit: The receiver uses the update bit to determine whether the frame sender has updated data in a particular PDU. Update bits allow for the decoupling of a signal update from a frame occurrence. Update bits is an optional PDU property.
PDU Timing and Frame Timing
Because the same PDU can exist in multiple Frames, PDUs can have flexible transmission schedules. For example, if PDU A is present in Frame 1 (Timing 1) as well as in Frame 2 (Timing 2), the receiving node receives it as per the different timings of the containing frames. (Refer to the following figure.)
Programming PDUs with NI-XNET
You can use PDUs in two ways to create a session for read/write:
- Create a signal I/O session using signals within the PDU. To do this, use the signal name as you would with signals contained within a frame.
- Create an I/O session to read/write the raw PDU data. To do this, pass (in LabVIEW, wire) the PDU(s) to the special Create Session modes for PDU. These modes operate like the equivalent frame modes.
Important points to consider while programming with PDUs:
- PDUs currently are supported only on FlexRay interfaces.
- On the receive side, if the PDU has an update bit associated with it, the NI-XNET driver sets the update bit when new data is received for the particular PDU from the bus. Otherwise, if no new data is received for this PDU, the PDU is discarded. On the transmit side, the NI-XNET driver sets the update bit when it detects that new data is available for the particular PDU in the PDUs queue or table. The NI-XNET driver clears the bit if no new data is detected in the PDU queue or table. If the frame containing the PDUs has cyclic timing, even if no new data is available for any of the PDUs in the frame, the frame is transmitted across the bus with the update bits all cleared. However, if the PDU containing the frame has event timing, it is transmitted across the bus only if at least one PDU that it contains has new data (with update bit set).
- The read-only XNET Cluster PDUs Required? property is useful when programming traversal through the database, as it indicates whether to consider PDUs in the traversal.