Skip to main content
Search

Runtime Configuration

Installing a PCAN USB Adapter

Tip

The component CmpPCANBasicDrv is based on the PCAN Basic API, which supports the USB dongle and other hardware. See the company homepage of "PEAK System" for additional information.

Support for the PCAN Basic API is implemented only for CODESYS Control Win V3 and CODESYS Gateway V3.

Procedure. To do this, follow the steps below:
  1. Download the driver from the manufacturer website and install it on the Windows operating system.

  2. Open the PLC configuration file CODESYSControl.cfg in a text editor. This file is located in the CODESYS installation directory \GatewayPLC.

    If you want to use the CODESYS Gateway V3, then open Gateway.cfg.

  3. Add the following lines to the section [ComponentManager]: Component.X=CmpPCANBasicDrv.

    Check that the component numbers X (X=1,2,3, …) are sequential without any missing numbers.

  4. Save the changes and close the editor.

  5. Start the runtime system.

    CODESYS shows the detected PCAN hardware and the respective CAN network number in the PLC logger.

  6. Type the CAN network number in Network of the CANbus General tab.

Installing a Sontheim USB Adapter

Tip

The component CmpCANFoxDrv is based on the Sontheim MT API, which supports the USB dongle and other hardware. See the company homepage of "Sontheim Industrie Elektronik GmbH" for additional information.

Support for the MT API is implemented only for CODESYS Control Win V3 and CODESYS Gateway V3.

Procedure. To do this, follow the steps below:
  1. Download the driver from the manufacturer website and install it on the Windows operating system.

  2. Open the PLC configuration file CODESYSControl.cfg in a text editor. This file is located in the CODESYS installation directory \GatewayPLC.

    If you want to use the CODESYS Gateway V3, then open Gateway.cfg.

  3. Add the following lines to the section [ComponentManager]: Component.X=CmpCANFoxDrv.

    Check that the component numbers X (X=1,2,3, …) are sequential without any missing numbers.

  4. Save the changes and close the editor.

  5. Start the runtime system.

    CODESYS shows the detected MT API hardware (example: CANfox) and the respective CAN network number in the PLC logger.

  6. Type the CAN network number in Network of the CANbus General tab.

Installing an Ixxat USB Adapter

Tip

The CmpIxxatCANDrv component is based on the Ixxat VCI V4 API, which supports the USB dongle and other hardware. See the company homepage of "HMS Industrial Networks" for additional information.

Support for the Ixxat VCI V4 API is implemented only for CODESYS Control Win V3 and CODESYS Gateway V3.

Procedure. To do this, follow the steps below:
  1. Download the driver from the manufacturer website and install it on the Windows operating system.

  2. Open the PLC configuration file CODESYSControl.cfg in a text editor. This file is located in the CODESYS installation directory \GatewayPLC.

    If you want to use the CODESYS Gateway V3, then open Gateway.cfg.

  3. Add the following lines to the section [ComponentManager]: Component.X=CmpIxxatCANDrv.

    Check that the component numbers X (X=1,2,3, …) are sequential without any missing numbers.

  4. Save the changes and close the editor.

  5. Start the runtime system.

    CODESYS shows the detected Ixxat hardware and the respective CAN network number in the PLC logger.

  6. Type the CAN network number in Network of the CANbus General tab.

Installing a Kvaser USB Adapter

Tip

The CmpKvaserCANDrv component is based on the Kvaser CANBus-API (CANlib), which supports the USB dongle and other hardware. See the company homepage of Kvaser (www.kvaser.com) for additional information.

Support for the Kvaser API is implemented only for CODESYS Control Win V3 and CODESYS Gateway V3.

Procedure. To do this, follow the steps below:
  1. Download the driver from the manufacturer website and install it on the Windows operating system.

  2. Open the PLC configuration file CODESYSControl.cfg in a text editor. This file is located in the CODESYS installation directory \GatewayPLC.

    If you want to use the CODESYS Gateway V3, then open Gateway.cfg.

  3. Add the following lines to the section [ComponentManager]: Component.X=CmpKvaserCANDrv.

    Check that the component numbers X (X=1,2,3, …) are sequential without any missing numbers.

  4. Save the changes and close the editor.

  5. Start the runtime system.

    CODESYS shows the detected Kvaser hardware and the respective CAN network number in the PLC logger.

  6. Type the CAN network number in Network of the CANbus General tab.

Installing an SJA1000 Controller

The CODESYS Control Win V3 runtime system supports the generic driver "CmpSJACanDrv", which is based on the CAN controller SJA1000.

After the adapter is installed, the respective drivers have to be installed from the "W2K_XP_Drivers" directory (in the RTE installation directory).

Procedure. To do this, follow the steps below:
  1. Open the RTE configuration file CODESYSControl.cfg in a text editor. This file is located in the CODESYS installation directory \Gateway PLC.

  2. Add the following lines to the section [ComponentManager]: Component.X=CmpSJACanDrv.

    Check that the component numbers X (X=1,2,3, …) are sequential without any missing numbers.

  3. Save the changes and close the editor.

See the document "CODESYSControlRTEV3_Manual.pdf" for a detailed description of the parameters.

Tip

The RTE settings can also be edited in the RTE configuration dialog.

Installing an EtherCAT/CAN Gateway EL6751

Tip

The functionality is available only with a CANopen Master/Slave EL6751 terminal, not with a CANopen Slave EL6751-0010 terminal.

Procedure. To do this, follow the steps below:
  1. Install the EtherCAT package.

  2. Open the PLC configuration file CODESYSControl.cfg in a text editor. This file is located in the CODESYS installation directory \GatewayPLC.

  3. Add the following lines to the section [ComponentManager]: Component.X=CmpEL6751CanDrv.

    Check that the component numbers X (X=1,2,3, …) are sequential without any missing numbers.

  4. Save the changes and close the editor.

  5. In the project, insert the EtherCAT Master.

  6. Run a device scan on the EtherCAT Master. If the hardware is not available to you, then you can also manually insert the device descriptions.

    CODESYS finds the EL6751 terminal.

  7. Select a CAN minidriver device description.

    Important

    Do not select the original device description from Beckhoff. Instead, a CAN minidriver device description is required. This device description is provided with the EtherCAT package.

    The number of messages indicates the maximum number of CAN messages which can be received or sent per cycle (this means how many messages are tunneled via the EtherCAT per frame).

  8. Insert the scanned devices.

  9. Now you can insert a CAN-based stack below the CANbus node, such as CANopenManager, CANopenDevice, or J1939Manager. Then you can use them as usual. In the CANbus node, you can only change the baud rate. The network ID is assigned automatically at runtime. Alternatively, you could also address the CAN via CL2 or CAN-API.

    Note

    You can get the network ID for opening the driver by means of the corresponding function block.

    You should set the EtherCAT bus task so that it is fast enough. For example, if you want to send or receive CAN messages in a 4ms interval, you should set the bus cycle task to at least 4ms (or faster is even better) to be able to maintain the send interval.