Those look useful so thanks! I'm doing the software that receives the serial data so I should able to read and process everything fast enough to not require flow control. Even if I miss a message the next update message will be good enough. I'll probably include a start of message and definitely include a checksum. Alternatively use no start of message and calculate a running checksum for the last N bytes (number determined by the coordinate accuracy desired) received and discard everything until a valid checksum is received.
-----Original Message----- From: Chris Albertson <albertson.ch...@gmail.com> Sent: December 8, 2020 12:10 PM To: Enhanced Machine Controller (EMC) <emc-users@lists.sourceforge.net> Subject: Re: [Emc-users] Sample code I wanted to do about the same thing and found this: http://linuxcnc.org/docs/html/hal/halmodule.html Also in addition to the above you will need to write to a serial port. Here is a walkthrough: https://pyserial.readthedocs.io/en/latest/shortintro.html Are you designing the USB device? If so you might want to add some protocol around the data. At least a flag value at the start and a simple crc at the end. On Tue, Dec 8, 2020 at 7:53 AM <ken.stra...@gmail.com> wrote: > I am attempting to produce a Python component which periodically > outputs X/Y/Z/A coordinates via a serial port that is actually a USB connection. > This is similar to what is required for pendants that display the > current coordinates. Can anyone suggest a tutorial or source code that > could be adapted to my needs? > > I have looked at > http://linuxcnc.org/docs/html/man/man1/xhc-hb04.1.html > but > I'm hoping for something simpler and a little easier to adapt to Python. > > > > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users > -- Chris Albertson Redondo Beach, California _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users