.

mpiControlFlashConfigSet

Declaration

 
long mpiControlFlashConfigSet(MPIControl       control,
                              void             *flash,
                              MPIControlConfig *config,
                              void             *external) 
  Required Header: stdmpi.h

Description

mpiControlFlashConfigSet sets (writes) the flash configuration of a Control object (control), using data from the structure pointed to by config, and also using data from the implementation-specific structure pointed to by external (if external is not NULL).

The Control's flash configuration information in external is in addition to the Control's flash configuration information in config, i.e., the flash configuration information in config and in external is not the same information. Note that config or external can be NULL (but not both NULL).

Remarks

external either points to a structure of type MEIControlConfig{} or is NULL. flash is either an MEIFlash handle or MPIHandleVOID. If flash is MPIHandleVOID, an MEIFlash object will be created and deleted internally.

 
control a handle to a Control object
*flash flash is either an MEIFlash handle or MPIHandleVOID. If flash is MPIHandleVOID, an MEIFlash object will be created and deleted internally. Using MPIHandleVOID is recommended, as it simplifies code.

If flash is a valid MEIFlash handle, then the MEIFlash object cache will be updated, but the actual write to controller flash will not occur. Use meiFlashMemoryFromFileType(...) to prompt the actual write to flash.

*config a pointer to a configuration structure for the control object of type MPIControlConfig.
*external a pointer to a configuration structure for the control object of type MEIControlConfig.
   
 
Return Values  
MPIMessageOK  
MEIFlashMessageNETWORK_TOPOLOGY_ERROR  

Sample Code

/*
  Write a value to element index of the user buffer.
  Make sure to save topology to flash before doing this.
*/
void write2UserBufferFlash(MPIControl control, long value, long index)
{
  MPIControlConfig config;
     MEIControlConfig external;
     long returnValue;
	
     if((index < MEIXmpUserDataSize) && (index >= 0))
     {
         /* Make sure to save topology to flash before doing this */
         returnValue = mpiControlFlashConfigGet(control,
               MPIHandleVOID,
               &config,
               &external);
         msgCHECK(returnValue);

         external.UserBuffer.Data[index] = value;

         returnValue = mpiControlFlashConfigSet(control,
               MPIHandleVOID,
               &config,
               &external);	
         msgCHECK(returnValue);
     }
}

See Also

MEIFlash | mpiControlFlashConfigGet | | MEIControlConfig

 

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