- Configuring LinuxCNC
- Advanced Configuration
- ClassicLadder
- M Code => input contact in classic ladder?
M Code => input contact in classic ladder?
15 Oct 2013 09:34 #39844
by DaOne
M Code => input contact in classic ladder? was created by DaOne
I am trying to use a custom M code to give me an input conact inside classic ladder. Is this possable? If so maybe I could get an example?
Please Log in or Create an account to join the conversation.
15 Oct 2013 09:41 #39845
by DaOne
Replied by DaOne on topic M Code => input contact in classic ladder?
Just to be more clear I would be using the user defined M-codes (M100 to M199).
Please Log in or Create an account to join the conversation.
15 Oct 2013 13:54 - 15 Oct 2013 13:58 #39847
by cmorley
Replied by cmorley on topic M Code => input contact in classic ladder?
use the M code to manipulate classicladder's HAL pin(s).
From the Manual:
www.linuxcnc.org/docs/2.5/html/gcode/m-c...tml#sec:M100-to-M199
It shows an example using the parport but classicladder would be the same.
eg: setp classicladder.0.in-00 True
would set %I0 true inside classicladder.
Chris M
From the Manual:
www.linuxcnc.org/docs/2.5/html/gcode/m-c...tml#sec:M100-to-M199
It shows an example using the parport but classicladder would be the same.
eg: setp classicladder.0.in-00 True
would set %I0 true inside classicladder.
Chris M
Last edit: 15 Oct 2013 13:58 by cmorley.
Please Log in or Create an account to join the conversation.
15 Oct 2013 13:59 #39848
by DaOne
Replied by DaOne on topic M Code => input contact in classic ladder?
So the classic ladder pins can be referenced exactly the same way as hardware pins correct?
Please Log in or Create an account to join the conversation.
15 Oct 2013 14:03 #39849
by cmorley
Replied by cmorley on topic M Code => input contact in classic ladder?
As long as the classicladder pin you are wanting to change is not connected to a signal.
If it is connected to just a signal then you must manipulate the signal.
If the signal is also connected to a driving pin then you can't manipulate it because it already has a 'master'
Classicladder pins behave just like any other component' HAL pins.
If it is connected to just a signal then you must manipulate the signal.
If the signal is also connected to a driving pin then you can't manipulate it because it already has a 'master'
Classicladder pins behave just like any other component' HAL pins.
Please Log in or Create an account to join the conversation.
15 Oct 2013 14:11 #39851
by DaOne
Replied by DaOne on topic M Code => input contact in classic ladder?
If the pin has been named in hal is it still able to be used directly? I think I remember it can't be accessed from a M-code script by name correct?
Please Log in or Create an account to join the conversation.
15 Oct 2013 14:16 #39852
by cmorley
Replied by cmorley on topic M Code => input contact in classic ladder?
Not following you there: 'named in hal'
If you mean connected to a signal in the HAL file then yes you can't manipulate it directly.
see above
Or just try it.
If you mean connected to a signal in the HAL file then yes you can't manipulate it directly.
see above
Or just try it.
Please Log in or Create an account to join the conversation.
15 Oct 2013 14:43 #39855
by DaOne
Replied by DaOne on topic M Code => input contact in classic ladder?
Sorry I am trying my best to learn the lingo. I guess it would be considered a signal when to assign a " name" to the hardware pin to reference it in a more human readable form. I am very limited to trying it because the machine is 20 miles away. Is there anyway to simulate a 5i25 / 7i77 so I can load without errors on my home pc?
Please Log in or Create an account to join the conversation.
15 Oct 2013 18:10 #39866
by andypugh
It would be possible (but tedious) to create a HAL component that created all the same pins as a 5i25 but you would need a separate one for each firmware combination, and making it actually behave like a 5i25 would be a lot more work on top.
Replied by andypugh on topic M Code => input contact in classic ladder?
Not at the moment, no.Is there anyway to simulate a 5i25 / 7i77 so I can load without errors on my home pc?
It would be possible (but tedious) to create a HAL component that created all the same pins as a 5i25 but you would need a separate one for each firmware combination, and making it actually behave like a 5i25 would be a lot more work on top.
Please Log in or Create an account to join the conversation.
15 Oct 2013 18:48 - 15 Oct 2013 18:49 #39871
by BigJohnT
The easy way to test the syntax of a HAL snippet in your situation is to use Axis Sim and just create a pin with the net command.
linuxcnc.org/docs/html/hal/basic_hal.html
OR run the classicladder example and use the classicladder pin name...
JT
Replied by BigJohnT on topic M Code => input contact in classic ladder?
Sorry I am trying my best to learn the lingo. I guess it would be considered a signal when to assign a " name" to the hardware pin to reference it in a more human readable form. I am very limited to trying it because the machine is 20 miles away. Is there anyway to simulate a 5i25 / 7i77 so I can load without errors on my home pc?
The easy way to test the syntax of a HAL snippet in your situation is to use Axis Sim and just create a pin with the net command.
linuxcnc.org/docs/html/hal/basic_hal.html
net nameofmypinthatdoesnothing
in your M1xx file do something like
#!/bin/bash
halcmd setp nameofmypinthatdoesnothing True
exit 0
OR run the classicladder example and use the classicladder pin name...
JT
Last edit: 15 Oct 2013 18:49 by BigJohnT.
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- ClassicLadder
- M Code => input contact in classic ladder?
Time to create page: 0.192 seconds