CanSend – Send CAN message

Block SymbolLicensing group: CANDRV
PIC

Function Description
The CanSend block sends message via CAN bus. The message content is defined by the msgId, data and length inputs and the RTR and EXT parameters. Message is sent only if the input RUN is set to RUN = on.

The block must be linked with the CanDrv driver. The driver must be configured to use the simple CAN mode (i.e. the parameter NodeMode = 256).

The block’s name must be in the form <DRV>__<blkname> (see e.g. OUTQUAD or OUTOCT blocks for details about referencing data from I/O drivers). The <blkname> part of the name has no special meaning in this case and it is recommended to keep the original CanSend.

The block supports short (11-bit) and long (29-bit) message IDs (see the EXT parameter) and RequestToReceive messages (see the RTR parameter). FD mode which allows up to 64 data bytes in a single message is not supported.

Inputs

msgId

CAN message ID (COB-ID)   0  536870911

Long (I32)

length

Message length (number of bytes of data)   0  8

Long (I32)

data

Message data (8 bytes maximum, LSB first)   -9.22337E+18  9.22337E+18

Large (I64)

RUN

Sending message is enabled

Bool

Output

iErr

Error code

Error

Parameters

RTR

Request To Receive flag  on

Bool

EXT

Extended message ID (29bits)  on

Bool

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