MPIUserLimitTriggerType

Declaration

typedef enum MPIUserLimitTriggerType {
    MPIUserLimitTriggerTypeINVALID = -1,

MPIUserLimitTriggerTypeNONE, MPIUserLimitTriggerTypeSINGLE_CONDITION, MPIUserLimitTriggerTypeCONDITION_AND, MPIUserLimitTriggerTypeCONDITION_OR, MPIUserLimitTriggerTypeTIMER, /* period = UserLimitConfig.trigger.duration */
MPIUserLimitTriggerTypeEND, MPIUserLimitTriggerTypeFIRST = MPIUserLimitTriggerTypeINVALID + 1, MPIUserLimitTriggerTypeCOUNT = MPIUserLimitTriggerTypeEND – MPIUserLimitTriggerTypeFIRST } MPIUserLimitTriggerType;

 

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

Description

MPIUserLimitTriggerType represents a user limit’s trigger type.

Type (MPIUserLimitTriggerType…)

Description
NONE Disables the user limit. No conditions are evaluated.
SINGLE_CONDITION Only one condition is evaluated. (MPIUserLimitConfigTrigger.condition[0])
CONDITION_AND Two conditions are evaluated and combined via a logical AND.
CONDITION_OR Two conditions are evaluated and combined via a logical OR.
TIMER Specifies that the user limit is to be used as a timer.

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);

See Also

MPIUserLimitTrigger | MPIUserLimitCondition