- GCode and Part Programs
- O Codes (subroutines) and NGCGUI
- Call external subroutine not working in recent versions of LCNC
Call external subroutine not working in recent versions of LCNC
- shipmodeller
- Topic Author
- Offline
- Senior Member
- Posts: 47
- Thank you received: 3
Please Log in or Create an account to join the conversation.
- shipmodeller
- Topic Author
- Offline
- Senior Member
- Posts: 47
- Thank you received: 3
1: Homed unit
2: Pressed First button ... halui.mdi-command-00 == false
3: Went to mdi tab - pressed button -> halui.mdi-command-00 == false
4: entered o<toolchange3> call in mdi window. Toolchange executed correctly
5: Pressed First Button -> halui.mdi-command-00 = true and toolchange worked
6: Loaded "Checkers.ngc"
7: Pressed first buttin -> halui.mdi-command-00 == false.. No tool change
8: Mdi panel - tried to do o<toolchange3> call -> failed ..error message failed to find Otoolchange3 before EOF
Please Log in or Create an account to join the conversation.
Booting up and getting ready... will send you results
1: Homed unit
2: Pressed First button ... halui.mdi-command-00 == false
3: Went to mdi tab - pressed button -> halui.mdi-command-00 == false
4: entered o<toolchange3> call in mdi window. Toolchange executed correctly
5: Pressed First Button -> halui.mdi-command-00 = true and toolchange worked
OK, so this so far sounds as though the subroutine call does work as long as halui.mdi-command-00 is actually driven true, and that the problem appears to be in the classic-ladder interlock.
What does the Classic Ladder system do?
What happens if you miss it out? ie change this in the postgui hal file
--------------------------------------------------
# set up the z-axis wood touchoff button
net remote-z-axis-touchoff classicladder.0.in-00 <= pyvcp.z-axis-touchoff
# set to mdi mode
# show pin
net mode halui.mode.is-mdi => classicladder.0.in-01
# wait for motion to finish Use this file if you are using the EMC2 version 2.3.x or newer.
net in_pos motion.in-position => classicladder.0.in-02
net z-touchoff classicladder.0.out-00 => halui.mdi-command-00
--------------------------------------------------
# set up the z-axis wood touchoff button
net pyvcp.z-axis-touchoff => halui.mdi-command-00
6: Loaded "Checkers.ngc"
7: Pressed first buttin -> halui.mdi-command-00 == false.. No tool change
8: Mdi panel - tried to do o<toolchange3> call -> failed ..error message failed to find Otoolchange3 before EOF
Let us skip over that last error for a moment, that sounds different...
Please Log in or Create an account to join the conversation.
- shipmodeller
- Topic Author
- Offline
- Senior Member
- Posts: 47
- Thank you received: 3
When I returned the file to the original state, and # out the added line.. LinuxCNC came up
Attachments:
Please Log in or Create an account to join the conversation.
How can I say this gently? .... it hosed the system, linuxCNC won't come up
Ah, yes. I made a silly error, the net command needs a signal
--------------------------------------------------
# set up the z-axis wood touchoff button
net z-touchoff pyvcp.z-axis-touchoff => halui.mdi-command-00
It might be useful to also halmeter motion.in-position and halui.mode.is-mdi as those seem to be the inputs to the classic ladder.
(and you still haven't explained what the CL logic is internally)
Please Log in or Create an account to join the conversation.
- shipmodeller
- Topic Author
- Offline
- Senior Member
- Posts: 47
- Thank you received: 3
Of course, nothing changed with the Load file then no button. Please note that after the load of a file, I can still Zero XY with the Buttons. I just can't call in a toolchange.
I don't understand what you meant by "didn't explain CL" I don't know what CL means, and I don't see where you asked for that... but I might have missed that.
So the major problem now is the File load disables both mdi and button firing of toolchange.
And I just now have upgraded to the latest patch .. 4559
Please Log in or Create an account to join the conversation.
Of course, nothing changed with the Load file then no button.
I don't think that there is any "of course" about that.
Do you definitely see halui.mdi-command-00 go true with nothing else happening?
I don't understand what you meant by "didn't explain CL" I don't know what CL means, and I don't see where you asked for that... but I might have missed that.
CL == Classic Ladder. You have some ladder logic in your original HAL file, but haven't told us what it does.
So the major problem now is the File load disables both mdi and button firing of toolchange.
And I just now have upgraded to the latest patch .. 4559
Does nothing at all happen, or do you get the error that you showed earlier?
Please Log in or Create an account to join the conversation.
- shipmodeller
- Topic Author
- Offline
- Senior Member
- Posts: 47
- Thank you received: 3
I'm sorry about the CL issue, I didn't write that portion.. I modified the toolchange code, but the HAL stuff was copied, and copied.. I'm retired, been a coder of 53 years.. but now, just want to use the stuff... this used to work in previous versions before the 2.8 update. So, still feel strongly like something is changing ownership rights.. but I don't know how to drill down to find this, or how to setup any logs useful for this group to solve this.
If you think something in the CL is hosing this, then just tell me what file it is that sets that up, and I'll push it .. otherwise, I need to close up shop for night.. been a very long day
Please Log in or Create an account to join the conversation.
- shipmodeller
- Topic Author
- Offline
- Senior Member
- Posts: 47
- Thank you received: 3
1:Bootup and set the Machine Enable button
2: Home machine
3: Hit the Toolchange button
4: Load program
5: Hit the Toolchange button again - fail.
I then did a file compare between each one. The last one showed an interperter_error_code 5, motion_mode went back to coord and state reflecting rcs_error. ANY assistance or suggestions are welcome.
Ok .. now for the big clue... to someone... if I now, after the failure, go back to the preloaded file, /usr/share/axis/images/axis.ngc, then the toolchange button works again... tell me why???? When I reload another file, the button stops working again
Please Log in or Create an account to join the conversation.
- shipmodeller
- Topic Author
- Offline
- Senior Member
- Posts: 47
- Thank you received: 3
Tearing my hair out, but here is what I did.
Went into the file, and the Gcode files all had a % symbol in the start, and a % symbol in the end. This did not result in any error being displayed anywhere on the screen, and these files ran without a hitch. But it would kill the HAL button with file attached, which is the Z Touch button, with the error "Otoolchanged not found before EOF" when I hit the button.
I knew all this worked well in version 2.7.3 .. so, I created a small file, with just the % and %.. sure enough.. failure. I removed the % out of my files, pushed a M2 code at the end, and Wolla! The buttons worked as advertised.
My files with the leading % and trailing % was the issue.... I can adjust the gcode generator in MasterCamX now, and that should handle this. But boy, what a bear to find. I am including one of the thousands of files that failed this scenario. File will still run, it just kills that toolchange button. Sure would like someone to confirm this for me, and add it as a defect...
Please Log in or Create an account to join the conversation.
- GCode and Part Programs
- O Codes (subroutines) and NGCGUI
- Call external subroutine not working in recent versions of LCNC