pass value back to o subroutine based on radiobutton setting?

More
14 Feb 2019 16:03 #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:
<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:
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 or Create an account to join the conversation.

More
14 Feb 2019 16:58 #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
The following user(s) said Thank You: IrishMoss

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

More
14 Feb 2019 17:00 #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 or Create an account to join the conversation.

More
14 Feb 2019 17:24 #126472 by IrishMoss
so simple. :)
thanks Andy!

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

Time to create page: 0.066 seconds
Powered by Kunena Forum