How to adapt Codesys Control SL to custom board

maldus512
2024-08-09
2024-08-09
  • maldus512 - 2024-08-09

    Hello everyone,
    I have been given the task to develop I/O drivers for a custom made, Linux based board to allow for Codesys applications to run and control the hardware.
    I have successfully installed Codesys Control SL for ARM/Linux and tested it with a simple demo application. Now I should start interfacing the runtime to the actual hardware; I should be able to interact with 2 RS485 serial ports, a few GPIOs and an I2C port, all of which already have the corresponding /dev/ interface in the Linux system.

    I am having trouble understanding how it should be approached. I have found sporadic references that fail to lead to a really comprehensive documentation. For example:

    • The store page (https://store.codesys.com/en/codesys-control-for-linux-arm-sl-1.html#options) mentions a "runtime package" that should allow "Integration of existing C code" and "Usage of local I/Os", which seems exactly what I need to interact with custom peripherals. I have found no further reference to Codesys-C interpop.
    • The Codesys Help page for the runtime package has a page on the "Development of Drivers" (https://content.helpme-codesys.com/en/CODESYS%20Control/rtsllinuxrbpdriverdevelopment.html) that suggests to either "Implement a function block" or "Implement I/O drivers". Those in turn lead to this page (https://forge.codesys.com/drv/io-drivers/doc/Generic/) which describes briefly an XML schema to describe new devices; unfortunately, it doesn't mention what to do with such a description (i.e. how does the runtime know about it) or how it is in any way connected to the actual hardware.

    Could anyone give me some pointers? I should also mention I have no prior experience with Codesys, so maybe I'm missing an obvious answer.

     

Log in to post a comment.