Liberty* MCodeMDrive MCode
Lexium MDrive MCode 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 58 59 60 61 | 'LIBERTY* MDRIVE DEMO PROGRAM 'Last modified 02/21/2016 'Sample test program for demonstration purposes only 'Not tested or verified for safety or any function CP 'preclear program space '[VARIABLES] VA Q1 = 0 VA Q2 = 0 D1 = 255 D2 = 255 'encoder enabled Ee=1 '[PROGRAMS] 'Program stores a +/- move p 'profile based on encoder counts 'set by manually positioning 'the motor shaft. An input 'toggle stores the encoder 'counts to a user variable. PG 1 LB Su Er = 0 C2=0 Q1 = 0 O2 = 0 PR "Move motor to position 1" PR "Toggle switch 1 when ready" LB X1 BR X1, I1 = 0 Q1 = C2 PR Q1 LB X2 BR X2, I1 = 1 PR "Move motor to position 2" PR "Toggle switch 1 when ready" LB X3 BR X3, I1 = 0 Q2 = C2 PR Q2 LB X4 BR X4,I1=1 PR "Toggle Sw 2 to start cycle" LB X5 BR X5, I2 = 0 LB X6 MA Q1 H PR P H 250 MA Q2 H PR P H 250 BR X5 E PG ' End of Program S 'Keep this line to save program on load |
MDrive MCode 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 58 59 60 61 | 'MDRIVE DEMO PROGRAM 'Last modified 02/21/2016 'Sample test program for demonstration purposes only 'Not tested or verified for safety or any function CP 'preclear program space '[VARIABLES] VA Q1 = 0 VA Q2 = 0 D1 = 255 D2 = 255 'encoder enabled Ee=1 '[PROGRAMS] 'Program stores a +/- move p 'profile based on encoder counts 'set by manually positioning 'the motor shaft. An input 'toggle stores the encoder 'counts to a user variable. PG 1 LB Su Er = 0 C2=0 Q1 = 0 O2 = 0 PR "Move motor to position 1" PR "Toggle switch 1 when ready" LB X1 BR X1, I1 = 0 Q1 = C2 PR Q1 LB X2 BR X2, I1 = 1 PR "Move motor to position 2" PR "Toggle switch 1 when ready" LB X3 BR X3, I1 = 0 Q2 = C2 PR Q2 LB X4 BR X4,I1=1 PR "Toggle Sw 2 to start cycle" LB X5 BR X5, I2 = 0 LB X6 MA Q1 H PR P H 250 MA Q2 H PR P H 250 BR X5 E PG ' End of Program S 'Keep this line to save program on load |