XHC-WHB04-4 Python component

More
10 Mar 2019 12:24 #128225 by fixer
Since using existing C hal component for XHC Pendants are way to complicated for me, I made a simple, single file Python HAL component. I am leaving it here if anyone finds it interesting. It is first time I am working with USB on this low level, and it took me about 2 hours to get here. Python really is great!

Features:
- buttons, selector switches and MPG counts are exposed as hal pins
- It does not require usb stick to be plugged in before starting LinuxCNC. HAL pins simply stay at 0 until you plug it in.
- If usb stick gets disconnected during runtime, it silently tries to reconnect.

Requires PyUSB and libusb.

LCD display does not work. I need some help there. If anyone knows how to send packets for strings on LCD, please tell. :) Some info about this is here: forum.planet-cnc.com/viewtopic.php?f=12&t=1125
Attachments:

Please Log in or Create an account to join the conversation.

More
10 Mar 2019 17:20 #128251 by pl7i92
Replied by pl7i92 on topic XHC-WHB04-4 Python component
Why dont you simple use the internal XHC component
i added my personel mashine

there is a image inside ANLEITUNG JPG that tells you the functions
Attachments:

Please Log in or Create an account to join the conversation.

More
23 Apr 2019 18:39 #131677 by andypugh

fixer wrote: LCD display does not work. I need some help there. If anyone knows how to send packets for strings on LCD, please tell. :) Some info about this is here: forum.planet-cnc.com/viewtopic.php?f=12&t=1125


Is this component any good?

linuxcnc.org/docs/2.7/html/man/man9/lcd.9.html

(The answer is likely to be "maybe not" as it rather depends on sending one character per servo-thread, and your component runs in userspace rather than in a realtime thread)

Is there any chance that a common component could support bit XHC types?

Please Log in or Create an account to join the conversation.

More
23 Apr 2019 20:42 #131690 by fixer
Replied by fixer on topic XHC-WHB04-4 Python component

Is this component any good?

No. It is an usb transmission, it is also not realtime.
XHC expects packet for string in some weird format, it shouldn't be hard to generate it, but I didn't bother with it.

Is there any chance that a common component could support bit XHC types?

Yes, this should be simple. Different devices have different usb PIDs. I would try to connect to the first one, if that fails the script should continue to try with the other PID.

Please Log in or Create an account to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum