Overview CAN Master

This function block connects IO modules of the type CAN Master. The IO modules communicate with the controller via CAN bus, therefore they can only be used with controllers that have an integrated CAN bus interface. The use of CAN adapters is not possible.

With "Create variables" the variables are created automatically. Here the corresponding variables are created using the parameters "Main group" and "Number of IO modules".

The following addresses are predefined for this:
  • Middle group 0: Analog inputs, Data type EIS5, address 1-8
  • Middle group 1: Digital outputs, Data type EIS14, Address 1-16, Output 1 = address 0, Feedback output 1 = address  1,  Output 2 = address 2, Feedback output 2 = address  3, etc.
  • Middle group 2: Digital inputs, Data type EIS1



Inputs




Outputs

TE
Received
Number of received telegrams
TG Sent Number of sent telegrams



Parameters

Number of IO modules Number of IO modules specifies the quantity when creating variables; depending on the number, a correspondingly large number of variables is created.
Main group IO Main group under which the addresses of the IO modules (analog/digital inputs and outputs) are created and addressed.
Number of IO Extensions Number of IO extensions. Determines how many extension variables are created when generating variables.
Main group Extensions Main group under which the addresses of the IO extensions are created and addressed.
Baud rate CAN bus baud rate in bit/s (e.g. 20000 for 20 kbit/s). Applied automatically to the CAN interface (can0) at start-up and after a recovery.
USB reset command Shell command used to reset (re-enumerate) a USB-CAN adapter. Leave the field empty to disable the function. If the adapter does not recover over several recovery cycles (e.g. a stuck driver, send error ENOBUFS), this command is executed automatically to avoid a power-cycle of the controller.

Example for a canable.io adapter (USB ID 1d50:606f):
usbreset 1d50:606f
Debug Enables debug output in the program log (incl. incoming and outgoing CAN frames). Enable for troubleshooting only.







See also common parameters of all function blocks.