NI-Embedded CAN for RIO

Content Type
Programming Language
Current manual

CAN Write VI

CAN Write VI

Owning Palette: Embedded CAN for RIO VIs

Transmits a CAN frame to the bus.

When the Auto Start? property is TRUE, running this VI for the first time starts the interface automatically.

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

Details  

interface object in specifies the refnum of the interface to write.
CAN frame specifies the elements that correspond to a frame value to transmit.
identifier specifies 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? specifies 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 specifies 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—CAN remote frame. Your application transmits a CAN remote frame to request data for the corresponding identifier. A remote ECU should respond with a CAN data frame for the identifier, which you can obtain using the CAN Read VI.
payload specifies the data bytes in the CAN data frame. The array size indicates the received frame value payload length. According to the CAN protocol, the 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. Specify payload with the requested number of bytes to provide the payload length to your application. You can use the payload array size, but you must ignore the actual values in the payload bytes.
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.
error out contains error information. This output provides standard error out functionality.

CAN Write Details

This VI is asynchronous, in that data is written to a hardware queue (transmit queue), but the CAN Write VI returns before the corresponding frames are transmitted onto the bus. If you need to wait for the data to transmit onto the bus, use the CAN Wait (Transmit Complete) VI. The frame is removed from the transmit queue after the frame is transmitted successfully onto the bus.

Do not write to a full transmit queue. If a queue is already full, writing more data to the queue causes a Transmit Queue Full error.

In This Section
Was this information helpful?

Previous

CAN Wait

Previous

CAN Wait