📄 y_home_11.pmc
字号:
/******************************************************************
File Name : Xx_linea.plc
Description : Phasing PLC Program for Motor #1
NOTICE: This PLC program should only be used AFTER PMAC2 has been
powered up AND AFTER YOUR AMPLIFIERS have are powered up.
Not observing this precaution could result in damage to
your motors and/or amplifiers! It is recommended that you
run this PLC program upon confirmed request from the user.
******************************************************************/
;I5 = 0 //; this is a precaution so that this PLC does not run instantly after reset
#include "address.h"
#include "oem.h" ;//@Add
#include "tsodick1.h"
#include "tsodick2.h"
#include "tsodick3.h"
//M982->X:$78000,20,4 ; UVW position register
//M983->X:$7C,0,24,S ; phase position register
//;M960->Y:$0814,10,1 ; home
//;M961->X:$003D,13,1 ; move zero
DELETE GATHER
DELETE TRACE
OPEN PLC 11 CLEAR
//home sequence
//RESTORE_HM_OFF_P = I126
i7022=11
;i7022=2
If (PULSES_PER_UNIT_1 < 0)
i222=-100
Else
i222=100
EndIf
I51 = 0
// for release from home dog 2000.04.04
;If (Y_ORG_LIMIT_M = 0)
If (HOME_FLAG_2 = 0)
If (I223 < 0)
cmd"#2 j^100000000"
Else
cmd"#2 j^-100000000"
EndIf
;While (Y_ORG_LIMIT_M = 0)
While (HOME_FLAG_2 = 0)
EndWhile
cmd"#2 j/"
//waiting time
TIME_WAIT_CNT_P=2
While (TIME_WAIT_CNT_P > 0)
TIME_WAIT_CNT_P=TIME_WAIT_CNT_P-1
EndWhile
While ((MOTOR2_STATUS_M&MOTOR_IN_POS_BIT) = 0) //;MOTOR1_STATUS_M(M730) INPOSITION BIT
EndWhile
EndIf
cmd"#2 hm"
//waiting time
TIME_WAIT_CNT_P=2
While (TIME_WAIT_CNT_P > 0)
TIME_WAIT_CNT_P=TIME_WAIT_CNT_P-1
EndWhile
While ((MOTOR2_STATUS_M&$400) = 0) //;MOTOR1_STATUS_M(M730)->Y:$814,0,24,U INPOSITION BIT
EndWhile
//waiting time
TIME_WAIT_CNT_P=5
While (TIME_WAIT_CNT_P > 0)
TIME_WAIT_CNT_P=TIME_WAIT_CNT_P-1
EndWhile
While ((MOTOR2_STATUS_M&$1) = 0) //;MOTOR1_STATUS_M(M730)->Y:$814,0,24,U INPOSITION BIT
EndWhile
/*
i213=1050000
i214=50000
i215=2*/
I51 = 1
@SET_OFF(CS_STATUS4_M,CS_HOME_INIT)
@SET_OFF(CS_STATUS4_M,CS_HOME_INPROGRESS)
DISABLE PLC 11
CLOSE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -