MDrive/MForce – High speed input trip capture
This short program demonstrates how to set up a high-speed trip capture function for an MDrivePlus2. The Trip Capture (TC) function available only on the MDrive Plus2 and MForce Plus2 units is similar to the standard Trip on Input (TI) command but designed for extremely high-speed applications.
Input 13 is defined as a high-speed input that will capture a pulse based on the FC (Filter Capture) I/O variable. The FC has 10 settings that will digitally filter input pulses from a minimum of 50nS to a maximum of 12.9nS. The input on I13 must be stable for the period of time set by FC before it will be recognized. In the program, when the input becomes true, the program leaves the loop in LB k1 and executes subroutine LB k2 which increments R1, prints the value of R1, reenables the trip (Te=4) and returns to LB k1. It is important to understand that Input 13 is a TTL level only input. Vin Max is +5 volts. A 12 to 24 volt input typically used on the MDrive general purpose inputs will damage Input 13!
'***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