.

MPIProbeType

Definition

 
typedef enum MPIProbeType {
    MPIProbeTypeMOTOR,
    MPIProbeTypeIO,
} MPIProbeType;

Description

MPIProbeType is an enumeration of Probe types. This specifies whether the Probe engine is associated with a Motor or Node I/O. The available Probe type is dependent on the hardware Probe engine implementation.

 
MPIProbeTypeMOTOR The Probe hardware engine is a component of the Motor object. For the Motor type, the Probe is identified by the Motor number.
MPIProbeTypeIO The Probe hardware engine is a component of the Node I/O. For the I/O type, the Probe is identified by the Node number.

Sample Code


/*
This Function Creates a Probe. You must specify what Probe Type you wish to use: a Motor Probe, or Node Probe (typically a device will only support one mode, not both). The Probe number refers to the probe number you wish to refer throughout the program, where the Probe index is the probe number for that device (starting with 0). In the case of multiple probes on a single node, Index = 0, 1, 2, etc.
*/
long probeInit(MPIControl *control, MPIProbe *probe, MPIProbeType probeType, long intProbeNumber, long intProbeIndex) { MPIProbeParams probeParams;
long returnValue; //Probe Initialization
probeParams.type = probeType;
if(probeType == MPIProbeTypeMOTOR){
probeParams.number.motor = intProbeNumber;
}else{ // == MPIProbeTypeNODE
probeParams.number.node = intProbeNumber;
}
probeParams.probeIndex = intProbeIndex; *probe = mpiProbeCreate(*control, &probeParams);
returnValue = mpiProbeValidate(*probe);
return returnValue;
}

See Also

MPIProbeNumber | MPIProbeParams

 

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