7AUXILIARY AND APPLIED FUNCTIONS(4)Program example

(a)The Motion SFC program to read M-codes is shown as the following conditions.

1)

Axis used No. .........................................

Axis 3

2)

Processing at the positioning start by M-code

 

....................

M-code No. is output as BCD

 

 

code to Y110 to Y11F

3)

Processing at the positioning completion by M-code

 

a) M-code = 3.........................................

Y120 turns on

 

b) M-code = 5.........................................

Y121 turns on

 

c) M-code is except for (3 or 5) .............

Y122 turns on

(b) Motion SFC program with the above conditions are shown below.

System Configuration

Q61P

Q02H

Q172H

Q172

QY40

- A

CPU

CPU

LX

 

PY000

to

PY00F

Motion SFC program

Reading of M-codes

[F10] #0=0 #1=0 #2=0

[F20]

SET M2042

 

[G10] PX000*M2455

 

 

 

1)

 

 

 

 

[G30]

 

D53==5

All axes servo ON command

 

 

 

 

 

 

 

 

turns on

[F40]

#1=BCD(D53)

Stand by until PX000 and Axis 3

DOUT Y110, #1

SET Y121

servo ready turns on

 

 

M-code (5) for axis 3 ?

After M-code storage area for axis 3 is changed into BCD code, it is output to Y110 and Y121 turns on.

[K100] CPSTART1

1 axis constant-speed control

M-code (except 3 or 5) for axis 3 ?

 

 

After M-code storage area for axis 3 is

Axis

3

 

Speed

 

1000PLS/s

INC-1

 

 

Axis

3,

200000PLS

M-code

 

3

INC-1

 

 

Axis

3,

300000PLS

M-code

 

5

INC-1

 

 

Axis

3,

400000PLS

M-code

 

4

CPEND

 

 

[G20]

 

 

P0

 

 

 

 

 

D53==3

 

[F30] #0=BCD(D53) DOUT Y110, #0 SET Y120

1)

Axis used . . . Axis 3

[G40]

(D53==3)+(D53==5)

Speed . . . 1000PLS/s

 

 

 

 

 

 

 

 

1 axis linear positioning control

 

 

 

Axis used . . . Axis 3

 

 

 

 

Positioning . . . 200000PLS

 

 

 

address

 

 

 

 

M-code output . . . 3

 

 

 

 

1 axis linear positioning control

[G50]

 

Axis used . . . Axis 3

 

 

 

 

!M2003

Positioning . . . 300000PLS

 

address

 

 

 

 

M-code output . . . 5

 

 

 

 

1 axis linear positioning control

 

 

 

Axis used . . . Axis 3

 

 

 

 

Positioning . . . 400000PLS

 

END

address

 

 

M-code output . . . 4

M-code (3) for axis 3 ?

After M-code storage area for axis 3 is changed into BCD code, it is output to Y110 and Y120 turns on.

[F50] #2=BCD(D53) DOUT Y110, #2 SET Y122

P0

changed into BCD code, it is output to Y110 and Y122 turns on.

7 - 3