mistux Site Admin
Joined: 25 Jun 2004 Posts: 1042 Location: South Bend, Indiana USA
|
Posted: Fri Jul 02, 2004 12:38 pm Post subject: How To Check the State of Cycle Start & Chuck Open in Ok |
|
|
Have you ever used M00, on the Okuma, somewhere in a program to allow the operator to remove chips or inspect the part only to have him put the next part in and crash the machine?
This macro will prevent that from happening. Instead of using an M00, the macro creates an indefinite loop that continues until Cycle Start is pressed or the chuck is opened.
If Cycle Start is pressed the program jumps to N5 (or any line number you want) and continues. However, if the chuck is opened, because the operator forgot that he was at M00 and put a new part in, the program jumps to an alarm code and tells the operator to restart.
Code: | NLOOP IF[[VDIN[1124] AND 2] EQ 2]N5
IF[[VDIN[1108] AND 2] EQ 2]NALA1
GOTO NLOOP
N5G0X20Z20(NEXT TOOL IN PROGRAM)
...PROGRAM CODE
...PROGRAM CODE
...
GOTO N9999
NALA1 VUACM[1]='RESTART FROM N5'
VDOUT[991]=999
N9999 M02 |
To use the macro, insert it where you would normally have an M00. The lines
Code: | NLOOP IF[[VDIN[1124] AND 2] EQ 2]N5
IF[[VDIN[1108] AND 2] EQ 2]NALA1
GOTO NLOOP |
do the actual work. IF[[VDIN[1124] AND 2] EQ 2] is true if Cycle Start is pressed and then execution jumps to line N5. Otherwise, IF[[VDIN[1108] AND 2] EQ 2]NALA1 checks to see if the Chuck open switch has been pressed. If so, execution jumps to the alarm. Be sure to put the alarm at the end of the program. You can use the Check Data key on the control to see the input for Chuck Open. Look under EC Panel Input for bits to change while you activate the chuck pedal.
Legal stuff: I provide this "As Is" and make no express guarantees that it will work and/or will work on your machine. It is intended as a guide and as with all programs should be fully tested before it is ran. |
|