APPENDICES

APPENDIX 3 Example ProgramsAPPENDIX 3.1 Reading M-code

The program example for reading M-code at the completion of positioning start or positioning is shown below.

The judgement of the positioning start completion and positioning completion is made with the following signals.

Positioning start completion ………M2400+20n (positioning start complete signal)

Positioning completion ……………M2401+20n (positioning complete signal)

[Program Example]

(1)A program that outputs the M-code from PY000 to PY00F to external destination after conversion into BCD code at the positioning start completion is shown below.

System configuration

Motion SFC program

Q61P

Q02H

Q172H

QY40

Q172

 

CPU

CPU

 

LX

 

 

 

PY000

 

 

 

 

to

 

 

 

 

PY00F

 

 

 

 

 

 

[G10]

Reading M-code

M2401

Positioning start complete flag for axis 1 ON ?

[F10] #0=BCD(D13)150=BCD( D100) DOOUTYO￿CPY0,D150#

Read M-code for axis 1, and store to #0 after BCD conversion.

Output the data of "#0" to "PY000 to PY00F".

END

APP - 48