Finally! Codesys PLC Interface done
- fsabbatini
- Offline
- Senior Member
-
Less
More
- Posts: 44
- Thank you received: 71
18 Jul 2026 20:46 - 18 Jul 2026 20:49 #347827
by fsabbatini
Finally! Codesys PLC Interface done was created by fsabbatini
Good afternoon eveyone!
First the video of what i have been working on and dealing with, smashing my head against the wall, too much coffee and a lot of thinking but the results are spectacular!
youtube.com/shorts/jgv-_DtneDw?si=rTl5A_pSrwuul9d2
Time for the photos:
Now the description:
We were presented with a blown $iemen$ controller and our customer wanted drivers + cnc fully replaced. Machine is a huge vertical lathe, 1200mm chuck with automatic chuck changer, real C axis (with cartesian mapping and cylindrical mapping functiones needed), X and Z axis with tool changing system for lathe or mill tools. 16 tool magazine and tool probe system. To all off this add low pressure and high pressure coolant, hydraulics, tool clamp/release system, gearbox for main spindle and tool spindle, c axis brake, gearsbox oil chillers, lube system for guides and a bunch of other systems. Also dont forget the alarms and conditions for all this systems!!!
So, in summary, he complexity was not on cnc side as most of the functions we have already solved BUT the plc logic was a no go with the actual classicladder we have been using, we needed a more robust and scalable solution. What you can see on the video is what we got!
Now to the internal workings!
First needed to solve the communication with the cnc<->plc, i wanted something similar to $inumerik where a DB exist for the NC, then DBs for each channel, each axis, each BAG (mode group) and so on...Thats exactly what was done.
After that a way to send this 1500 bytes and receive 1000 bytes from the CNC, the way i found is using Codesys NVL (network variable) system. A udp based way of sending/receiving data amongs codesys plcs, nothing that a little reverse engineer cannot solve and make it communicate with PC<->PLC.
Next problem: linux network stack, to slow for handling upd message burst so solution was given by Xenomai and RTNet! Not much info about it on the net but after some nights, coffee and wall-head-hitting, eveything went smooth.
So now i got this arquitecture:
Best regards,
Franco
First the video of what i have been working on and dealing with, smashing my head against the wall, too much coffee and a lot of thinking but the results are spectacular!
youtube.com/shorts/jgv-_DtneDw?si=rTl5A_pSrwuul9d2
Time for the photos:
Now the description:
We were presented with a blown $iemen$ controller and our customer wanted drivers + cnc fully replaced. Machine is a huge vertical lathe, 1200mm chuck with automatic chuck changer, real C axis (with cartesian mapping and cylindrical mapping functiones needed), X and Z axis with tool changing system for lathe or mill tools. 16 tool magazine and tool probe system. To all off this add low pressure and high pressure coolant, hydraulics, tool clamp/release system, gearbox for main spindle and tool spindle, c axis brake, gearsbox oil chillers, lube system for guides and a bunch of other systems. Also dont forget the alarms and conditions for all this systems!!!
So, in summary, he complexity was not on cnc side as most of the functions we have already solved BUT the plc logic was a no go with the actual classicladder we have been using, we needed a more robust and scalable solution. What you can see on the video is what we got!
Now to the internal workings!
First needed to solve the communication with the cnc<->plc, i wanted something similar to $inumerik where a DB exist for the NC, then DBs for each channel, each axis, each BAG (mode group) and so on...Thats exactly what was done.
After that a way to send this 1500 bytes and receive 1000 bytes from the CNC, the way i found is using Codesys NVL (network variable) system. A udp based way of sending/receiving data amongs codesys plcs, nothing that a little reverse engineer cannot solve and make it communicate with PC<->PLC.
Next problem: linux network stack, to slow for handling upd message burst so solution was given by Xenomai and RTNet! Not much info about it on the net but after some nights, coffee and wall-head-hitting, eveything went smooth.
So now i got this arquitecture:
Best regards,
Franco
Attachments:
Last edit: 18 Jul 2026 20:49 by fsabbatini.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
Time to create page: 0.188 seconds