pass value back to o subroutine based on radiobutton setting?

More
7 years 8 months ago #126467 by IrishMoss
Thanks to andypugh's excellent example setup here: www.bodgesoc.org/lathe/lathe.html , I was able to get some pyvcp spinbox values back into my code.

Now I'm trying to implement a similar setup with a radiobutton but getting a bit/float mismatch error:
custom_postgui.hal:11: Signal 'ztype.Plate_in' of type 'bit' cannot add pin 'motion.analog-in-01' of type 'float'

So the cause of the error is obvious to me, but the solution isn't as clear (at least not for a pyvcp/python noob like myself)

Here's my current XML code:
Code:
<vbox> <relief>GROOVE</relief> <bd>2</bd> <button> <text>"Height (Z) Probe"</text> <halpin>"zprobe"</halpin> </button> <hbox> <label text="Touchplate type:"/> <radiobutton> <choices>["Plate","Tape"]</choices> <halpin>"ztype"</halpin> </radiobutton> </hbox> </vbox>

In the postgui i have:
Code:
net ztype.Plate_in pyvcp.ztype.Plate => motion.analog-in-01 net zprobe-req pyvcp.zprobe => halui.mdi-command-01
Which works fine for a spinbox value, but not a radiobutton.

Basically what I want to do is have different offset values passed back into the o code depending on which radiobutton is checked.

Please Log in to join the conversation.

More
7 years 8 months ago #126469 by andypugh
You should use the motion.digital-in pins for bit-type signals.
linuxcnc.org/docs/2.7/html/man/man9/motion.9.html

Please Log in to join the conversation.

More
7 years 8 months ago #126470 by andypugh
Also: I moved away from that screen to something a bit more flashy:
forum.linuxcnc.org/41-guis/26550-lathe-macros

Please Log in to join the conversation.

More
7 years 8 months ago #126472 by IrishMoss
so simple. :)
thanks Andy!

Please Log in to join the conversation.

Time to create page: 0.094 seconds
Powered by Kunena Forum