mpiSqNodeDriveParamGet

Declaration

long mpiSqNodeDriveParamGet(MPISqNode                 node,
                            long                      driveIndex,
                            long                      param,
                            MPIDriveMapParamType      paramType,
                            MPIDriveMapParamValue     *value);

Required Header: stdmpi.h

Description

mpiSqNodeDriveParamGet reads a drive parameter from the drive and fills in the appropriate field of the union pointed to by value. The paramType defines the type of data that is read from 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 the data read from the drive and which field will be used in the value union.
*value a pointer to the union that will be filled in.
Return Values
MPIMessageOK

Sample Code

/* readCommOffsetAngle(...) demonstrates how to read the 
commutation offset angle parameter on a S200 drive using 
mpiSqNodeDriveParamGet(...). 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.
*/
long readCommOffsetAngle(MPISqNode  node, 
                         long       nodeNumber, 
                         short*     commOffsetValue)
{
   long returnValue;
   MPIDriveMapParamValue value;
   returnValue = 
       mpiSqNodeDriveParamGet(node,
                              nodeNumber,
                              6, /* parameter index */
                              MPIDriveMapParamTypeSINGLE, 
                                 /* parameter type */
                              &value);
   *commOffsetValue = value.single;
   return returnValue;
}

See Also

mpiSqNodeDriveParamSet