Calibration / Configuration / Logic Method and ModuleInterface
A robot needs two methods to be programmed: Calibration and Logic.
With the method Calibration, you can add code to calibrate a robot. Calibration is necessary if, for example, a motor or gearbox was replaced.
The method Calibration has an input (i_ifCalibration: SER.IF_RobotTSeriesCalibration) and an output (q_xRequest).
oIf you want to execute a calibration, the output q_xRequest has to be set to TRUE and has to remain TRUE during calibration.
With setting q_xRequest to TRUE, the robot is disabled so that the robot does not use the drives.
oIf the robot is disabled, the i_ifCalibration is validated, and you can use i_ifCalibration to execute a calibration.
i_ifCalibration.xDone gives feedback if calibration is finished.
If you add variables to methods, these variables are volatile variables and are reinitialized with every call of the method. If you need variables that save their data, refer to Data Exchange with ModuleInterfaceSave Data.
If you need variables to control your code, refer to Data Exchange with ModuleInterface.
Calibration method example:
ModuleInterface (left side):
oi_xEnableCalibration and i_xCalibrationStandard are input variables created to control calibration. Refer to Data Exchange with ModuleInterface.
oetDiagCalibration, etDiagExtCalibration, sMsgCalibration, xCalibrationDone, and xCalibrationStarted are variables, for example, to read present state. Refer to Data Exchange with ModuleInterfaceSave Data.
Calibration method (right side):
oUse the variables, created in ModuleInterface, in the method Calibration.
oVerify that i_ifCalibration is valid before using it. (For example, line 3 of implementation of method Calibration: IF (i_ifCalibration <> 0) THEN).
oA method to start calibration (for example StandardProcedure) must only be called once, not cyclically. (Line 4 to 9 of implementation of method Calibration).
oi_ifCalibration.xDone gives feedback if calibration has been executed. For further information on calibration, refer to SchneiderElectricRobotics Library Guide.
oUpdate your call of the robot. (Add i_xEnableCalibration and i_xCalibrationStandard to the call of the robot).
If you use the code generation option for Non Template robots, the call of the robot is updated automatically.
To start this calibration example, you must set the inputs i_xEnableCalibration and i_xCalibrationStandard to TRUE. i_xEnableCalibration must be set to TRUE during calibration.
You can use the method Configuration for additional configuration, for example, to add a tracking system. This method is called once before ConfigDone.
With the method Logic, you can add code, for example, to support robot motion.
The method Logic has an input/output (iq_stRoboticModuleItf).
oWith the input/output (iq_stRoboticModuleItf) you access, for example, IF_RobotMotion to set move commands or to IF_RobotFeedback to receive information of the status of the robot.
If you want to use variables of IF_RobotFeedback outside of the Logic method (for example for a trace), you can add a variable of type ROB.IF_RobotFeedback to the ModuleInterface and copy iq_stRoboticModuleItf.iq_ifFeedback of Logic to the new variable.
Verify that interface is valid before using it (for example iq_stRoboticModuleItf.iq_ifFeedback <> 0).
If you add variables to methods, these variables are volatile variables and are reinitialized with every call of the method. If you need variables that save their data, refer to Data Exchange with ModuleInterfaceSave Data.
If you need variables to control your code, refer to Data Exchange with ModuleInterface.