.

MPICommandParams

Definition

 
typedef union {
    struct {  /* *'dst' = 'value' */
        MPICommandAddress    dst;
        MPICommandConstant   value;
        MPIControl           control;  /* Ignored by Sequence */
    } assign;

    struct {  /* branch to 'label' on 'expr' */
        char            *label;   /* NULL => stop sequence */
        MPICommandExpr  expr;     /* expr.oper => MPICommandOperatorLogical */
        MPIControl      control;  /* Ignored by Sequence */
    } branch;

    struct {  /* branch to 'label' on MPIEventMask('handle') 'oper' 'mask' */
        char                *label; /* NULL => stop sequence */
        MPIHandle           handle; /* [MPIMotor|MPIMotion|...] */
        MPICommandOperator  oper;   /* EQUAL/NOT_EQUAL/BIT_CLEAR/BIT_SET */
        MPIEventMask        mask;   /* MPIEventMask('handle') 'oper' 'mask' */
    } branchEvent;

    struct {  /* branch to 'label' on Io.input 'oper' 'mask' */
        char               *label; /* NULL => stop sequence */
        MPIIoType          type;   /* MOTOR,   USER */
        MPIIoSource        source; /* MPIMotor	index */
        MPICommandOperator oper;   /* EQUAL/NOT_EQUAL/BIT_CLEAR/BIT_SET */
        long               mask;   /* [motor|user]Io.input 'oper' 'mask' */
    } branchIO;

    struct {  /* *'dst' = 'expr' */
        MPICommandAddress   dst;
        MPICommandExpr      expr;    /* expr.oper => MPICommandOperatorArithmetic */
        MPIControl          control; /* Ignored by Sequence */
    } compute;

    struct {  /* Io.output = Io.output 'oper' 'mask' */
        MPIIoType          type;    /* MOTOR,   USER */
        MPIIoSource        source;  /* MPIMotor    index */
        MPICommandOperator oper;    /* AND/OR/XOR */
        long               mask;
    } computeIO;

    struct {  /* memcpy(dst, src, count) */
        void         *dst;
        void         *src;
        long         count;
        MPIControl   control;  /* Ignored by Sequence */
    } copy;

    float  delay;  /* seconds */

    struct {
        long         value;    /* MPIEventStatus.type    = MPIEventTypeEXTERNAL */
                               /*               .source  = MPISequence/MPIProgram */
                               /*               .info[0] = value */
        MPIEventMgr  eventMgr; /* Ignored by Sequence */
    } event;

    struct {  /* mpiMotion[Abort|EStop|Reset|Resume|Start|Stop](motion[, type, params]) */
        MPICommandMotion    motionCommand;
        MPIMotion           motion;
        MPIMotionType       type;    /* MPICommandMotionSTART */
        MPIMotionParams     params;  /* MPICommandMotionSTART */
    } motion;

    struct {  /* wait until 'expr' */
        MPICommandExpr      expr;    /* expr.oper => MPICommandOperatorLogical */
        MPIControl          control; /* Ignored by Sequence */
    } wait;

    struct {  /* wait until MPIEventMask('handle') 'oper' 'mask' */
        MPIHandle           handle; /* [MPIMotor|MPIMotion|...] */
        MPICommandOperator  oper;   /* EQUAL/NOT_EQUAL/BIT_CLEAR/BIT_SET */
        MPIEventMask        mask;   /* MPIEventMask('handle') 'oper' 'mask' */
    } waitEvent;

    struct {  /* wait until Io.input 'oper' 'mask' */
        MPIIoType           type;     /* MOTOR,   USER */
        MPIIoSource         source;   /* MPIMotor   index */
        MPICommandOperator  oper;     /* EQUAL/NOT_EQUAL/BIT_CLEAR/BIT_SET */
        long                mask;     /* [motor|user]Io.input 'oper' 'mask' */
    } waitIO;
} MPICommandParams;

Description

MPICommandParams holds the parameters used by an MPICommand. Each element in the MPICommandParams union corresponds to different types of commands (specified by the MPICommandType enumeration).

 
Element
Description
Supported by
assign

Assign a value to a particular controller address: *dst = value

assign.control is currently not supported and is reserved for future use.

MPICommandTypeASSIGN
MPICommandTypeASSIGN_FLOAT
branch

Branch to a particular command (similar to a goto statement) if a particular comparison evaluates to TRUE: branch to label on expr
If label = NULL, then no more commands will be executed if the comparison evaluates to TRUE.

branch.control is currently not supported and is reserved for future use.

MPICommandTypeBRANCH
MPICommandTypeBRANCH_REF
MPICommandTypeBRANCH_FLOAT
MPICommandTypeBRANCH_FLOAT_REF
branchEvent Branch to a particular command (similar to a goto statement) if a particular event occurs or has occured: branch to label on MPIEventMask(handle) oper mask
If label = NULL, then no more commands will be executed if a particular event occurs or has occured.
MPICommandTypeBRANCH_EVENT
branchIO Branch to a particular command (similar to a goto statement) if a particular i/o state matches a specified condition: branch to label on Io.input oper mask
If label = NULL, then no more commands will be executed if a particular i/o state matches a specified condition.
MPICommandTypeBRANCH_IO
compute

perform some computation and place the result at some controller address: *dst = expr

compute.control is currently not supported and is reserved for future use.

MPICommandTypeCOMPUTE
MPICommandTypeCOMPUTE_REF
MPICommandTypeCOMPUTE_FLOAT
MPICommandTypeCOMPUTE_FLOAT_REF
computeIO Performs a computation on a set of i/o bits: Io.output = Io.output oper mask MPICommandType_IO
copy

Copies controller memory from one place to another: memcpy(dst, src, count);
Remember: count represents the number of bytes copied, NOT the number of controller words.

event.control is currently not supported and is reserved for future use.

MPICommandTypeCOPY
delay Delays execution of the next command delay seconds. MPICommandTypeDELAY
event

Generates an event:
MPIEventStatus.type = MPIEventTypeEXTERNAL
MPIEventStatus.source = MPISequence
MPIEventStatus.info[0] = value

event.eventMgr is currently not supported and is reserved for future use.

MPICommandTypeEVENT
motion Commands a motion action (See MPICommandMotion):
mpiMotionStart (motion, type, params]);
or
mpiMotionAction(motion, MPIAction[ABORT | E_STOP | E_STOP_ABORT | RESET | RESUME | STOP]);
MPICommandTypeMOTION
wait

Delays execution of the next command until a particular comparison evaluates to TRUE: wait until expr

wait.control is currently not supported and is reserved for future use.

MPICommandTypeWAIT
MPICommandTypeWAIT_REF
MPICommandTypeWAIT_FLOAT
MPICommandTypeWAIT_FLOAT_REF
waitEvent Delays execution of the next command until a particular event occurs: wait until MPIEventMask(handle) oper mask MPICommandTypeWAIT_EVENT
waitIO Delays execution of the next command until a particular i/o state matches a specified condition: wait until Io.input oper mask MPICommandTypeWAIT_IO

See Also

MPICommand | MPICommandType | mpiCommandCreate | mpiCommandParams

 

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