mpiSqNodeDriveMonitor

Declaration

long mpiSqNodeDriveMonitor(MPISqNode              node,
                           long                   driveIndex, /* relative to the node */
                           MPISqNodeMonitorValue  *value);

Required Header: stdmpi.h

Description

mpiSqNodeDriveMonitor reads the monitor fields from the drive and writes them into the structure pointed to by value.

node a handle to a SynqNet node object.
driveIndex an index to the drive (0, 1, 2, etc), relative to the node.
*value pointer to a structure of monitor values
Return Values
MPIMessageOK

Sample Code

/* This function configure monitorA to look at index 10 on the drive
and display the monitorA value after. For Kollmorgen CD drive, index 10
shows the actual torque on the drive */

void driveCurrentMonitor(MPISqNode sqNode)
{
   MPISqNodeDriveMonitorConfig  monitorConfig; 
   MPISqNodeMonitorValue        value;
   long                         returnValue;

   /* Always do a ConfigGet before a ConfigSet */
   returnValue = mpiSqNodeDriveMonitorConfigGet(sqNode,
                                                0, /* driveIndex */
                                                &monitorConfig);
   msgCHECK(returnValue);

   /* Configure monitorA to look at index 10 */
   monitorConfig.monitorA.data.index = 10;
   monitorConfig.monitorA.type       = MPISqNodeDriveMonitorDataTypeINDEX;

   returnValue = mpiSqNodeDriveMonitorConfigSet(sqNode, 
                                                0, /* driveIndex */
                                                &monitorConfig);
   msgCHECK(returnValue);

   /* Get all monitor (A, B and C) values */
   returnValue = mpiSqNodeDriveMonitor(sqNode, 
                                       0, /* driveIndex */
                                       &value);
   msgCHECK(returnValue);

   /* Print monitorA value */
   printf("MonitorValueA: %ld\n", value.monitor[MPISqNodeMonitorValueIndexA]);
}

See Also

MPISqNodeMonitorValue