txCANBus

Top  Next

txCANBus


transmit CAN Bus frame

Since R2019b

 

Library: CAN Bus Controller ( Dafulai Electronics) /txCANBus

 

 

txCANBus

 

 


 

Description


 

This block transmits single CAN Data/RTR frame, and long Data frames.

 

For single Data frame, DLC is decided by Data Input vector.

For long Data frames, frame Qty is decided by Data Input vector.

 

If "Sync" is disabled in CAN_setup block, this frame (these frames) will be transmitted immediately. Otherwise, it will be transmitted after "Sync" frame.

 

Parameters


 

Please double click this block to open parameters dialog below:

 

txCANBus_parameter1

 

 

Let us explain parameters.

 

 

Object ID for multiple CAN Bus controllers — In one PC, we may use multiple CAN bus controllers, this is for identifying each one we use. It must match the same parameter in CAN_setup block.

 

Transmitted CAN ID — transmitted CAN bus frame's CAN ID. It is scalar.

 

Extended — true means "Transmitted CAN ID" is 29 bits of extended. Otherwise, it is 11 bits of standard.

 

Remote Request Frame — true means "Transmit RTR frame". Otherwise, it means "Transmit Data frame".

 

Data Type — Input Port vector's Target Data type. For single data frame, It is vector.  The element of this vector is string.  The valid string is "uint8", "uint16", "uint32", "uint64", "int8", "int16", "int32", "int64", "single", "double". It denotes "Target data type in frame data field" for each data element in input port "Data" although all elements' data type in "Data" vector is "double".  For long data frames, it is scalar string because all target data type is the same for long frames.

 

Endian for multiple bytes data type — Big-Endian or Little-Endian for "uint16"/"uint32"/"uint64"/"int16"/"int32"/"int64"/"single"/"double"

 

Long Frames — true means we will transmit long frame data. It has the same data type for long frame data.

 

The 1st frame Number — The 1st byte in data field for any long frame is frame number. For the 1st frame, the frame number can begin in number 0 or number 1.

 

The last frame DLC keeps 8 — All frames' DLC is 8 except the last frame.  The DLC of the last frame can be 8 or can be less than 8. If we keep all frames' DLC =8, the remaining data can be stuffed with 0.

 

 

 

 

Ports


 

Input

 

Data — "double" data type's vector. This data type will be changed to parameter "Data type" in the final transmitted data field. This Data vector will be transmitted out in CAN Bus data frame.

 

 

Outpot


 

None

 

Examples