Liberty* MCodeMDrive MCode
Lexium MDrive Example Program
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | 'LIBERTY* MDRIVE DEMO PROGRAM 'Sample Demo Test program 'Not tested or verified for safety or function 'Such testing is the sole responsibility of user/customer PG 1 'Enter program @ address 1 Os=3,28,0 'Set O3 as a trip output Tr 512,0,0 'Set the drive to trip 100 times/rev Te=16 'Enable the trip Cw=255 'Set the clock width to 12.75 uS Is=1,0,1 'Set I1 to Gen purp active high Is=2,0,1 'Set I2 to Gen purp active high Is = 5, 9, 1 'Set Analog input for 0-10vdc Os=1,18,0 'Set O1 to be an error output D5=60 'Set analog filter to 60 A=512000 'Set Acceleration to 10 RPS per Second D=512000 'Set Deceleration to 10 RPS per Second R2=0 Rc=75 Hc=75 LB G1 OE=Z3 'Set On Error routine LB G2 BR Z4,I2=0 'Branch to quick stop CL Z1,I1=1 'Call slew at analog setting routine CL Z2,I1=0 'Call slew to zero routine (Stop) H 50 'Wait 50 milliseconds BR G2 'Brandh back to IO scan loop LB Z4 D=1000000000 SL 0 'Slew to zero (Stop) H D=512000 BR G2 E LB Z1 BR X1,I2=0 R1 = I5 * 126 'Set R1 to scaled analog value SL R1 'Slew at scaled analog value LB X1 RT LB Z2 SL 0 'Slew to zero (Stop) RT LB Z3 PR "Error= ",Er 'Print the error register RT E 'End program PG 'Exit program mode S 'Keep this line |
MDrive Example Program
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | 'MDRIVE DEMO PROGRAM 'Sample Demo Test program 'Not tested or verified for safety or function 'Such testing is the sole responsibility of user/customer PG 1 'Enter program @ address 1 S13=60,0 'Set capture/trip as a trip Tr 512,0,0 'Set the drive to trip 100 times/rev Te=16 'Enable the trip Cw=255 'Set the clock width to 12.75 uS S1=0,1,0 'Set I/O to General purpose input active high S2=0,1,0 'Set I/O2 to General purpose input active high S5= 9, 1 'Set Analog input for 0-10vdc S4=8,0 'Set I/O4 to be an error output D5=60 'Set analog filter to 60 A=512000 'Set Acceleration to 10 RPS per Second D=512000 'Set Deceleration to 10 RPS per Second R2=0 Rc=75 Hc=75 LB G1 OE=Z3 'Set On Error routine LB G2 BR Z4,I2=0 'Branch to quick stop CL Z1,I1=1 'Call slew at analog setting routine CL Z2,I1=0 'Call slew to zero routine (Stop) H 50 'Wait 50 milliseconds BR G2 'Brandh back to IO scan loop LB Z4 D=1000000000 SL 0 'Slew to zero (Stop) H D=512000 BR G2 E LB Z1 BR X1,I2=0 R1 = I5 * 126 'Set R1 to scaled analog value SL R1 'Slew at scaled analog value LB X1 RT LB Z2 SL 0 'Slew to zero (Stop) RT LB Z3 PR "Error= ",Er 'Print the error register RT E 'End program PG 'Exit program mode S 'Keep this line |