.

mpiControlConfigSet

Declaration

 
long mpiControlConfigSet(MPIControl       control,
                         MPIControlConfig *config,
                         void             *external)
 

Required Header: stdmpi.h

Description

mpiControlConfigSet sets (writes) the Control object's (control) configuration 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 configuration information in external is in addition to the configuration information in config, i.e, the configuration information in config and in external is not the same information. Note that config or external can be NULL (but not both NULL).

WARNING: mpiControlConfigSet(...) is a controller-wide routine that will clear other controller object configurations and potentially force a reset of the SynqNet network. This method should be executed in your application before configuring any other MPI objects. For information regarding which configurations force a reset of the SynqNet network, please see the Warning message for MPIControlConfig / MEIControlConfig.

Remarks

external either points to a structure of type MEIControlConfig{} or is NULL.

 
Return Values  
MPIMessageOK  
MEISynqNetMessageSAMPLE_PERIOD_NOT_MULTIPLE  
MEISynqNetMessageTOPOLOGY_MISMATCH  

Sample Code


/*
  Write a value to element index of the user buffer.
  Make sure to save topology to flash before doing this.
*/
void write2UserBuffer(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 = mpiControlConfigGet(control,
           &config,
           &external);
      msgCHECK(returnValue);

      external.UserBuffer.Data[index] = value;

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

See Also

mpiControlConfigGet | MEIControlConfig | Dynamic Allocation of External Memory Buffers

 

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