|
/* 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(MEISqNode sqNode)
{
MEISqNodeDriveMonitorConfig monitorConfig;
MEISqNodeMonitorValue value;
long returnValue;
/* Always do a ConfigGet before a ConfigSet */
returnValue = meiSqNodeDriveMonitorConfigGet(sqNode,
0, /* driveIndex */
&monitorConfig);
msgCHECK(returnValue);
/* Configure monitorA to look at index 10 */
monitorConfig.monitorA.data.index = 10;
monitorConfig.monitorA.type = MEISqNodeDriveMonitorDataTypeINDEX;
returnValue = meiSqNodeDriveMonitorConfigSet(sqNode,
0, /* driveIndex */
&monitorConfig);
msgCHECK(returnValue);
/* Get all monitor (A, B and C) values */
returnValue = meiSqNodeDriveMonitor(sqNode,
0, /* driveIndex */
&value);
msgCHECK(returnValue);
/* Print monitorA value */
printf("MonitorValueA: %ld\n", value.monitor[MEISqNodeMonitorValueIndexA]);
}
|