Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

How to Output EOB On Every NC Line


Recommended Posts

G'day

 

I'm trying to program a small Roland four axis router using MC. The control needs the NC file to have every line ending With the ASCII characters EOB (end of block). Alt69 Alt79 and Alt66 generate the EOB code, but I cannot get any post to output the code. I know I can easily use the editor to replace the code I'm getting now, (Euro sign or a square or an upside down L), but I would like to get the post to do the job. I will not be operating the machine.

image002_zpsb340c61a.jpg

 

I'm getting this:

 

%€
:0000€
(PROGRAM NAME - LTDT )€
(DATE=DD-MM-YY - 09-05-13 TIME=HH:MM - 18:33 )€
G17 G21 G90 G40 G80 G64 G49 G0 M05€
G90 M05 Z0€
X0. Y0. Z0.€
N100 T10 M06€
( 1. BALL CUTTER )€
( TOOL - 10 DIA. OFF. - 0 LEN. - 0 DIA. - 1. )€
G0 X0. Y25.€
S18000 M3€
H0 Z5.€
Z2.€
G1 Z.3 F200.€
Y0. F500.€
Y25.€
G0 Z5.€
X7.43€
Z2.€
G1 Z.3 F200.€
X11.426 F500.€
X7.43€
G0 Z5.€
X11.426€
Z2.€
G1 Z.3 F200.€
X15.421 F500.€
X11.426€
F200.€

 

I'd like to get:

 

%EOB
:0000EOB
(PROGRAM NAME - LTDT )EOB
(DATE=DD-MM-YY - 09-05-13 TIME=HH:MM - 18:33 )EOB
G17 G21 G90 G40 G80 G64 G49 G0 M05EOB
G90 M05 Z0EOB
X0. Y0. Z0.EOB
N100 T10 M06EOB
( 1. BALL CUTTER )EOB
( TOOL - 10 DIA. OFF. - 0 LEN. - 0 DIA. - 1. )EOB
G0 X0. Y25.EOB
S18000 M3EOB
H0 Z5.EOB
Z2.EOB
G1 Z.3 F200.EOB
Y0. F500.EOB
Y25.EOB
G0 Z5.EOB
X7.43EOB
Z2.EOB
G1 Z.3 F200.EOB

 

I have tried to trick the post. I've tried MCX3 and MCX5 The parameter in the control definition accepts ASCII from 0 to 255

 

Guys Can this be done?

 

John

Link to comment
Share on other sites

Create a string variable;

 

seob : "EOB" # EOB callout string #note you need minimum two spaces between "seob" and :

 

Add "seob" every where needed;

 

plinout #Output to NC of linear movement - feed

if feed = 0, test_feed = mprint(sfeedrate0)

