Cm598CanMsgRecMult
(FB)
FUNCTION_BLOCK PUBLIC FINAL Cm598CanMsgRecMult EXTENDS AC500_StateMachine.AbbETrig3
Function Block which is used to read the specified number CAN message data of the desired CAN Identifier that where received by the CAN interface specified with input Device. In order to receive any CAN message, the CAN protocol and a receive buffer for the desired CAN ID have to be configured in the PLC Application. The function block behavior is implemented according to the ETrig Function Block. It reads the messages directly (blocking) from the receive buffer.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
Execute
BOOL
FALSE
A rising edge starts the operation, the output Busy goes to TRUE. In the first cycle all other inputs are read and stored, afterwards they are ignored. A falling edge does not stop the operation. After Done = TRUE or Error = TRUE and Execute = FALSE all outputs will be reset.
AbbETrig3
Output
Done
BOOL
FALSE
Operation is completed without error (while outputs Busy and Error are FALSE). This output is TRUE for at least one cycle or until Execute is set to FALSE
AbbETrig3
Busy
BOOL
FALSE
Operation is running (while outputs Done and Error are FALSE)
AbbETrig3
Error
BOOL
FALSE
Operation is stopped with error (while outputs Busy and Done are FALSE). This output is TRUE for at least one cycle or until Execute is set to FALSE. The output ErrorID gives more details about the error.
AbbETrig3
Input
Device
IDeviceCM598Can
0
Instance of CM598Can device
CanId
UDINT
0
CAN Identifier, “base frame format” (11bit, CAN 2.0A) or “extended frame format” (29bit, CAN 2.0B) can be used
IdExt
BOOL
FALSE
if FALSE CanId is in “base frame format”, if TRUE CanId is in “extended frame format”
CanMsgData
POINTER TO Cm598CanMessageDataType
0
Pointer to buffer to store the data of n CAN messages. The size must be at least NumCanMsg * sizeof(Cm598CanMessageDataType).
NumCanMsg
UDINT
0
Number of messages to read, minimum value is 1
Output
ErrorID
ERROR_ID.NO_ERROR
Error code that describes the occured error
NumCanMsgRead
UDINT
0
Actual number of message data that were stored in buffer CanMsgData
Num
UINT
0
Number of CAN messages currently stored in the receive buffer
NumRec
UDINT
0
Total number of received CAN messages with the specified identifier
NumRej
UDINT
0
Total number of rejected CAN messages with the specified identifier
NumOwr
UDINT
0
Total number of overwritten CAN messages with the specified identifier