Application Solutions
Precision MicroControl Corp.
140
Position Capture
The controller features versatile high-speed position capture circuits that allow users to precisely
synchronize motion with external events. The controller supports capturing the position of a closed loop
servo or stepper encoder or step count (of an open loop stepper) on the
rising edge
of a TTL Position
Capture input. As many as 1024 captured positions can be stored in the recording memory for each axis.
The maximum frequency of position captures is 1 KHz. The maximum latency between the rising edge of
the position capture input and the loading of the captured position is 100 nano seconds.
i
The active level of a position capture input is fixed as a TTL high. Unlike the
general purpose digital I/O channels, a position capture input cannot be
configured for 'low true' operation.
The Motion Control API function
MCEnableCapture ( )
is used to initiate position capture. When this
feature is enabled the current position will be recorded on the rising edge of the capture input. If
parameter
count
equals 1 the module will capture only one position. If parameter
count
equals 2 the
module will capture two positions, and so on. When the number of positions captured =
count
, the
MC_STAT_POS_CAPT
flag (status bit 5) will be set. To report the number of positions captured issue the
MCGetCount ( )
function with the
type
=
MC_COUNT_CAPTURE
. To disable position capture issue
MCEnableCapture ( )
with parameter
count
equal to 0. Captured positions may be retrieved using the
MCGetCapturedData( )
function.
Long int count;
double
data{10};
MCEnableAxis( hCtlr, 1, 1 );
MCMoveRelative( hCtlr, 1, 10000.0 );
// Capture 10 positions
//
MCEnableCapture( hCtlr, 1, 10.0 );
// Retrieve the 10 captured positions into local array
//
do {
MCGetCount(( hCtlr, 1, MC_COUNT CAPTURE, &count);
} while (count <10);
MCGetCaptureData( hCtlr, 1, MC_CAPTURE_ACTUAL, 0, 10, &data );
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com