Hello I need to read g code text file with MATLAB
my text file gkod.txt is
; Generated with:
; "Raster 2 Laser Gcode generator"
; by 305 Engineering
;
;
;
G28; home all axes
G21; Set units to millimeters
G90; Use absolute coordinates
G92; Coordinate Offset
G00 X145.0 Y73.0
M03
G01 X137.0 Y73.0 F200
M05
G00 X68.0 Y74.0
M03
G01 X75.0 Y74.0 F200
And I can read all text file with this codes
fid = fopen('gkod.txt','r');
Data=fread(fid);
CharData=char(Data);
fclose(fid);
x=(CharData);
y=transpose(x);
z=(y)
Now I just want to get data containing G0,G1 and if txt have any G2 and G3
Thanks

댓글 수: 2

Walter Roberson
Walter Roberson 2019년 4월 6일
What output would you like from the above file? What output would you like if the file contained G2 or G3 lines?
Serkan Guryalcin
Serkan Guryalcin 2019년 4월 6일
편집: Serkan Guryalcin 2019년 4월 6일
X Y and R.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

질문:

2019년 4월 6일

편집:

2019년 4월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by