Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Output a # symbol with MOM_output_literal

I am trying to output a line in a post that contains a Fanuc Custom Macro B system variable check, "IF [#4120 EQ 0] GOTO 1 (IF HEAD TOOL IS 0, SKIP TO N1)". But of course the # is a comment in TCL, so Postbuilder won't accept it in that format without an error. According to the TCL documentation that I read a \ symbol in front of the # should disable the original meaning of the #, which Postbuilder will accept but when posting it still throws an error saying the #4120 is an invalid command. Does anyone know of a way to accomplish this?

2 REPLIES
Solution
Solution
Accepted by topic author diamond3210
‎10-28-2015 10:19 AM

Re: Output a # symbol with MOM_output_literal

You need the \ in front of the "square brackets":

 

IF \[#4120 EQ 0\] GOTO1 (IF HEAD TOOL IS 0, SKIP TO N1)

You may need to remove the space after the GOTO (I think I've run across controls that don't like it)

 

 

The issue with the "#" is that "[]" means "treat the enclised text as a command". e.g.

 

set my_value [format "%.4f" $mom_pos(0)]

 

So to have the "[]" output as chanracters (instead of treating the text as a command) you have to escape them.

 

Ken

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Output a # symbol with MOM_output_literal

Perfect! Thanks Ken

Learn online





Solution Information