![background image](http://html.mh-extra.com/html/ifm/ecomat-100-mobile-cr0301/ecomat-100-mobile-cr0301_programming-manual_620659071.webp)
71
ifm
Programming Manual
ecomatmobile
CabinetController (CR0301) Runtime System V05
2016-04-21
ifm function elements
ifm function elements for the device CR0301
>
CANx_RECEIVE
627
x = 1...n = number of the CAN interface (depending on the device,
→ Data sheet)
Unit type = function block (FB)
Unit is contained in the library
ifm_CR0301_Vxxyyzz.LIB
Symbol in CODESYS:
>
Description
630
CANx_RECEIVE configures a data receive object and reads the receive buffer of the data object.
The FB must be called once for each data object during initialisation, in order to inform the CAN
controller about the identifiers of the data objects.
In the further program cycle CANx_RECEIVE is called for reading the corresponding receive buffer,
also repeatedly in case of long program cycles. The programmer must ensure by evaluating the byte
AVAILABLE that newly received data objects are retrieved from the buffer and further processed.
Each call of the FB decrements the byte AVAILABLE by 1. If the value of AVAILABLE is 0, there is
no data in the buffer.
By evaluating the output OVERFLOW, an overflow of the data buffer can be detected. If
OVERFLOW = TRUE at least 1 data object has been lost.
If CAN2_RECEIVE is to be used, the second CAN interface must be initialised first using
CAN2
.
>
Parameters of the inputs
631
Parameter
Data type
Description
CONFIG
BOOL
TRUE (in the 1st cycle):
configure data object
FALSE:
during further processing of the program
CLEAR
BOOL
TRUE:
delete receive buffer
FALSE:
function element is not executed
ID
WORD
number of the data object identifier
permissible values = 0...2 047
Summary of Contents for Ecomat 100 Mobile CR0301
Page 212: ......