MPIUserLimitOutputType

Declaration

typedef enum MPIUserLimitOutputType {
    MPIUserLimitOutputTypeINVALID = -1,
MPIUserLimitOutputTypeNONE, MPIUserLimitOutputTypeSINGLE_SHOT, MPIUserLimitOutputTypeMOTOR_GENERAL_OUT, MPIUserLimitOutputTypeCONTROL_DIGITAL_OUT, MPIUserLimitOutputTypeSQNODE_DIGITAL_OUT, MPIUserLimitOutputTypeSQNODE_ANALOG_OUT, MPIUserLimitOutputTypeUSER_BUFFER, MPIUserLimitOutputTypeCUSTOM, MPIUserLimitOutputTypeCUSTOM_ARRAY,
MPIUserLimitOutputTypeEND, MPIUserLimitOutputTypeFIRST = MPIUserLimitOutputTypeINVALID + 1, MPIUserLimitOutputTypeCOUNT = MPIUserLimitOutputTypeEND - MPIUserLimitOutputTypeFIRST } MPIUserLimitOutputType;

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

Description

MPIUserLimitOutputType represents the type of the user limit’s output block.

Member (MPIUserLimitOutputType...)
Associated Data Structure (MPIUserLimitOutputData...)
The user limit writes to...
NONE
none
The default output configuration. The user limit will not write any output.
SINGLE_SHOT
none
The user limit will only fire once. Upon triggering, the user limit disables itself.
MOTOR_GENERAL_OUT
MotorIo
Motor general-purpose digital outputs.
CONTROL_DIGITAL_IN
ControllerIo
The controller digital inputs.
CONTROL_DIGITAL_OUT
ControllerIo
The controller digital outputs.
SQNODE_DIGITAL_OUT
SqNodeDigitalIo
A SynqNet node’s digital outputs.
SQNODE_ANALOG_OUT
SqNodeAnalogIo
A SynqNet node’s analog outputs.
USER_BUFFER
UserBuffer
A user buffer location.
CUSTOM
Custom
A custom output.
CUSTOM_ARRAY
CustomArray
An array of custom outputs.

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