mpiSqNodeDriveParamSet
Declaration
int32_t mpiSqNodeDriveParamSet(MPISqNode node, int32_t driveIndex, int32_t param, MPIDriveMapParamType paramType, MPIDriveMapParamValue *value);
Required Header: stdmpi.h
Description
mpiSqNodeDriveParamSet writes the drive parameter that is pointed to by value to the drive. The paramType defines the type of data that is written to the drive and also defines which field will be used in the value union.
node | a handle to the SynqNet node object. |
---|---|
driveIndex | an index to the drive (0, 1, 2, etc), relative to the node. |
param | an index for the drive parameter that is being accessed. |
paramType | the type of data being written to the drive and which field will be used in the value union. |
*value | pointer to the union that will be written to the drive. |
Return Values | |
---|---|
MPIMessageOK |
Sample Code
/* setCommOffsetAngle(...) demonstrates how to set the commutation offset angle parameter on a S200 drive using mpiSqNodeDriveParamSet(...). MPIDriveMapParamValue is a union that holds the value of a drive parameter. MPISqNodeDriveParamType enumeration identifies which of the fields within the MPISqNodeDriveParamValue union to use. For commutation offset angle, the parameter index is 6 and the type is MPIDriveMapParamTypeSINGLE. This information can be found on the drive map file. */ int32_t setCommOffsetAngle(MPISqNode node, int32_t nodeNumber, int16_t commOffsetValue) { int32_t returnValue; MPIDriveMapParamValue value; value.single = commOffsetValue; returnValue = mpiSqNodeDriveParamSet(node, nodeNumber, 6, /* parameter index */ MPIDriveMapParamTypeSINGLE, /* parameter type */ &value); return returnValue; }