typedef struct MPIUserLimitConfig {
    MPIUserLimitTrigger trigger;
    MPIUserLimitOutput  output;

    MPIAction           action;
    long                actionAxis;
    MPI_BOOL            generateEvent;

    MPI_BOOL            enabled;
} MPIUserLimitConfig;


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


MPIUserLimitConfig sets a user limit's configuration using data from the structure pointed to by config.

trigger Structure to configure the trigger conditions for the user limit.
action The action to be associated with the user limit.
generateEvent Determines whether the user limit will generate an event that will be handled by the controller’s event mechanism
output Structure to configure the output stage of the user limit.

Sample Code

MPI_RESULT         returnValue; 
MPIUserLimit       userLimit;
MPIUserLimitConfig userEventConfig;

    /* ... */

returnValue = mpiUserLimitConfigDefault(&userEventConfig);


/* 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;   = 3;      = 7; = 1234;

returnValue = mpiUserLimitConfigSet(userLimit, &userEventConfig); 


See Also

mpiUserLimitConfigGet | mpiUserLimitConfigSet | mpiUserLimitConfigDefault