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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For general usage, these links might help you out. If you are looking at using I2C interfaces, examples from the Raspberry Pi will probably be useful, even if your board isn't a Raspberry Pi.
If you're developing your own drivers, I can't help you there, although the link you provided will help. If you drill in deeper, the I2C page for example shows function block and method usage, etc. Good luck!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
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.
For general usage, these links might help you out. If you are looking at using I2C interfaces, examples from the Raspberry Pi will probably be useful, even if your board isn't a Raspberry Pi.
https://content.helpme-codesys.com/en/CODESYS%20Examples/_ex_rts_serial_com.html
https://content.helpme-codesys.com/en/CODESYS%20Examples/_ex_raspberry.html
If you're developing your own drivers, I can't help you there, although the link you provided will help. If you drill in deeper, the I2C page for example shows function block and method usage, etc. Good luck!