📄 a_home_16.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"
//M992->X:$78110,20,4 ; UVW position register
//M993->X:$1a8,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 16 CLEAR
//home sequence
//RESTORE_HM_OFF_P = I126
i7072=11
If (PULSES_PER_UNIT_1 < 0)
i722=-100
Else
i722=100
EndIf
I51 = 0
// for release from home dog 2000.04.04
If (A_ORG_LIMIT_M = 1)
If (I723 < 0)
cmd"#7 j^1000000"
Else
cmd"#7 j^-1000000"
EndIf
While (A_ORG_LIMIT_M = 1)
EndWhile
cmd"#7 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 ((MOTOR7_STATUS_M&MOTOR_IN_POS_BIT) = 0) //;MOTOR1_STATUS_M(M730) INPOSITION BIT
EndWhile
EndIf
cmd"#7 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 ((MOTOR7_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 ((MOTOR7_STATUS_M&$1) = 0) //;MOTOR1_STATUS_M(M730)->Y:$814,0,24,U INPOSITION BIT
EndWhile
I51 = 1
@SET_OFF(CS_STATUS4_M,CS_HOME_INIT)
@SET_OFF(CS_STATUS4_M,CS_HOME_INPROGRESS)
DISABLE PLC 16
CLOSE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -