Fanuc Series 15i/150i-MA (Programming) Operators Manual

17.CUSTOM MACRO PROGRAMMING B-63324EN/03
- 596 -
[Example]
DI configuration
2
15
2
14
2
13
2
12
2
11
2
10
2
9
2
8
2
7
2
6
2
5
2
4
2
3
2
2
2
1
2
0
DO configuration
2
8
2
7
2
6
2
5
2
4
2
3
2
2
2
1
2
0
(1) Signed three BCD digits based on address switching are read.
Macro call command
G65 P9100 D(address);
A custom macro body is generated as follows :
O9100 ;
#1132 #1132 AND 496 OR#7 ; : Outputs address.
G65 P9101 T60 ; : Timer macro
#100 BIN[#1032 AND 4095] ; : Reads three BCD digits.
IF [#1012 EQ 0] GOTO 9100 ; : Assigns a sign.
#100 = -#100
N9100 M99
(2) Eight types of signed six BCD digits (three digits in integer part + three digits in fractional part) based on
address switching are read into #101.
Configuration on the machine
When DO 20 = 0 : Data of 3 digits in the fractional part
When DO 20 = 1 : Data of 3 digits in the integer part
When DO 23 to 21 = 000 : No. 1 data
When DO 23 to 21 = 001 : No. 2 data
:
= 111 : No. 8 data
Macro call command
G65 P9101 D(data number);
A custom macro body is generated as follows :
O9101 ;
G65 P9101 D[#7 * 2 + 1] ;
#101 = #100 ;
G65 P9100 D[#7 * 2] ;
#101 = #101 { #100/1000 ;
M99 ;
Used for
other purposes
Not used
Sign
10
1
Used for other purposes
10
2
10
0
Address

Leave a Reply

Your email address will not be published. Required fields are marked *