No realtime serial component?
- blazini36
- Offline
- Platinum Member
Less
More
- Posts: 927
- Thank you received: 143
16 May 2024 18:58 - 16 May 2024 18:59 #300775
by blazini36
No realtime serial component? was created by blazini36
Just out of curiosity, why is there no realtime serial component? I believe it's technically possible, as low level access of the serial port is available in Linux (I'm not a software guy so take that with a grain of salt).
Was trying to think of an interface to get some simple IO into LinuxCNC but I realized the only interfaces we really have are ethernet and parallel port for realtime, ethernet is too complicated for simple things and who has a parallel port anymore? Technically every Intel CPU has a UART controller whether the serial port is exposed or not, and it's supposedly very fast. There's obviously different electrical standards that dictate the maximum baud rate but even on the slower end, if the serial port is accessed in kernel space and written as a comp it should at least not be held up by userspace tasks.
There's a serport component in LinuxCNC but it looks like it just turns serial port pins into IO pins, doesn't actually read data. Any thoughts?
Was trying to think of an interface to get some simple IO into LinuxCNC but I realized the only interfaces we really have are ethernet and parallel port for realtime, ethernet is too complicated for simple things and who has a parallel port anymore? Technically every Intel CPU has a UART controller whether the serial port is exposed or not, and it's supposedly very fast. There's obviously different electrical standards that dictate the maximum baud rate but even on the slower end, if the serial port is accessed in kernel space and written as a comp it should at least not be held up by userspace tasks.
There's a serport component in LinuxCNC but it looks like it just turns serial port pins into IO pins, doesn't actually read data. Any thoughts?
Last edit: 16 May 2024 18:59 by blazini36.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
18 May 2024 09:08 #300903
by andypugh
Replied by andypugh on topic No realtime serial component?
I have occasionally wondered the same thing.
There are Mesa card UARTs that can be used in realtime, but I have not seen anyone use the built-in serial. Mostly folk seem to use USB to Serial dongles for (non realtime) Modbus etc,
If you want to experiment, perhaps the mesa_modbus driver code could be modified to work with the onboard serial?
There are Mesa card UARTs that can be used in realtime, but I have not seen anyone use the built-in serial. Mostly folk seem to use USB to Serial dongles for (non realtime) Modbus etc,
If you want to experiment, perhaps the mesa_modbus driver code could be modified to work with the onboard serial?
Please Log in or Create an account to join the conversation.
- blazini36
- Offline
- Platinum Member
Less
More
- Posts: 927
- Thank you received: 143
19 May 2024 00:23 #300949
by blazini36
Mesa UART via the RS422 connector was the first thought but that kinda lead me down the path of "why can't I just do this with a native serial port?" Pretty much any miniPC or even an RPI will have UART pins, it's a pretty simple electrical conversion to get RS422/RS232 or even RS485 out of that, I suppose it's easier to just plug in a USB dongle but in my experience the electrical part of dealing with serial stuff has never been the hard part.
The components named "modbus" I've never really looked at as I never really use anything that supports modbus. I was looking at the modbus protocol and I'm curious if they could be used with a standard DMM servo drive. There is a modbus version of the drive but the only thing I really know that's different is it uses RS485 rather than UART. The data structure looks really similar.
Replied by blazini36 on topic No realtime serial component?
Was actually hoping you'd reply, judging by your response it sounds plausible.I have occasionally wondered the same thing.
There are Mesa card UARTs that can be used in realtime, but I have not seen anyone use the built-in serial. Mostly folk seem to use USB to Serial dongles for (non realtime) Modbus etc,
If you want to experiment, perhaps the mesa_modbus driver code could be modified to work with the onboard serial?
Mesa UART via the RS422 connector was the first thought but that kinda lead me down the path of "why can't I just do this with a native serial port?" Pretty much any miniPC or even an RPI will have UART pins, it's a pretty simple electrical conversion to get RS422/RS232 or even RS485 out of that, I suppose it's easier to just plug in a USB dongle but in my experience the electrical part of dealing with serial stuff has never been the hard part.
The components named "modbus" I've never really looked at as I never really use anything that supports modbus. I was looking at the modbus protocol and I'm curious if they could be used with a standard DMM servo drive. There is a modbus version of the drive but the only thing I really know that's different is it uses RS485 rather than UART. The data structure looks really similar.
Please Log in or Create an account to join the conversation.
Time to create page: 0.068 seconds