How to read signal state in g-code program
- aleksamc
- 
				 Topic Author Topic Author
- Offline
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 568
- Thank you received: 67
			
	
						16 Feb 2021 09:25				#199030
		by aleksamc
	
	
		
			
	
			
			 		
													
	
				How to read signal state in g-code program was created by aleksamc			
			
				If I want to read value of the pin from G-code, I type
#<_hal[pinname]>
But when I want to read signal name (not pin), when I type
(debug, #<_hal[signal_name>]>) and signal is true or false, I get ####
How to read binary signal name in G-code?
					#<_hal[pinname]>
But when I want to read signal name (not pin), when I type
(debug, #<_hal[signal_name>]>) and signal is true or false, I get ####
How to read binary signal name in G-code?
Please Log in or Create an account to join the conversation.
- aleksamc
- 
				 Topic Author Topic Author
- Offline
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 568
- Thank you received: 67
			
	
						16 Feb 2021 12:35				#199058
		by aleksamc
	
	
		
			
	
			
			 		
													
	
				Replied by aleksamc on topic How to read signal state in g-code program			
			
				Ok, it seems that signal value gets the same as pin value, I made only simple mistake in writing [].			
					Please Log in or Create an account to join the conversation.
- andypugh
- 
				  
- Online
- Moderator
- 
				  
		Less
		More
		
			
	
		- Posts: 19677
- Thank you received: 4554
			
	
						24 Feb 2021 12:45				#199972
		by andypugh
	
	
		
			
				
Note that this will (generally) return the value on the HAL pin at the moment that the G-code started.
To read live status it is a bad choice, far better then to use the G-code analogue input pins and M65 (etc)
					
	
	
			 		
													
	
				Replied by andypugh on topic How to read signal state in g-code program			
			If I want to read value of the pin from G-code, I type
#<_hal[pinname]>
Note that this will (generally) return the value on the HAL pin at the moment that the G-code started.
To read live status it is a bad choice, far better then to use the G-code analogue input pins and M65 (etc)
		The following user(s) said Thank You: aleksamc 	
			Please Log in or Create an account to join the conversation.
- aleksamc
- 
				 Topic Author Topic Author
- Offline
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 568
- Thank you received: 67
			
	
						24 Feb 2021 20:40				#200022
		by aleksamc
	
	
		
			
	
			
			 		
													
	
				Replied by aleksamc on topic How to read signal state in g-code program			
			
				Thank you very much for good advice, Andypugh.
I also wondered why I didn't get change in g-code if I change values.
					I also wondered why I didn't get change in g-code if I change values.
Please Log in or Create an account to join the conversation.
		Time to create page: 0.061 seconds	
