.

mpiControlClientCountSet

Declaration

 
long mpiControlClientCountSet(MPIControl control, unsigned long clientCount);
  Required Header: control.h
Change History: Added in 03.04.11

Description

mpiControlClientCountSet sets the number of client connections to be used by the MPIControl object when connecting to remote controllers. Increasing the number of connections will improve performance of multi-threaded client MPI applications.

mpiControlClientCountSet must be called between mpiControlCreate(…) and mpiControlInit(…). Once mpiControlInit(…) has been called, it is not possible to change the number of clients used to communicate to the server.

Note: The MPI application utility (apputil) library’s Service, CacheService, and HostService objects all spawn a single thread. It is recommended that an application set clientCount to the number of threads the application directly creates that will access the remote controller plus one for each of the Service, CacheService, and HostService objects created.

control Handle to the Control object.
clientCount The number of client connections to use for the MPIControl object.

Return Values  
MPIMessageOK Method succeeded.
MPIMessageARG_INVALID clientCount is less than 1 or greater than 128.
MPIControlMessageTYPE_INVALID The control object is not of type MPIControlTypeCLIENT.
MEIPlatformMessageALREADY_INITIALIZED mpiControlInit(…) or meiControlInit(…) has already been called to initialize control.
MPIMessageUNSUPPORTED mpiControlClientCountGet is not supported on the operating system

Sample Code

/* Create and initialize MPI objects */
void programInit(MPIControl         *control,
                 MPIControlType      controlType,
                 MPIControlAddress  *controlAddress,
                 long                clientCount)
{

    long    returnValue;

    /* Create motion controller object */
    *control =
        mpiControlCreate(controlType, controlAddress);
    msgCHECK(mpiControlValidate(*control)); 

    /* Set the MPIControl object's client connection count */
    returnValue =
        mpiControlClientCountSet(*control, clientCount);
    msgCHECK(returnValue);

    /* Initialize motion controller */
    returnValue =
        mpiControlInit(*control);
    msgCHECK(returnValue); 

}

See Also

mpiControlClientCountGet

 

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