You're reading the documentation for an older, but still supported version
(GL013300).
For information on the latest version, please have a look at GL013301.
For information on the latest version, please have a look at GL013301.
get_workpiece_weight
This function measures and returns the current workpiece weight that has been set or detected by the robot controller. The returned value represents the workpiece component of the total payload (excluding tool weight).
Definition
DRFLEx.h within class CDRFLEx, public section (line 678)
float get_workpiece_weight() {
return _get_workpiece_weight(_rbtCtrl);
};
Parameter
None
Return
Value |
Description |
|---|---|
float |
Measured workpiece weight in kilograms (kg). |
Example
#include "DRFLEx.h"
using namespace DRAFramework;
int main() {
CDRFLEx drfl;
// Retrieve the current workpiece weight
float weight = drfl.get_workpiece_weight();
// Print the measured weight value
printf("Current workpiece weight: %.3f kg\n", weight);
}
This example retrieves the currently measured or configured workpiece weight and prints the value to the console for verification or monitoring.