Casa de TrailMyx > Programming / Operating Systems

text file scanner

(1/6) > >>

Khameleon:
I'm not really sure how to go about this.. so I'll just tell you guys what I'm looking for and maybe you guys can point me in the right direction.

a little background history... I work on a CNC machine which is coded by a McMaster Cam design program the file format is .nc which can be read in text file format.  what I'm looking for is a program that reads the whole text file and reports each tool # and the Farthest Z Depth. I'm looking for a text file that I can attach to show you what the file looks like...

Masscre:
There are a ton of file parsing tools out there and reporting tools most are free. Get me a copy of one of th efiles and I can prolly get you a link to one or even help you right one quickly in c or pascal.

Khameleon:
thanks a lot.. I'll have to wait till Monday before I can snag a file from work... I've been reading the program we use is way out dated but for small business's it does what we need.  I'm sure its gotta be sometime simple for you guys that write programs all the time...
from what I can remember is you will see the start of a tool would be something like
T1 [Tool 1]
a few lines of code then you will start to see the z values somethine like
Z-1.125
ect ect ect.

sometimes the z will have multiple depths for each tool I would like to find the deepest depth for each Tool Number.

Khameleon:
here's the type of code that i'm looking to scan...
%
O0000
(PROGRAM NAME - 13430 PUNCH GEO)
(DATE=DD-MM-YY - 05-01-11 TIME=HH:MM - 18:04)
N100G20
N102G0G17G40G49G80G90
( 1/2 CENTERDRILL TOOL - 1 DIA. OFF. - 1 LEN. - 1 DIA. - .5) Beginning of First tool
N104T1M6
N106G0G90G54X-2.5289Y11.8305A0.S2500M3
N108G43H1Z.1M8
N110G99G81Z-.26R.1F40.   Right here is the first Z depth -.26
N112X2.3831
N114X-12.3794Y11.837
N116X-7.4582
N118X7.3056
N120X12.3523Y11.8412
N122Y15.8335
N124X-15.6538Y15.837
N126X-7.1548
N128G80
N130M5
N132G91G28Z0.M9
N134G28X0.Y0.A0.
N136M01 M01 is the End of the first tool
( 1/2 FLAT ENDMILL TOOL - 2 DIA. OFF. - 2 LEN. - 2 DIA. - .5) Switching to 2nd Tool
N138T2M6
N140G0G90G54X-2.1541Y18.587A0.S3056M3
N142G43H2Z-.25 Here we have the z depth again at -.25
N144G1Y18.087F24.45
N146G3X-1.6541Y17.587R.5
N148G1X12.8459
N150G2X13.0959Y17.337R.25
N152G1Y10.587
N154G2X12.8459Y10.337R.25
N156G1X-16.1541
N158G2X-16.4041Y10.587R.25
N160G1Y17.337
N162G2X-16.1541Y17.587R.25
N164G1X-1.6541
N166G3X-1.1541Y18.087R.5
N168G1Y18.587
N170Z.35F6.42
N172M5
N174G91G0G28Z0.
N176G28X0.Y0.A0.
N178M01 M01 again is the end of the tool
( 1/2 FLAT ENDMILL TOOL - 3 DIA. OFF. - 3 LEN. - 3 DIA. - .5) Starting Tool 3
N180T3M6
N182G0G90G54X-2.5289Y11.8305A0.S1833M3
N184G43H3Z.1M8
N186G99G83Z-.25R.1Q.1F14.66 here we have a depth of -.25
N188X2.3831
N190X-12.3794Y11.837
N192X-7.4582
N194X7.3056
N196X12.3523Y11.8412
N198Y15.8335
N200X-15.6538Y15.837
N202X-7.1548
N204G80
N206M5
N208G91G28Z0.M9
N210G28X0.Y0.A0.
N212M02 and now we are at the end of the program noted by M02
%

Sometimes tools are pulled up multiple times at different z depths I don't know if there is a way to scan for T1M6 (T1 = Tool Change to Tool 1) scan the whole section for Z-(what ever this is) until it hits M01 then scan for the next tool T2M6 all the way till the next M01 and so on... then create some sort of Tool List with the farthest Z depth? 


if I confused you please ask me to help me to help you help me :P

Endless Night:
you get this all sorted Kham ?

Navigation

[0] Message Index

[#] Next page

Go to full version