mpiSqNodeDriveMonitor
Declaration
int32_t mpiSqNodeDriveMonitor(MPISqNode node, int32_t 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; int32_t 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]); }