- Posts: 2180
- Thank you received: 905
ATC Project - Debug phase
- spumco
- Offline
- Platinum Member
-
Less
More
4 years 3 months ago #246556
by spumco
Replied by spumco on topic ATC Project - (Remap Phase)
That Magic Comment was pure magic. Thanks Andy.
Ok, so I can now read the global named parameter values. More importantly, they change when I load a tool in the spindle with the on-screen button. Load tool #2, and #<_tool_in_spindle> = 2. So far, so good.
Problem the next is if I change to a local named parameter, #<tool_in_spindle. Maybe I'm misunderstanding, but this should be what stdglue & remap passes from the global to local named parameter(s). In the sample toolchange.ngc file, there's the following:
;assign the variables passed by M6 to some parameters
#100 = #<selected_tool>
#110 = #<tool_in_spindle>
#120 = #<selected_pocket>
Those local named parameters aren't defined anywhere else, so they must (?) be coming from stdglue. Right?
If that's the case then stdglue isn't actually working, which is why I keep getting the Named parameter #<selected_pocket> not defined error when I try to unload the spindle to the ATC. That particular ngc file simply calls T0 M6, which in turn references the toolchange.ngc file.
And if I set tool #4 to pocket #4 then load it in the spindle (via gui button), #<_selected_pocket> changes to 4. So LCNC is working, and the global parameters are updating.
But stdglue/remap isn't passing the global parameters to the local named parameters in the various ngc files.
INI file path error? Thought I had that fixed, but maybe it needs a relative vs. absolute path to the python folder?
[PYTHON]
# ***leave the following commented out unless you are using the ATC macros***
TOPLEVEL = /home/mill/linuxcnc/configs/HAL_rev32_ATC/python/toplevel.py
PATH_APPEND = /home/mill/linuxcnc/configs/HAL_rev32_ATC/python/
LOG_LEVEL = 8
Ok, so I can now read the global named parameter values. More importantly, they change when I load a tool in the spindle with the on-screen button. Load tool #2, and #<_tool_in_spindle> = 2. So far, so good.
Problem the next is if I change to a local named parameter, #<tool_in_spindle. Maybe I'm misunderstanding, but this should be what stdglue & remap passes from the global to local named parameter(s). In the sample toolchange.ngc file, there's the following:
;assign the variables passed by M6 to some parameters
#100 = #<selected_tool>
#110 = #<tool_in_spindle>
#120 = #<selected_pocket>
Those local named parameters aren't defined anywhere else, so they must (?) be coming from stdglue. Right?
If that's the case then stdglue isn't actually working, which is why I keep getting the Named parameter #<selected_pocket> not defined error when I try to unload the spindle to the ATC. That particular ngc file simply calls T0 M6, which in turn references the toolchange.ngc file.
And if I set tool #4 to pocket #4 then load it in the spindle (via gui button), #<_selected_pocket> changes to 4. So LCNC is working, and the global parameters are updating.
But stdglue/remap isn't passing the global parameters to the local named parameters in the various ngc files.
INI file path error? Thought I had that fixed, but maybe it needs a relative vs. absolute path to the python folder?
[PYTHON]
# ***leave the following commented out unless you are using the ATC macros***
TOPLEVEL = /home/mill/linuxcnc/configs/HAL_rev32_ATC/python/toplevel.py
PATH_APPEND = /home/mill/linuxcnc/configs/HAL_rev32_ATC/python/
LOG_LEVEL = 8
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
4 years 3 months ago - 4 years 3 months ago #246564
by andypugh
Replied by andypugh on topic ATC Project - (Remap Phase)
Does your [RS274_NGC]REMAP line reference routines from stdglue (for example change_prolog)?
(I looked back a couple of pages, but didn't see it)
You need toplevel.py file containing "import remap", and a remap.py that contains "from stdglue import *" too.
(I looked back a couple of pages, but didn't see it)
You need toplevel.py file containing "import remap", and a remap.py that contains "from stdglue import *" too.
Last edit: 4 years 3 months ago by andypugh.
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
-
Less
More
- Posts: 2180
- Thank you received: 905
4 years 3 months ago #246583
by spumco
Replied by spumco on topic ATC Project - (Remap Phase)
I think it does, but I've attached it here in case I've overlooked something.
python folder contains:
toplevel.py (one line = import remap)
remap.py (one line = from stdglue import *)
stdglue.py (previolusly attached)
python folder contains:
toplevel.py (one line = import remap)
remap.py (one line = from stdglue import *)
stdglue.py (previolusly attached)
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
4 years 3 months ago #246588
by andypugh
Replied by andypugh on topic ATC Project - (Remap Phase)
Yes, it looks to be there.
Maybe put some "print("hello") lines in the prolog just to be sure the file is running, and that the file you think is running is running.
Maybe put some "print("hello") lines in the prolog just to be sure the file is running, and that the file you think is running is running.
The following user(s) said Thank You: spumco
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
-
Less
More
- Posts: 2180
- Thank you received: 905
4 years 3 months ago #246591
by spumco
Replied by spumco on topic ATC Project - (Remap Phase)
Thanks. Where exatly should I put the 'print' statement? I tried in a few places in stdglue.py and LCNC hung up while starting:
def change_prolog(self, **words):
print("hello prolog")
try:
# this is relevant only when using iocontrol-v2.
if self.params[5600] > 0.0:
if self.params[5601] < 0.0:
self.set_errormsg("Toolchanger hard fault %d" % (int(self.params[5601])))
return INTERP_ERROR
print("change_prolog: Toolchanger soft fault %d" % int(self.params[5601]))
LCNC took way longer to load, and threw error "No message text set"
Side Note:
More fiddling with everything right now, and I may have made a bit of progress. After combing through a bunch of example configs I discovered that some of the numbered parameters referenced in my toolchange.ngc were missing from the linuxcnc.var file.
Specifically, #5170 and #5171, plus #5202-#5207. #5170 is the current pocket value, and #5171 is ATC is homed, and the others are pocket numbers #13-#18 (example only has 12).
I assumed those would have been created by LCNC on startup, but I guess not. Didn't find any breadcrumbs left in the example file(s) stating "you have to manually create xxx parameters".
So I manually added those parameters with value = 0 and I'm getting some new behavior:
def change_prolog(self, **words):
print("hello prolog")
try:
# this is relevant only when using iocontrol-v2.
if self.params[5600] > 0.0:
if self.params[5601] < 0.0:
self.set_errormsg("Toolchanger hard fault %d" % (int(self.params[5601])))
return INTERP_ERROR
print("change_prolog: Toolchanger soft fault %d" % int(self.params[5601]))
LCNC took way longer to load, and threw error "No message text set"
Side Note:
More fiddling with everything right now, and I may have made a bit of progress. After combing through a bunch of example configs I discovered that some of the numbered parameters referenced in my toolchange.ngc were missing from the linuxcnc.var file.
Specifically, #5170 and #5171, plus #5202-#5207. #5170 is the current pocket value, and #5171 is ATC is homed, and the others are pocket numbers #13-#18 (example only has 12).
I assumed those would have been created by LCNC on startup, but I guess not. Didn't find any breadcrumbs left in the example file(s) stating "you have to manually create xxx parameters".
So I manually added those parameters with value = 0 and I'm getting some new behavior:
- If I reference the ATC, the GUI is now reading the parameters and displaying tool icons in the pockets (wasn't before, ATC widget was empty)
- the display widget pocket #'s dont match the var file, but at least there's some response from the screen
- If I adjust the parameter values in the var file, on startup the values are being displayed on the screen widgets and DROs
- i.e. change #5231 (tool in spindle) to 1, and #5190 (pocket 1 tool number) to 0, on startup the animation widget shows pocket 1 as empty and T1 in the spindle
- Still getting Named parameter #<selected_pocket> not defined, but
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
4 years 3 months ago - 4 years 3 months ago #246612
by andypugh
That's not as useful as it could be, but does tell us both that the file is being run, and that it is the version of the file that you think it is.
Replied by andypugh on topic ATC Project - (Remap Phase)
Thanks. Where exatly should I put the 'print' statement? I tried in a few places in stdglue.py and LCNC hung up while starting:
That's not as useful as it could be, but does tell us both that the file is being run, and that it is the version of the file that you think it is.
Last edit: 4 years 3 months ago by andypugh.
Please Log in or Create an account to join the conversation.
Time to create page: 0.366 seconds