pcan1, pbld, n$, sgfeed, sgplane, `sgcode, sgabsinc, pccdia,

pxout, pyout, pzout, pcout, `feed, strcantext, seob, e$ (<<<<<<<<<<<<<<<<<<<<<<<<<<<,

 

plinout example;

 

O4022

(3" DIA FACE MILL FOR ALUM 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N0500 G00 G90 X1.6 Y-.875 (B0.)

N0510 G08 P1

N0520 G43 H01 Z2.1 S6000 M03

N0530 G01 Z1.92 F250. EOB

N0540 X-4.6 F72. EOB

N0550 Z1.84 F250. EOB

N0560 X1.6 F72. EOB

N0570 Z1.83 F250. EOB

N0580 X-4.6 F72. EOB

N0590 G00 Z2.1

N0600 Z5.755

N0610 G08 P0

N1 M99

Link to comment
Share on other sites

Tim, Thank you for your answer. In your sample EOB has been added only to the G01 move lines. The control will error if the ASCII characters EOB are missing from any line.

 

% EOB
O0001 EOB
(PROGRAM NAME - LTD) EOB
( 1/2 STRAIGHT BIT TOOL - 1 DIA. - .5) EOB
N100T1M6 EOB
S18000M3 EOB
G0G90X-2.582Y13.463Z10. EOB
Z2. EOB
G1Z-.3F100. EOB
Y-9.537F200. EOB
X1.464 EOB
Z2.F100. EOB
G0Z10. EOB
X5.05 EOB
Z2. EOB
G1Z-.3 EOB

 

I've been trying for about two weeks before posting here, I have asked some computer programmer friends, no luck.

 

The easy way is to use the editor to replace whatever symbol I get as carriage return with the ASCII 69 79 66, without spaces. I still think there must be another way.

Link to comment
Share on other sites

Please see the picture.

I typed the ASCII value of E in the first box and O in the alternate box. Now I got EO at the end of every line. How do I get the B if there are only two boxes to type in.

 

I'm buggered.

 

Help, please!

 

%EO
O0001EO
(PROGRAM NAME - LTD )EO
( 1/2 STRAIGHT BIT TOOL - 1 DIA. - .5 )EO
N100 T1 M6EO
S18000 M3EO
G0 G90 X-2.582 Y13.463 Z10.EO
Z2.EO
G1 Z-.3 F100.EO
Y-9.537 F200.EO
X1.464EO
Z2. F100.EO
G0 Z10.EO
X5.05EO
Z2.EO
G1 Z-.3EO
Y13.463 F200.EO

 

 

 

EOB_zps62c0d422.jpg

Link to comment
Share on other sites

John,

 

I would just uncheck the alternate EOB character box and do it "the hard way". I only made the changes as shown to my post and only changed plinout for demonstration purposes so I wouldn't have to remove "seob" 500 times after the posting.

 

To add it to your post just use the search & replace function of your editor.

 

After adding the variable, search for ", e$" and replace it with ", seob, e$" (with the assumption that you have spaces between the [are they called arguments?])

 

First make a copy of your post especially before making a mass modification like this.

  • Like 1
Link to comment
Share on other sites

We haven't got X7 editor. I've been doing the replacement in the editor, which, as you, Mick, said is the easy way, however I would prefer the post to generate a finish NC file. I don't know who is going to run the machine in the future and make a mes out of the NC file in the editor.

 

Sorry if I'm fussy.

 

I'll try Tim's suggestion.

 

Thanks mates.

Link to comment
Share on other sites

Hi Tim

I tried very hard to do it your way. I did not win. I do not know what I'm doing any more. Error file was the largest I've ever seen. "Illegal character", "Label not defined". Deleted everything and opted for the easy way instead.

 


15 May 2013 02:33:05 PM - <2> - PST LINE (566) - Label has not been defined[45]
15 May 2013 02:33:05 PM - <2> - PST LINE (566) - Label has not been defined[74]
15 May 2013 02:33:05 PM - <2> - PST LINE (567) - Label has not been defined[10]
15 May 2013 02:33:05 PM - <2> - PST LINE (567) - Label has not been defined[45]
15 May 2013 02:33:05 PM - <2> - PST LINE (567) - Label has not been defined[74]
15 May 2013 02:33:05 PM - <2> - PST LINE (568) - Label has not been defined[10]
15 May 2013 02:33:05 PM - <2> - PST LINE (568) - Label has not been defined[45]
15 May 2013 02:33:05 PM - <2> - PST LINE (568) - Label has not been defined[74]
15 May 2013 02:33:05 PM - <2> - PST LINE (569) - Label has not been defined[10]
15 May 2013 02:33:05 PM - <2> - PST LINE (569) - Label has not been defined[45]
15 May 2013 02:33:05 PM - <2> - PST LINE (569) - Label has not been defined[74]
15 May 2013 02:33:05 PM - <2> - PST LINE (575) - Label has not been defined[7]
15 May 2013 02:33:05 PM - <2> - PST LINE (580) - Label has not been defined[10]
15 May 2013 02:33:05 PM - <2> - PST LINE (584) - Label has not been defined[9]
15 May 2013 02:33:05 PM - <2> - PST LINE (586) - Label has not been defined[12]
15 May 2013 02:33:05 PM - <2> - PST LINE (587) - Label has not been defined[7]
15 May 2013 02:33:05 PM - <2> - PST LINE (587) - Label has not been defined[26]
15 May 2013 02:33:05 PM - <2> - PST LINE (588) - Label has not been defined[27]
15 May 2013 02:33:05 PM - <2> - PST LINE (588) - Label has not been defined[52]
15 May 2013 02:33:05 PM - <2> - PST LINE (593) - Label has not been defined[20]
15 May 2013 02:33:05 PM - <2> - PST LINE (594) - Label has not been defined[10]


15 May 2013 02:33:05 PM - <2> - PST LINE (351) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (366) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (481) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (482) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (483) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (484) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (485) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (490) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (492) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (506) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (508) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (509) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (512) - Illegal character(s) encountered
15 May 2013 02:33:05 PM - <2> - PST LINE (514) - Illegal character(s) encountered

 

I really appreciate your help.

 

Thanks

 

John

Link to comment
Share on other sites

John,

 

did you ever try to take a file from that machine and open it with a hex editor?

I never heard of Alt69+Alt79+Alt66 as EOB marker before.

It's more likely that the 'EOB' is displayed simply as placeholder for some non-standard ASCII character.

Figure that out and the alternate EOB character method is your friend again.

 

Good luck

 

Thomas

Link to comment
Share on other sites

G'day Thomas,

 

No, I have never tried and don't have a hex editor. That is a good suggestion and I'm going to try it. What editor would you recommend?

 

Of course you've never heard of Alt69+Alt79+Alt66. I have tried so many things and done lots of research trying to output EOB at the end of NC lines, and that is one of the combinations I tried in the post. If EOB is missing from any line the control will error.

 

Some years ago another engineer and I wrote a post where ";" was needed as end of block. Here is the code with the AXCII value for ";" in a MCV8.1 post, then updated to VX2 and later to Vx5.

 

# --------------------------------------------------------------------------
# INITIALIZE - initialize system variables and define user variables
# --------------------------------------------------------------------------
arctype$ : 2	 # Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.
do_full_arc$ : 0	 #Allow full circle output? 0=no, 1=yes
getnextop$ : yes$ # Get 'next' variables? yes/no
nobrk$	 : yes$ # Omit break of rapid linear (xy, z, or z, xy)? yes/no
#CNC<<MSG-ERROR(198)>> Label is not valid for this product
#CNC<<MSG-ERROR(196)>> Label is not valid for this product
omitseq$ : no$ # Omit sequence no.?
progname$ : yes$ # Output upper case in program name
scalex$ : 1.	 # Scale factor for X	
scaley$ : 1.	 # Scale factor for Y	
scalez$ : 1.	 # Scale factor for Z	
seqmax$ : 9999 # Max. sequence no.
skipmotest$: no$	 # Skip motion test? yes/no
spaces$ : 1	 # Spaces between address
subprg$ : yes$ # Open subprogram file? yes/no
tooltable$ : yes$ # Call tool table postlines? yes/no
omitround : yes$ # Do not round NCI values in calculations?
qrtyp$	 : 2	 # Calculate UV in 4 axis as, 0=inc., 1=wq,wr, 2=abs.
omitcrlf$ : no$	 # End NC block with CR/LF
eob$	 : 34	 # ASCII character to end NC line
bldnxtool$ : 1	 # Build the taper and/or radius list
listrad$ : 1	 # Output radius list
# --------------------------------------------------------------------------

 

This section of the post is no longer in the Xposts unless the old post is updated to X.

 

Thanks for your suggestion

 

John

Link to comment
Share on other sites

Got it. Finally I got the post to generate "EOB" on every line of the NC file. It wasn't easy but I'm glad I didn't give up.

 

Got a Hex editor from the net but did nothing for me apart from learning a little more code.

I took the bull from the horns and did some manual pasting of the code 69,79,66, on every occurrence of pbld, n$, like this: changed e$ for 69,79,66, e$. and then used the debugger to fix the errors. I got a space separating the digits E O B. I don't think it's an issue. I may find another separator instead of (,).

 

I have to give credit to Tim Johnson for I used his way a little but not exactly.

 

Thank you all who help and read this thread and did not get board with it.

 

John

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...