### CanItem – Secondary received CAN message

Block SymbolLicensing group: CANDRV

Function Description
The block is used with the CanRecv block. The uRef input of the CanItem block must be connected to the itemRef output of some CanRecv block or to the yRef output of another CanItem block.

This block shows the previous message that has passed the filter in the CanRecv block.

If more than one CanItem block is connected (directly or indirectly through the yRef output of the CanItem block already connected to the CanRecv block) then the first executed CanItem block shows the first message before the last received message (which is shown by the CanRecv block), the second executed CanItem block shows the second message before the last received message (which is shown by the CanRecv block) etc. It is strongly recommended to connect the CanItem blocks in a daisy chain. Unexpected ordering of messages may occur if the blocks are connected in a tree-like structure.

If no message has been received since start of the CAN driver, the data outputs have fallback values $\mathtt{\text{msgId}}=\mathtt{\text{-1}}$ and $\mathtt{\text{length}}=\mathtt{\text{-1}}$.

The DRDY output is set to DRDY$=\mathtt{\text{on}}$ if the message has been received during the last period, i.e. after previous execution of the CanItem block. At the same moment, the outputs msgId, data and length are updated. If there is no new data, DRDY output is set to DRDY$=\mathtt{\text{off}}$ and the data values are kept on the other outputs (msgId, data and length).

Input

 uRef Secondary received packet reference Reference

Outputs

 yRef Secondary received packet reference Reference msgId CAN message ID (COB-ID) Long (I32) data Message data (8 bytes maximum, LSB first)  $↓$-9.22337E+18 $↑$9.22337E+18 Large (I64) length Message length (number of bytes of data)  $↓$0 $↑$8 Long (I32) DRDY Received message in the last period flag Bool

2020 © REX Controls s.r.o., www.rexygen.com