cancel
Showing results for 
Search instead for 
Did you mean: 

problem accessing mom_tool_axis

Pioneer
Pioneer

Hello all:

 

I am writing a 5 axis post, and want to access the A B and C angles of the tool. The documentation says that the variable mom_tool_axis (an array) holds the A B and C of the tool. But when I try to use it in a custom command, the copiler complains that it is not an array. But if I use it as a simple variable, then I get an error at run time, complaining that the variable is an array!

 

Has any one used this variable, and has an example?

 

PS.: where is there more information on these variables than what the documentation provides? Some of these topics require more than a one paragraph description of the variable...

 

Dan

19 REPLIES

Re: problem accessing mom_tool_axis

Phenom
Phenom

Did you remember this:

 

global mom_tool_axis

 

if so I have never had a prblem accessing mom_tool_axis (0) or (1) or (2).

NX10.03
Windows 7 Pro

Re: problem accessing mom_tool_axis

Pioneer
Pioneer

for example, if I write this:

 

global mom_tool_axis

 

MOM_output_literal $mom_tool_axis(0)

 

then I get an error saying "can't read mom_tool_axis(0): variable isn't array"

 

 

Re: problem accessing mom_tool_axis

Phenom
Phenom

What event? What has CAM replay to post done at that point? Everything up to the initial move may not have a tool axis yet. The review tool will help you diagnose when variables first start to be set.

NX10.03
Windows 7 Pro

Re: problem accessing mom_tool_axis

Phenom
Phenom

... In other words - this code is inside what proc and from where is that proc called? The first event that most variables are populated by cam is Start Of Program. This does not mean all variables are alive and have values yet (there.) The review tool will help know when they become available.

NX10.03
Windows 7 Pro

Re: problem accessing mom_tool_axis

Phenom
Phenom

... sorry - was a common editor of my responses. Try the code in the rapid move event - it will have the tool axis there (or I would be surprised if not.)

NX10.03
Windows 7 Pro

Re: problem accessing mom_tool_axis

Pioneer
Pioneer

Ok, to clarify, this is an error that postbuilder gives me when I try to close the editor. In other words, I open the custom command, add the mom_tool_axis stuff, and then when I try to close it, it gives me that error message saying it's not an array.

 

I've tried putting it inside the rapid move event, same result. 

 

Dan

Re: problem accessing mom_tool_axis

Phenom
Phenom

... Actually - mom_tool_axis shows up for me in start of program (I didn't realize that.) Look for Ken's routine "MOOG_Show_Globals" by searching here. It will display all variables available at the calling point.

NX10.03
Windows 7 Pro

Re: problem accessing mom_tool_axis

Pioneer
Pioneer

I searched for MOOG_Show_Globals, but nothing comes up. is it an old post?

Re: problem accessing mom_tool_axis

Pioneer
Pioneer

FOUND IT! Smiley Very Happy

Learn online





Solution Information