mpiControlConfigSet

Declaration

MPI_RESULT
   mpiControlConfigSet(MPIControl         control,
                       MPIControlConfig   *config);

 

Required Header: stdmpi.h

Change History: Modified in 04.00.

Description

mpiControlConfigSet sets (writes) the Control object's (control) configuration using data from the structure pointed to by config.

Warning: The mpiControlReset(), mpiControlResetToDefault(), and mpiControlConfigSet() methods will all erase previously configured object settings. For this reason these methods must be called before creating any dependent objects, (motors, axes, recorders, etc.). If these methods are called after the creation of dependent objects and error (MPIControlMessageOBJECTS_CREATED) will be returned. Extra care must be taken for multi-threaded applications. If objects are created in one thread, these control methods may not return an OBJECTS_CREATED error if called from a different thread. The same problems associated with objects created before calling these methods applies however even if the objects are in different threads.

Note:

MPI objects allocated prior to an mpiControlConfigSet call, in which dynamic reallocation is performed, will be considered "obsoleted". The user will have to delete these objects and reallocate them.

If it is desired to capture the configuration of these objects, the user will have to retrieve the configuration using, say, mpiAxisConfigGet on an MPIAxis object, PRIOR to calling mpiControlConfigSet. The stored configuration can be applied on the newly obtained MPIAxis object AFTER calling mpiControlConfigSet.

If an "obsoleted" object as described above is used in an MPI method, the error returned is:

ERROR 0x631: Control: Object cannot be used after reallocation

control A handle to an Control object.
*config A pointer to the MPIControlConfig structure.
Return Values
MPIMessageOK
MPISynqNetMessageSAMPLE_PERIOD_NOT_MULTIPLE
MPISynqNetMessageTOPOLOGY_MISMATCH

Sample Code

MPIControlConfig	controlConfig;

mpiControlConfigGet(control, &controlConfig);
/* Allocate 16 captures and enable 4 */ controlConfig.dynamicMemAlloc.captureCount = 16; controlConfig.enabled.captureCount = 4; mpiControlConfigSet(control, &controlConfig);

See Also

mpiControlConfigGet | MPIControlConfig |