mpiUserLimitCreate

Declaration

MPI_DECL1 MPI_RESULT MPI_DECL2
mpiUserLimitCreate(MPIUserLimit *userLimit,
                   MPIControl    control,
                   size_t        number);

 

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

Description

mpiUserLimitCreate creates a user limit object associated with the user limit identified by number belonging to MPIMotor object motor. mpiUserLimitCreate is the equivalent of a C++ constructor.

userLimit A pointer to the location where the new user limit handle is written.
control The parent controller of the user limit object.
number The number of the user limit to create.

Sample Code

MPIUserLimit createDisabledUserLimit(MPIControl control, long number)
	{
        MPI_RESULT         returnValue;

        MPIUserLimit       userLimit = MPIHandleVOID;

        /* Create user limit */

        returnValue = mpiUserLimitCreate(&userLimit, control, number);

        msgCHECK(returnValue);

        /* Disable user limit in case the user limit was enabled */

        returnValue = mpiUserLimitEnableSet(userLimit, FALSE);

        if (returnValue != MPIMessageOK)
        {
            /* Free resources in case anything went wrong */
            mpiUserLimitDelete(userLimit);
            msgCHECK(returnValue);
        }
        return userLimit;
}

See Also

mpiUserLimitValidate | mpiUserLimitDelete