CanRcvMsg
Function block - Receive a CANbus message.
Inputs
Input |
Data type |
Description |
PORT |
STRING |
CAN port identification (see remarks). |
DATA |
USINT[] |
CAN data (filled on output) - array size must be 64. |
Outputs
Output |
Data type |
Description |
OK |
BOOL |
TRUE if successful. |
ID |
DWORD |
CAN message ID. |
LEN |
DINT |
CAN message data length. |
Remarks
This function gets the next received message since the last cycle. Only messages with IDs not configured in the CANbus configuration are received by this block.
The number of messages possibly received within one cycle is limited by the FIFO size defined in the CANbus configuration.
The PORT input defines a CAN bus configured:
- if you specify an empty string, then the first CAN port configured is selected
- if you specify a string containing a number, it relates to the corresponding port. For instance, '2' mens the second port
- you can also specify the string entered as "port settings" in the CANbus configuration, e.g. 'CAN0'
CanRcvMsg |
IEC 61131-3 Automation platform > Programming - Reference guide > Advanced operations > CanRcvMsg |
Created with the Personal Edition of HelpNDoc: Step-by-Step Guide: How to Turn Your Word Document into an eBook