- Configuring LinuxCNC
- Advanced Configuration
- ClassicLadder
- Connecting User Defined Commands to Classic Ladder Inputs
Connecting User Defined Commands to Classic Ladder Inputs
- AndrewL
- Offline
- Junior Member
Less
More
- Posts: 27
- Thank you received: 2
20 Apr 2020 20:55 #164889
by AndrewL
Connecting User Defined Commands to Classic Ladder Inputs was created by AndrewL
I have a M code, M101 which I have used to directly change an output pin. When I edit M101 to try to control classicladder inputs, I cannot. If I execute the M101 code, nothing happens and no errors are thrown. Two methods I've tried are shown below.
my M101 looks like this:
#!/bin/bash
halcmd setp TestVar01 True
halcmd setp classicladder.0.in-06 TRUE
exit 0
I have these lines in my .hal file
net TestVar01 => classicladder.0.in-05
net TestVar02 => classicladder.0.in-06
the following HAL commands were executed for further diagnostic information;
Test HAL command: setp TestVar01 True
error: parameter or pin 'TestVar01' not found
Test HAL command:setp classicladder.0.in-06 TRUE
error: pin 'classicladder.0.in-06' is connected to a signal
Test HAL command: setp classicladder.0.in-07 TRUE
success
What am I doing wrong?
my M101 looks like this:
#!/bin/bash
halcmd setp TestVar01 True
halcmd setp classicladder.0.in-06 TRUE
exit 0
I have these lines in my .hal file
net TestVar01 => classicladder.0.in-05
net TestVar02 => classicladder.0.in-06
the following HAL commands were executed for further diagnostic information;
Test HAL command: setp TestVar01 True
error: parameter or pin 'TestVar01' not found
Test HAL command:setp classicladder.0.in-06 TRUE
error: pin 'classicladder.0.in-06' is connected to a signal
Test HAL command: setp classicladder.0.in-07 TRUE
success
What am I doing wrong?
Please Log in or Create an account to join the conversation.
- cmorley
- Away
- Moderator
Less
More
- Posts: 7791
- Thank you received: 2078
20 Apr 2020 22:33 #164895
by cmorley
Replied by cmorley on topic Connecting User Defined Commands to Classic Ladder Inputs
I would add an echo command and run linuxcnc from the terminal to see it it's getting run.
You can also check permissions on the file - it must be executable.
You can also check permissions on the file - it must be executable.
Please Log in or Create an account to join the conversation.
- AndrewL
- Offline
- Junior Member
Less
More
- Posts: 27
- Thank you received: 2
21 Apr 2020 13:01 #164957
by AndrewL
Replied by AndrewL on topic Connecting User Defined Commands to Classic Ladder Inputs
I found a solution. If I eliminate all references to classicladder.0.in-06 in my hal file and let the M code change the unnamed bit it will work.
my M101 looks like this:
#!/bin/bash
halcmd setp classicladder.0.in-06 TRUE
exit 0
my M101 looks like this:
#!/bin/bash
halcmd setp classicladder.0.in-06 TRUE
exit 0
Please Log in or Create an account to join the conversation.
- cmorley
- Away
- Moderator
Less
More
- Posts: 7791
- Thank you received: 2078
21 Apr 2020 17:21 #164982
by cmorley
Replied by cmorley on topic Connecting User Defined Commands to Classic Ladder Inputs
Yes if you want to manipulate the pin directly, you can't have a signal connected.
Same idea with a signal, if you want to manipulate it directly you can't have a driving pin connected.
Chris
Same idea with a signal, if you want to manipulate it directly you can't have a driving pin connected.
Chris
The following user(s) said Thank You: AndrewL
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- ClassicLadder
- Connecting User Defined Commands to Classic Ladder Inputs
Time to create page: 0.052 seconds