.

MPICaptureStatus

Definition

 
typedef struct MPICaptureStatus {
    MPICaptureState   state;
    double            latchedValue;
} MPICaptureStatus;

Description

 
state An enumerated value representing the present state of the capture logic
latchedValue

The captured encoder position value. This value is only valid when the state is CAPTURED.

The actual position value is the captured encoder position value subtracted by the origin variable.

The origin variable can be set/get through mpiAxisOriginSet(...) and mpiAxisOriginGet(...).

Recall that encoder positions have no origin adjustment whereas actual positions do have origin adjustment.

Please refer to Using the Origin Variable for more information.

Sample Code


void displayPosition(MPICapture   capture, 
MPIAxis axis)
{
double origin;
MPICaptureStatus captureStatus;
/* Check captured position */

mpiCaptureStatus(capture,
&captureStatus,
NULL); /* Getting origin variable and store it to origin */
mpiAxisOriginGet(axis, &origin); if (captureStatus.state == MPICaptureStateCAPTURED)
{
printf("Latched actual position: %.0lf\n",
captureStatus.latchedValue - origin);
printf("Latched encoder position: %.0lf\n",
captureStatus.latchedValue);
} }

See Also

MPICaptureState

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering