MPIUserLimitLogic

Declaration

typedef enum MPIUserLimitLogic {
    MPIUserLimitLogicINVALID = -1,
MPIUserLimitLogicEQ, /* Equal to */ MPIUserLimitLogicNE, /* Not equal to */ MPIUserLimitLogicGT, /* Greater than */ MPIUserLimitLogicGE, /* Greater than or equal */ MPIUserLimitLogicLE, /* Less than or equal */ MPIUserLimitLogicLT, /* Less than */ MPIUserLimitLogicABS_EQ, /* Absolute value is equal to */ MPIUserLimitLogicABS_GT, /* Absolute value is greater than */ MPIUserLimitLogicABS_LE, /* Absolute value is less tha */
MPIUserLimitLogicEND, MPIUserLimitLogicFIRST = MPIUserLimitLogicINVALID + 1, MPIUserLimitLogicCOUNT = MPIUserLimitLogicEND - MPIUserLimitLogicFIRST } MPIUserLimitLogic;

 

Required Header: stdmpi.h
Change History: Added in 04.00.

Description

MPIUserLimitLogic represents the logic used by a user limit’s condition block.

Type (MPIUSerLimitLogic...) Description
GT Greater than.
GE Greater than or equal to.
LE Less than or equal to.
LT Less than.
EQ Equal to.
NE Not equal to.
ABS_EQ Absolute value is equal to.
ABS_GT Absolute value is greater than.
ABS_LE Absolute value is less than or equal to.

Sample Code

MPI_RESULT         returnValue; 
MPIUserLimit       userLimit;
MPIUserLimitConfig userEventConfig;

    /* ... */

returnValue = mpiUserLimitConfigDefault(&userEventConfig);

msgCHECK(returnValue); 

/* Generate an event */

userEventConfig.generateEvent = TRUE;     

/* Use a single condition */

userEventConfig.trigger.type = MPIUserLimitTriggerTypeSINGLE_CONDITION;

/* Trigger when axis 5's actual position exceeds 300000 */

userEventConfig.trigger.condition[0].type = MPIUserLimitConditionTypeAXIS_ACTUAL_POSITION;
userEventConfig.trigger.condition[0].data.axisActualPosition.axisNumber = 5;
userEventConfig.trigger.condition[0].data.axisActualPosition.position   = 300000;
userEventConfig.trigger.condition[0].data.axisActualPosition.logic      = MPIUserLimitLogicGT;

/* Setup output block:  Set a SynqNet I/O Node's analog output. */

/* Set node 3's analog channel 7 to a value of 1234             */

userEventConfig.output.type = MPIUserLimitOutputTypeSQNODE_ANALOG_OUT;
userEventConfig.output.data.sqNodeAnalogOut.nodeNumber   = 3;
userEventConfig.output.data.sqNodeAnalogOut.channel      = 7;
userEventConfig.output.data.sqNodeAnalogOut.newValue.i16 = 1234;

returnValue = mpiUserLimitConfigSet(userLimit, &userEventConfig); 

msgCHECK(returnValue);