mpiControlResetToDefault

Definition

MPI_DECL1 MPI_RESULT MPI_DECL2
	mpiControlResetToDefault(MPIControl control);

 

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

Description

mpiControlResetToDefault effectively resets the controller, setting the controller's RAM memory to default values. The controller's RAM memory is not loaded from firmware settings.

To erase the object configurations from the controller, you must call mpiControlResetToDefault, followed by mpiControlFlashSaveAll.

Note: the sample counter will not be reset from a call to mpiControlResetToDefault. Other than where the controller's RAM memory receives its new values, this is the major difference between mpiControlResetToDefault and mpiControlReset.

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.

control The controller on which the RAM memory will be reset to default values.
Return Values
MPIMessageOK

Sample Code

/* Erase all configurations from flash memory */
void eraseFlashMemoryConfigurations(MPIControl control)
{
  MPI_RESULT returnValue = mpiControlResetToDefault(control);
  msgCHECK(returnValue);

  returnValue = mpiControlFlashSaveAll(control, NULL, NULL);
  msgCHECK(returnValue);
}

See Also

mpiControlFlashSaveAll