.

MPIRecorderConfig / MEIRecorderConfig

Definition: MPIRecorderConfig

 
typedef struct MPIRecorderConfig {
    long     period;
    long     highCount;  /* >0 => record count to trigger high buffer */
    MPI_BOOL bufferWrap;

    long  addressCount;  /* number of data point addresses in address[] */
    void  *address[MPIRecorderADDRESS_COUNT_MAX];
} MPIRecorderConfig;
  Change History: Modified in the 03.03.00

Description

MPIRecorderConfig structure specifies the configurations for a data recorder. It configures the sampling period, the buffer high event level, whether the buffering should wrap around, and a list of controller addresses to record.

 
period The number of controller samples between successive data recorder acquisitions. A value of zero or one means the data recorder will acquire data every sample. A value of 2 means every other sample, 3 means every 3rd sample, etc. The valid range is 0 to 32767.
highCount The number of buffered records until a MPIEventTypeRECORDER_HIGH status/event is generated. The valid range is 1 to the recorder buffer size configured by mpiControlConfigSet(...).
bufferWrap

Data recorder buffer rollover. A value of TRUE enables the buffer rollover, FALSE (default) disables the buffer rollover.

When bufferWrap is TRUE, the controller will continuously collect data after the buffer is full, overwriting any previously collected data.

When the bufferWrap is FALSE, the controller will suspend the collection of data when the buffer is full. Later, when data is collected from the recorder, its buffer will no longer be full and the controller will resume the collection of data. See Best Practices when using the Data Recorder for more information.

The bufferWrap should only be set to TRUE if your application only wants to retrieve the last buffer of data after the data recorder is stopped. Most applications should set the bufferWrap to FALSE.

NOTE: Allowing buffer rollover will only be enabled when -1 is passed into mpiRecorderStart(…) for the count parameter.

addressCount The number of controller addresses in the address array.
*address An array of controller memory addresses to be recorded.

 

Definition: MEIRecorderConfig

 
typedef struct	MEIRecorderConfig {
    MEIRecorderTrigger  trigger[MEIRecorderTriggerIndexLAST];
} MEIRecorderConfig;

Description

MEIRecorderConfig specifies the configurations for the controller's data recorder triggers.

A data recorder can be started or stopped from the host application with mpiRecorderStart/Stop(...) or from the controller by configuring a data recorder trigger. When the trigger conditions are met, the controller will automatically start or stop a data recorder.

 
trigger

An array of data recorder trigger configuration structures.

Sample Code


/*
   This function configures the Recorder Settings. The Recorder 
   Period is the number of samples in between recording, if set to 0, 
   the recorder will record every sample. The highCount is the number 
   of samples that need to be recorded before a RecorderHigh event 
   will be triggered. If bufferWrap is specified as True, when the 
   recorder is full, the recorder will wrap in a circular buffer 
   and begin writing at the beginning of the recorder buffer without 
   any loss.
*/
long recorderConfig(MPIRecorder recorder, long recorderPeriod, long highCount, bool bufferWrap) { MPIRecorderConfig recorderConfig; long returnValue; /* Get recorder configuration handle */ returnValue = mpiRecorderConfigGet(recorder, &recorderConfig, NULL); if(returnValue != MPIMessageOK) { return returnValue; } /* Config recorder parameters */ recorderConfig.period = recorderPeriod;
recorderConfig.highCount = highCount; recorderConfig.bufferWrap = bufferWrap; /* Set recorder configuration using handle */ returnValue = mpiRecorderConfigSet(recorder, &recorderConfig, NULL); return returnValue; }

See Also

mpiRecorderConfigGet | mpiRecorderConfigSet | mpiRecorderStart | mpiRecorderStop

Best Practices when using the Data Recorder

 

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