MPIControlSubSampleMap
Declaration
typedef struct MPIControlSubSampleMap { MPIControlSubSampleMapObject object[MPIControlMAX_OBJECTS]; } MPIControlSubSampleMap;
Required Header: mpithread.h
Change History: Added in 04.00.
Description
object | An array of sub-sampling configurations.
If the MPIControlSubSampleMap structure represents the sub-sampling configuration for Axis objects, then:
object[0] will represent the sub-sampling configuration for Axis[0] object[1] will represent the sub-sampling configuration for Axis[1] object[2] will represent the sub-sampling configuration for Axis[2] |
---|
Sample Code
/* Configure Sub-Sampling Example 1 Assume 1-to-1 MS-to-Axis mapping. All related objects of a given index have (ex: MS[1], Axis[1], Motor[1]) same sampling rate. Evaluation Matrix: ------------------ Sample: 0 1 2 3 Object 0: X X X X Object 1: X X Object 2: X X Object 4: X ............................. Total objects Evaluated: 3 2 2 2 (even-weighted) */ void configureSubSampling1(MPIControl control) { MPIControlSubSampleMap subSampleMap = {{ /* subRate, sampleStartIndex */ { 1, 0 }, /* Object 0: every sample, must start on sample 0 */ { 2, 0 }, /* Object 1: every other sample, start on sample 0 */ { 2, 1 }, /* Object 2: every other sample, start on sample 1 */ { 4, 0 } /* Object 3: every 4th sample, start on sample 0 */ }}; MPIControlProcessMap processMap = { &subSampleMap /* motionMap */ /* axisMap, motorMap, mechaWareMap are default initialized to NULL. This means these maps will be indentical to motionMap. */ /* motionOrder, axisOrder, motorOrder, mechaWareOrder are default initialized to NULL. This means deafult ordering applies to all objects */ }; MPIControlConfig config; MPI_RESULT returnValue; returnValue = mpiControlConfigGet(control, &config); msgCHECK(returnValue); config.processMap = processMap; returnValue = mpiControlConfigSet(control, &config); msgCHECK(returnValue); }
See Also
MPIControlProcessMap | MPIControlSubSampleMapObject