Appendixes – Rockwell Automation 1398-PDM-xxx IQ Master Version 3.2.4 for IA-2000 and IQ-5000 Positioning Drive Modules, IQ-55 User Manual
Page 429
Application Examples • Automated Test Station
407
Publication 1398-PM601A-EN-P — October 2000
APPENDIXES
;------------------------------ Main Program ------------------------------
S1 CONT
;Activate scan for Stop input
DISABLE
;Disable IQ to allow operator to move motor
; shaft to load the part
ALL OFF
;Clear all outputs
Ready = ON
;Signal ready for a new part
Timerdone = OFF
;Clear timer
Begin:
;Beginning of test loop
WAIT Testcomplete = OFF
;Wait for host to read data and clear flag
WAIT Starttest = ON
;Wait for start input
ALL OFF
;Clear all outputs
ENABLE
;Enable IQ
;Check to see which test to perform and jump to the
; proper section ON Testnumber JUMP Setuperr, Begin1,
; Begin2, Begin3, Begin4
Setuperr:
Setuperror = ON
;Signal error in test data
DISABLE
;Disable IQ
JUMP Begin
;Go back to beginning
;Test 1 - Measure torque at a fixed velocity
Begin1:
IF Testvel <= 0 JUMP Setuperr
;Check if valid velocity
IF Maxtorque <= 0 JUMP Setuperr
;Check if valid tolerance
IF Mintorque < 0 JUMP Setuperr
;Check if valid tolerance
TIMER1 = Testdelay
;Set timer value
S2 ON
;Start timer scanned event
Starttimer = ON
;Start timer
MOVV = Testvel
;Start motion
WAIT Timerdone = ON
;Wait for timer to finish
Meascurrent = ICMD
;Read current
MOVV = 0
;Stop motion
DISABLE
;Disable IQ
Test1torque = Meascurrent
;Calculate torque
* Torqueconst
IF Test1torque > Maxtorque
;Check if torque within tolerance
Fail = ON
; if not - the part fails
ELSE
{
IF Test1torque > Mintorque
Pass = ON
; otherwise - the part passes
ELSE
Fail = ON
}
JUMP Done
;Finish the test
;Test 2 - Stress test
Begin2:
IF Testvel <= 0 JUMP Setuperr
;Check if valid velocity
IF Maxdistance <= 0
;Check if valid tolerance
JUMP Setuperr
IF Currentlimit <= 0
;Check if valid Ilimit
JUMP Setuperr
ILIMIT = Currentlimit
;Set current limit
Startpos = PCMD
;Capture starting position
Targetpos = PCMD + Maxdistance
;Calculate minimum move distance
TIMER1 = Testdelay
;Set timer value
S2 ON
;Start timer scanned event
Starttimer = ON
;Start timer
MOVV = Testvel
;Start moving
WAIT PCMD >= Targetpos
;Wait until commanded motion reaches target