Sorry to interupt here but I have written an IO driver...
The info in Codeys Forge will hopefully be very useful to me as I still need to complete some code/issue's in my driver for the Monarco Hat (see my git for the package) which is IO parameter based.
My experience in writing the IO driver is very similair in what @Viacheslav Mezentsev already mentioned, the learning curve is very steap if you do not have access to the toolkit (which I did'nt). So, it took me a great time to read up on various manuals which you can only find via google if you know what you are looking for.
Also I reversed engineered existing code examples for parameter based IO drivers, but good luck on finding them, they are rare in the wild allthough a few good examples are found within this forum. Offcourse this means that most of us enthusiasts written drivers are FB based.
If I would have had access to the Codesys developer toolkit (devkit) my expectation is that the driver was 100% working and finished by now because of the better quality in examples/documentation.
But alas, I had to do everything manualy because I do not have access to the toolkit. As earlier post explained, the toolkit purpose is to assist system integrator in creating their own runtimes (like ABB, Schneider etc) and creating their own hardware drivers and much more. As far as I know the creating of IO drivers can be achieved using embedded C or pure IEC or a mix of these.
Maybe codesys can release a smaller version of this toolkit especially for enthusiasts like me to assist in creating small but proper IO drivers without all the tedious manual labour involved. Writing the devdescr is fun but after import trying to couple it to the physical parameters is very very time consuming and error prone without proper debugging experience!
Tools/knowledge involved which I used;
- 2 * Codesys IDE simultaniously opened : 1 for Project, 1 for the Library,
- Notepad++ for editing the .devdesc.xml,
- Documentation to read up on architecture knowledge of how to setup an IO driver,
- Example code to study to understand the mechanism involved which couples the defined parameters from the xml to the codesys IO driver,
- Package manager to deploy the end result in a professional manner.
Offcourse you can download my package and study it as it 100% open source
Please visit https://github.com/Aliazzzz/Monarco-HAT-library-for-CODESYS-V3
for details on my IO driver