CAN client for Codesys 3.5

2020-11-27
2020-11-28
  • johnhastech

    johnhastech - 2020-11-27

    Hi All,

    I need to log into a Codesys 3.5 PLC via CANbus (CR711S). The manufacturer is ifm Electronic GmbH. The release notes state that it is possible to do so, but a PCAN-USB adapter must be used for stable connection. It also says that the CAN client must be added to the Codesys gateway configuration as a top level interface.

    I have a PCAN-USB adapter, and from what I can see in my Windows device manager, the service for the adapter is 'PEAK_USB'. I have added this as a CAN client to my gateway configuration as a top level interface.

    At this point I expected to see CAN as an option when adding a gateway for communication, but instead I only have the default TCP/IP on port 1217 available.

    Could anyone help with this?

    Thanks in advance!

    Best regards,
    John

     
  • eschwellinger

    eschwellinger - 2020-11-28

    Hi John,
    i would expect that IFM has a good description for doing this with their PLC.

    If think you need to uncomment the following lines in:
    c:\ProgramData\CODESYS\CODESYSGatewayV3\18061919\Gateway.cfg

    [ComponentManager]
    ;--> Additional components for CmpBlkDrvCanClient
    Component.1=CmpBlkDrvCANClient
    Component.2=CmpCAASdoClient
    Component.3=CmpCAACanL2
    Component.4=CmpPCANBasicDrv
    ;Component.5=CmpCANFoxDrv
    ;Component.6=CmpIxxatCANDrv
    ;<-- Additional components for CmpBlkDrvCanClient
    ;--> Additional components for CmpBlkDrvUsb
    ;Component.6=CmpUsbMpdUsbLib
    ;<-- Additional components for CmpBlkDrvUsb

    [CmpBlkDrvCanClient]
    CycleTimeMs=1
    NumChannels=1 ; Number of block driver instances
    0.Name=BlkDrvCanClient
    0.NetId=0 ; CANbus Network Id (0..n)
    0.Baudrate=1000 ; CANbus Baudrate in kbit/s
    0.NodeId=1 ; unique NodeId
    0.BlockTransfer=1 ; Use block transfer for more performance

    [CmpCAASdoClient]
    MaxSegmentsPerCycle=0 ; for block download: maximum of sent segments per cycle; 0 means infinity

    BR
    Edwin

     
    πŸ‘
    1

Log in to post a comment.