58
ifm
System Manual
ecomat
mobile
SmartController (CR2500, CR2502) V05
CAN in the ecomatmobile controller
Description of the CAN functions
8.6
Description of the CAN functions
The CAN functions are described for use in the application program.
NOTE
To use the full capacity of CAN it is absolutely necessary for the programmer to define an exact
bus
concept
before starting to work:
•
How many data objects are needed with what identifiers?
•
How is the
ecomat
mobile
controller to react to possible CAN errors?
•
How often must data be transmitted? The functions CANx_TRANSMIT and CANx_RECEIVE must
be called accordingly.
→
chapter function CANx_TRANSMIT (
→
) and function CANx_RECEIVE (
→
►
Check whether the transmit orders were successfully assigned to CANx_TRANSMIT (FB output
RESULT) or ensure that the received data is read from the data buffer of the queue using
CANx_RECEIVE and processed in the rest of the program immediately.
To be able to set up a communication connection, the same transmission rate (baud rate) must first be
set for all participants of the CAN network. For the controller this is done using the function
CAN1_BAUDRATE (
→
page
) (for the 1st CAN interface) or via the function CAN2 (
→
page
) (for
the 2nd CAN interface).
Irrespective of whether the devices support one or several CAN interfaces the functions related to the
interface are specified by a number in the CAN function (e.g. CAN1_TRANSMIT or CAN2_RECEIVE).
To simplify matters the designation (e.g. CANx_TRANSMIT) is used for all variants in the
documentation.
NOTE
When installing the
ecomat
mobile
CD "Software, Tools and Documentation", projects with templates
have been stored in the program directory of your PC:
…\ifm electronic\CoDeSys V…\Projects\Template_CDVxxyyzz
►
Open the requested template in CoDeSys via:
[File] > [New from template…]
> CoDeSys creates a new project which shows the basic program structure. It is strongly
recommended to follow the shown procedure.
→
chapter Set up programming system via templates (
→
page
In this example data objects are exchanged with other CAN participants via the identifiers 1 and 2. To
do so, a receive identifier must exist for the transmit identifier (or vice versa) in the other participant.
Содержание Ecomat 100 ecomatmobile SmartController CR2500
Страница 1: ...System Manual SmartController CR2500 CR2502 CoDeSys V2 3 Target V05 7390667 00 03 2009 ...
Страница 6: ......
Страница 282: ......