Professional Documents
Culture Documents
Siemens Macro Examples
Siemens Macro Examples
be/WjxzZtN5sdw
In the variable -> GUD (global user data) you have 100 string variable.
_TXT[0]
_TXT[1]
...
...
_TXT[98]
_TXT[99]
You can using this variable to store text string when machine is off.
macro start:
VALSTR = _TXT[0]
...
...
...
macro end:
_TXT[0] = VALSTR
m30
enjoy!
04-16-2016, 11:46 AM
extcall function is used to run programs on a memory card or directly from your
computer. Of course, it should also work in your case, but her true destiny is
different than yours. You should use the CALL or just type the name of the program,
eg.
or
N10 1DRILL
N20 2MILL
N25 3CHAMFER
M30
%
the next thing is that if the name of the program that begins with a number that
the call must look like this:
or
N10 _N_1DRILL
N20 _N_2MILL
N25 _N_3CHAMFER
M30
%
the last thing you're doing wrong it is to use the character "%" is not eof (end of
file). at the end of the block M30, enter the enter button to move to a new line
and all that. eg.
...
...
...
M30 <LF> <---(end of block) correct block must end a LF character if block not have
a LF can't be read.
<--- Nothing (eof)
N370 ;NOW THE PROBE WILL TOUCH OFF ON THE 730 BORE AND THE 508 BORE
N570 ;NOW THE PROBE WILL TOUCH OFF ON THE 571.5 BORE
N580 G0 G90 G54 X0; CENTER PALLET IN MACHINE
N590 ;ROTATE TO B180 SIDE
N600 G0 G521 B=DC(180)
N610 STOPRE
N620 ZP=-150
N770 ;R72 AND R73 ARE THE X AND Y COMPARES OF B0 AND B180 ROTATION
N780 R72=ABS[R61]-ABS[R67];730X ON B0 MINUS 571.5X ON B180
N790 R73=ABS[R62]-ABS[R68];730Y ON B0 MINUS 571.5Y ON B180
N800 ;------------------------------------------------------------
N1020 R80=1;THIS IS TO JUMP BORE PROBING IF RE-RAN BECAUSE OF 1685 BORE PROCESS
N1030 PROBEDONE;
N1040 L321;TURN PROBE OFF
partur
03-27-2016, 04:01 AM
N810 ;NEXT RUN OF INFO WILL 'WRITE' INFO TO 'WINERGYBORES' LOG
N820 DEF INT ERROR
N830 ;DEF STRING[10] TIME,DATE <-- NOT USE
N840 DEF STRING[40] FILENAME="/_N_WKS_DIR/_N_LOGDATA_WPD/_N_WINERGYBORES_MPF" ;OR
SPF
N850 ;MACHINE INFO VARIABLE FOR 'DATE' IS
N860 ;MACHINE INFO VARIABLE FOR 'TIME' IS
N870 WRITE(ERROR,FILENAME,"-------------------------------------")
N880 WRITE(ERROR,FILENAME,"PROG NAME: "<<$P_PROG[0])
N890 WRITE(ERROR,FILENAME,"DATE: "<<$A_YEAR <<$A_MONTH <<$_DAY)
N900 WRITE(ERROR,FILENAME,"TIME: "<<$A_HOUR <<$A_MINUTE)
N910 WRITE(ERROR,FILENAME,"SEQUENCE NUMBER: "<<ANZPROT);NO DEF OR GLOBAL OR DEF IN
LOW PROG LEVEL?? ;)
N920 WRITE(ERROR,FILENAME,"B0 730+.041-.007 BORE: "<<R60)
N930 WRITE(ERROR,FILENAME,"730 X AND Y POSITION: X"<<R61<<" Y"<<R62) ;!@#$%
FORGOT<<
N940 WRITE(ERROR,FILENAME,"B0 508 BORE: "<<R63)
N950 WRITE(ERROR,FILENAME,"508 X AND Y POSITION: X"<<R64<<" Y"<<R65) ;!@#$%
FORGOT<<
N960 WRITE(ERROR,FILENAME,"B180 571.5+.037-.007 BORE: "<<R66)
N970 WRITE(ERROR,FILENAME,"571.5 X AND Y POSITION: X"<<R67<<" Y"<<R68) ;!@#$%
FORGOT<<
N980 WRITE(ERROR,FILENAME,"BORE ALIGNMENT FROM B0 SIDE: X"<<ABS[R70] <<"
Y"<<ABS[R71])
N990 ;THIS COMPARES THE 730 BORE TO THE 508 BORE POSITIONS TO EACH OTHER
N1000 WRITE(ERROR,FILENAME,"BORE ALIGNMENT FROM B0 TO B180 SIDE: X"<<ABS[R72]<<"
Y"<<ABS[R73])
N1010 ;THIS COMPARES THE B180 571.5 BORE TO THE B0 730 BORE FOR ALIGNMENT
N1020 R80=1;THIS IS TO JUMP BORE PROBING IF RE-RAN BECAUSE OF 1685 BORE PROCESS
N1030 PROBEDONE;
N1040 L321;TURN PROBE OFF
ar_seliva
06-05-2015, 01:20 AM
Scurr,
I thought about creating variables in one of the GUDs; and that might work but
IIRC, one needs to power down the machine to make them 'persistent'. I'm pretty
sure that I could create array to store results, but then I'd have something like
PROBE_RESULTS(X), where X could be a variable or a literal. But I don't think that
PROBE_RESULTS(524) is much more readable than R524.
This is a very brief chunk-o-code and as you can see, there several R-parameters in
which probe results are stored. As I mentioned in the first post in this thread, I
have copy a program and insert many more probing sequences in between two of the
existing sequences. While I can continue with the last used R-parameter, R582 for
example, I want to re-order the R-parameters starting at the top of the file,
renaming each one at every instance in the file, before incrementing the R-
parameter counter.
That way, my code is readable and more easily understandable without having to
resort to searching for every instance during execution out in the shop. By the
way, this is really only a problem during debugging of the program.
I can perform the desired renaming with a decent text editor like UltraEdit, (or
even Notepad for that matter), it's just that it would be much more convenient to
have a utility do this.