378
MACROS
96-8000
June 1999
The following code skeleton could be developed to make a program that serializes parts:
O9200 (Engrave digit at current location.)
;
(D=DECIMAL DIGIT TO ENGRAVE) ;
IF [[#7 NE #0] AND [#7 GE O] AND [#7 LE 9]] GOTO99;
#3000=1 (INVALID DIGIT)
;
N99
#7=FIX[#7] (TRUNCATE ANY FRACTIONAL PART) ;
;
GOTO#7 (NOW ENGRAVE THE DIGIT) ;
;
N0 (DO DIGIT ZERO)
...
M99
;
N1 (DO DIGIT ONE)
;
M99
;
N2 (DO DIGIT TWO)
;
...
;
(etc.,...)
With the above subroutine, you would engrave digit five with the following call:
G65 P9200 D5;
Computed GOTOs using expression could be used to brach processing based on the results of reading
hardware inputs. An example might look like the following:
GOTO[[#1030*2]+#1031] ;
NO (1030=0, 1031=0) ;
...
M99;
N1 (1030=0, 1031=1) ;
...
M99;
N2 (1030=1, 1031=0) ;
...
M99;
N3 (1030=1, 1031=1) ;
...
M99;
The discrete inputs always return either 0 or 1 when read. The GOTO[expression] will branch to the appropriate
G-code based on the state of the two discrete inputs #1030 and #1031.