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 | 'MDRIVE DEMO PROGRAM 'Last modified 08/25/2016 'Sample test program for demonstration purposes only 'Not tested or verified for safety or any function CP 'preclear program memory '***This program demonstrates how to set up an input trip '***capture. Every time TC activates R1 increments and prints. R1=0 'init R1 to 0 S13=60,0,0 'set input 13 for high speed TC input Fc=9 'filter input 13 for 12.9uS PG 1 LB su OE e1 'on error call e1 P=0 'set position counter to 0 Tc=k2 'set up input trip Te=4 'trip on capture (I/O 13) enable LB k1 H 100 'busy loop BR k1 E 'program end LB k2 'sub called on input trip IC R1 'increment R1 PR "R1=",R1 Te=4 'reenable trip RT 'return E LB e1 'this sub is called on any error PR "Error=",Er Er=0 RT E PG S 'Keep Line |