pass value back to o subroutine based on radiobutton setting?
- IrishMoss
- Offline
- New Member
- 
				  
		Less
		More
		
			
	
		- Posts: 19
- Thank you received: 3
			
	
						14 Feb 2019 16:03				#126467
		by IrishMoss
	
	
		
			
	
			
			 		
													
	
				pass value back to o subroutine based on radiobutton setting? was created 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:
In the postgui i have: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.
					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-01Basically 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.
- andypugh
- 
				  
- Offline
- Moderator
- 
				  
		Less
		More
		
			
	
		- Posts: 19677
- Thank you received: 4554
			
	
						14 Feb 2019 16:58				#126469
		by andypugh
	
	
		
			
	
	
			 		
													
	
				Replied by andypugh on topic pass value back to o subroutine based on radiobutton setting?			
			
				You should use the motion.digital-in pins for bit-type signals.
linuxcnc.org/docs/2.7/html/man/man9/motion.9.html
					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.
- andypugh
- 
				  
- Offline
- Moderator
- 
				  
		Less
		More
		
			
	
		- Posts: 19677
- Thank you received: 4554
			
	
						14 Feb 2019 17:00				#126470
		by andypugh
	
	
		
			
	
			
			 		
													
	
				Replied by andypugh on topic pass value back to o subroutine based on radiobutton setting?			
			
				Also: I moved away from that screen to something a bit more flashy:
forum.linuxcnc.org/41-guis/26550-lathe-macros
					forum.linuxcnc.org/41-guis/26550-lathe-macros
Please Log in or Create an account to join the conversation.
- IrishMoss
- Offline
- New Member
- 
				  
		Less
		More
		
			
	
		- Posts: 19
- Thank you received: 3
			
	
						14 Feb 2019 17:24				#126472
		by IrishMoss
	
	
		
			
	
			
			 		
													
	
				Replied by IrishMoss on topic pass value back to o subroutine based on radiobutton setting?			
			
				so simple.  
thanks Andy!
					
thanks Andy!
Please Log in or Create an account to join the conversation.
		Time to create page: 0.066 seconds	
