View Full Version : major pain
JPann 05-29-2004, 11:59 AM when downloading from machine to computer, the program has spaces after every line. It looks like this,
G0G40G80G90G54
X0Y0
M03S1200T02
G43H01Z.5
You get the idea. The entire program is this way.
Now, for anyone who has put spaces in between lines knows the next time you upload that program ther will be an eob(;)(in the macine) wherever there was a space.
How do you change this?
Not knowing machine/controller type or other transfer settings, I would look for something called strip CR/LF or something similar.
'Rekd
BrianS 05-29-2004, 12:14 PM You are probably gonna hate this answer, but I would do it easily with the "sed" editor in Linux.
sed '/^$/d' infile > outfile
Most likely you are using Microsoft 98/2000/NT/XP etc. I'm not sure if there is an easier method for a Windows platform,
(maybe with Word?). If you don't get a better solution I know you could download a version of sed that works on Windows platforms. Also the scripting language "Perl" accels at stuff like this.
http://gnuwin32.sourceforge.net/packages/sed.htm
http://www.perl.org
Hope this helps
Brian
JPann 05-29-2004, 12:21 PM The controll is a Fanuc o-m, the software is master cam v-8, and the platform is windows 2000.
I have also tried the strip line feeds, don't work -darnit!!
hardmill 05-29-2004, 03:02 PM Try a different editor, I had this problem and I believe that
was the only fix.
PEACE:D
HuFlungDung 05-29-2004, 03:23 PM You might be able to pull this editing trick off with a Hex editor, in fact I know you can, because I tried it :)
Open the file in a hex editor and do a "Replace".
Search for Hex string:
0D 0A 0D
and then replace all instances of it with:
0D
Save and close the file. All better :D
I just use the first hex editor that comes up in a google search, called a Freeware Hex Editor XVI32. It is a nice little program.
BrianS 05-29-2004, 03:41 PM I know that in Windows world the end of the lines should be OD (return) OA (linefeed) and in Unix/Linux its just OA (linefeed),
but if he replaces OD OA OD with just OD shouldn't it be instead replace OD OA OD with OD OA?
I don't know about the software packages or the controller that JPann's using, but I know certain programs will complain that there
is no end of line.
Brian
HuFlungDung 05-29-2004, 03:46 PM No, because the offending string is
0D 0A 0D 0A
but the hex editor only has a 6 character "replace" field. So I fudged it.
The results come out
0D 0A which is correct. :)
BrianS 05-29-2004, 04:15 PM Ah I see what you are doing now... I thought you were saying that the last OA wasn't even there. Makes sense now.
Brian
cadcam 05-30-2004, 12:34 PM Jpann, what are you using to upload and down load in mastercam ?
Are you using the Cimco editor or just the basic Mastercam communications?
JPann 06-03-2004, 11:21 AM Iam using basic mastercam comm.
rtucker 06-03-2004, 03:37 PM If you have this program in Windows, and have Word, you should be able to bring the file up in word. Then save as a TEXT ONLY file. The software should ask you how you want to handle the lf/cr.
cadcam 06-04-2004, 10:14 PM Jpann, I would set it for Cimco comm, this will give you more control to remove space . MC does just the basic.
this why we offer the cimco editor with communications.
What version of MC.
|