Inserting control character (escape) at end of program

Having problems with or questions about SheetCam? Post them here.
Post Reply
Bill in PA, USA
Posts: 5
Joined: Wed Feb 13, 2013 2:49 am

Inserting control character (escape) at end of program

Post by Bill in PA, USA »

Hello,

My Fagor 8020 control requires an escape character to signal the end of the program code (when coding offline). I am able to cut and paste the character in Sheetcam's code editor before sending it to the control. However, I would like the post processor to insert it for me, but I have not been able to figure out how to achieve this.

I have tried the following:

post.Text ("cutting and pasting the ESC character here\n")

post.Text ("\x1b") - The hexidecimal value for ESC

Any ideas would be greatly appreciated.

Thanks,

Bill
User avatar
Les Newell
Site Admin
Posts: 3675
Joined: Thu May 11, 2006 8:12 pm

Post by Les Newell »

post.Text() builds up a line in memory then only outputs it when it hits a carriage return. This is part of the code that suppresses empty lines and adds line numbers. Try this instead:

post.TextDirect ("\x1b")

TextDirect sends the string out immediately without any processing.
Bill in PA, USA
Posts: 5
Joined: Wed Feb 13, 2013 2:49 am

Escape character solved.

Post by Bill in PA, USA »

post.TextDirect did not work with the Hex value but did work with cutting and pasting the ESC character into the post.

Now I have code that requires no editing before sending to the control.

Problem solved.

Thank you very much!

Bill
Post Reply