Call external subroutine not working in recent versions of LCNC

More
11 Feb 2019 22:51 #126229 by shipmodeller
Booting up and getting ready... will send you results

Please Log in or Create an account to join the conversation.

More
11 Feb 2019 23:00 #126230 by shipmodeller
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
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.

More
11 Feb 2019 23:10 #126231 by andypugh

shipmodeller wrote: 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
to
--------------------------------------------------
# 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.

More
11 Feb 2019 23:24 - 11 Feb 2019 23:41 #126233 by shipmodeller
How can I say this gently? .... it hosed the system, linuxCNC won't come up

When I returned the file to the original state, and # out the added line.. LinuxCNC came up

File Attachment:

File Name: custom_pos...2-11.hal
File Size:2 KB
Attachments:
Last edit: 11 Feb 2019 23:41 by shipmodeller.

Please Log in or Create an account to join the conversation.

More
12 Feb 2019 00:00 #126235 by andypugh

shipmodeller wrote: 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)
The following user(s) said Thank You: shipmodeller

Please Log in or Create an account to join the conversation.

More
12 Feb 2019 00:46 #126236 by shipmodeller
OK.. that seemed to handle the button issue. Once the change had been made to the list... The button worked right away after the HOME. So, thank you on that one.

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.

More
12 Feb 2019 00:54 - 12 Feb 2019 00:55 #126237 by andypugh

shipmodeller wrote: 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?
Last edit: 12 Feb 2019 00:55 by andypugh.
The following user(s) said Thank You: shipmodeller

Please Log in or Create an account to join the conversation.

More
12 Feb 2019 01:10 - 12 Feb 2019 15:33 #126238 by shipmodeller
The error that I get is error message: failed to find Otoolchange3 before EOF

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
Last edit: 12 Feb 2019 15:33 by shipmodeller. Reason: Spelling error and poor grammar, sorry

Please Log in or Create an account to join the conversation.

More
12 Feb 2019 20:03 - 12 Feb 2019 21:04 #126294 by shipmodeller
In order to try to figure this out, I did 5 steps, and produced a Show LinuxCNC status report from the Machine dropdown tab after each step.
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

File Attachment:

File Name: status2.txt
File Size:5 KB

File Attachment:

File Name: status1.txt
File Size:5 KB

File Attachment:

File Name: status4.txt
File Size:5 KB

File Attachment:

File Name: status3.txt
File Size:5 KB

File Attachment:

File Name: status5.txt
File Size:5 KB
Last edit: 12 Feb 2019 21:04 by shipmodeller. Reason: Found sequence that makes it work again...??????

Please Log in or Create an account to join the conversation.

More
12 Feb 2019 21:47 #126297 by shipmodeller
Solved!!!!! I think this is a defect that should be addressed by the LinuxCNC community.
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...

File Attachment:

File Name: CHECKERS12_E.NGC
File Size:5 KB
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.231 seconds
Powered by Kunena Forum