NI-Embedded CAN for RIO

Content Type
Programming Language
Current manual

CAN Read VI

CAN Read VI

Owning Palette: Embedded CAN for RIO VIs

Reads a CAN frame on the bus.

When the Auto Start? property is TRUE and a session has not been started, running this VI starts the session automatically.

This VI is optimized for real-time performance. This VI executes quickly and avoids access to shared resources that can induce jitter on other VI priorities.

interface object in specifies the refnum of the interface to read.
timeout specifies the maximum time, in seconds, that the VI waits for a frame to become available. The default is 0. If timeout is negative, this VI waits indefinitely for a frame to become available.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
interface object out returns the refnum of interface object in.
CAN frame returns elements that represent the received frame.
identifier returns the CAN frame arbitration identifier. If extended? is TRUE, the 29 bits of identifier are valid. If extended? is FALSE, the 11 bits of identifier are valid.
extended? returns whether identifier uses extended format or standard format. If extended? is TRUE, identifier uses the extended format. If extended? is FALSE, identifier uses the standard format.
type returns the frame type in decimal value.

0CAN Data—The CAN data frame contains payload data. This is the most commonly used frame type for CAN.
1CAN Remote—A CAN remote frame. An ECU transmits a CAN remote frame to request data for the corresponding identifier. Your application can respond by writing a CAN data frame for the identifier.
payload returns the data bytes in the CAN data frame. The array size indicates the received frame value payload length. According to the CAN protocol, this payload length range is 0–8.

For a received remote frame, the payload length in the frame value specifies the number of payload bytes requested. Use payload with the requested number of bytes to provide this payload length to your application. You can use the payload array size, but you must ignore the actual values in the payload bytes.
timestamp returns the time depending on receive queue size of the CAN Create Interface VI. If receive queue size is greater than five, timestamp returns the time, in microseconds, that the NI-Embedded CAN for RIO software receives the frame from CAN bus. If receive queue size is five, timestamp returns the time, in microseconds, that you use the CAN Read VI.
error out contains error information. This output provides standard error out functionality.
Was this information helpful?