74
ifm
System Manual
ecomat
mobile
SmartController (CR2500) V05
CAN in the ecomatmobile controller
Description of the CAN functions
8.6.9
Function CANx_RECEIVE
x = number 1...n of the CAN interface (depending on the device,
→
data sheet)
Contained in the library:
ifm_CRnnnn_Vxxyyzz.LIB
Available for the following devices:
•
CabinetController: CR0301, CR0302, CR0303
•
ClassicController: CR0020, CR0032, CR0505
•
ExtendedController: CR0200, CR0232
•
PCB controller: CS0015
•
SafetyController: CR7020, CR7021, CR7032, CR7200, CR7201, CR7232, CR7505, CR7506
Function NOT for safety signals!
(For safety signals
→
function CAN_SAFETY_RECEIVE)
•
SmartController:
CR2500
Function symbol:
CANx_RECEIVE
CONFIG
DATA
CLEAR
DLC
ID
RTR
AVAILABLE
OVERFLOW
Description
CANx_RECEIVE configures a data receive object and reads the receive buffer of the data object.
The function 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 function 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.
NOTE
If the function CAN2_RECEIVE is to be used, the second CAN interface must be initialised first using
the function CAN2 (
→
page
).