Writing the reference values for the configured robot components cartesian, orientation and auxiliary axes.
This method is called from the FB_Robot every Sercos cycle if the robot is enabled.
With the method WriteRefValues(…), the reference values of the robot components cartesian, orientation, and auxiliary axes can be calculated and passed to the robot.
The reference values that are passed are then forwarded to the configured transformation to calculate the robot axes positions. The calculated axes positions are forwarded to the axes in the same Sercos cycle.
Reference values can be passed for configured and supported robot components only. If a value for an unconfigured robot component is passed to the robot, the robot reports a diagnostic message.
The diagnostic outputs can be used to forward an exception from this method to the robot. The forwarded exception is reported by the FB_Robot and the robot axes are stopped by a ControllerStop.
Output |
Data type |
Description |
---|---|---|
q_etDiag |
General, library-independent statement on the diagnostic. A value not equal to ET_Diag.Ok corresponds to a diagnostic message. |
|
q_etDiagExt |
POU-specific output for the diagnostic. q_etDiag = ET_Diag.Ok -> Status message q_etDiag <> ET_Diag.Ok -> Diagnostic message |
|
q_sMsg |
STRING[80] |
Event-triggered message that gives additional information on the diagnostic state. |
q_stRefPositionTCP |
Reference position of TCP. |
|
q_stRefOrientationTCP |
Reference position of orientations. |
|
q_etRefArmConfiguration |
ET_ArmConfiguration |
Reference arm configuration of the robot. |
q_alrRefPositionAuxAx |
ARRAY [ET_RobotComponent.AuxAx1... (ET_RobotComponent.AuxAxAll + Gc_udiMaxNumberOfAuxiliaryAxes)] OF LREAL |
Reference position of auxiliary axes. |
q_etDiag |
q_etDiagExt |
Enumeration value |
Description |
---|---|---|---|
ExecutionAborted |
AuxiliaryAxisNotConfigured |
127 |
The auxiliary axis is not configured. |
ExecutionAborted |
ComponentNotConfigured |
198 |
The component is not configured. |
ExecutionAborted |
ArmConfigurationInvalid |
200 |
The arm configuration is invalid. |
Enumeration name: |
ArmConfigurationInvalid |
Enumeration value: |
200 |
Description: |
The arm configuration is invalid. |
Issue |
Cause |
Solution |
---|---|---|
Writing the reference values for the configured robot components was unsuccessful. |
A reference value for the arm configuration was passed to the robot. The robot does not support the arm configuration passed or does not support any arm configuration. |
Ensure that no reference value for the arm configuration is passed to the robot in the case that the robot does not support an arm configuration, or ensure that a valid reference value for the arm configuration is passed to the robot in the case that it does. |
Enumeration name: |
AuxiliaryAxisNotConfigured |
Enumeration value: |
127 |
Description: |
The auxiliary axis is not configured. |
Issue |
Cause |
Solution |
---|---|---|
Writing the reference values for the configured robot components was unsuccessful. |
A reference value for an unconfigured auxiliary axis was passed to the robot. |
Ensure that no reference value for an unconfigured robot component is passed to the robot. |
Enumeration name: |
ComponentNotConfigured |
Enumeration value: |
198 |
Description: |
The component is not configured. |
Issue |
Cause |
Solution |
---|---|---|
Writing the reference values for the configured robot components was unsuccessful. |
A reference value for an unconfigured Cartesian component or orientation was passed to the robot. |
Ensure that no reference value for an unconfigured robot component is passed to the robot. |
Declaration:
METHOD WriteRefValues
VAR_OUTPUT
q_etDiag : GD.ET_Diag := GD.ET_Diag.Ok;
q_etDiagExt : ROB.ET_DiagExt := ROB.ET_DiagExt.Ok;
q_sMsg : STRING[80];
q_stRefPositionTCP : PDL.ST_Vector3D;
q_stRefOrientationTCP : PDL.ST_Vector3D;
q_etRefArmConfiguration : ROB.ET_ArmConfiguration;
q_alrRefPositionAuxAx : ARRAY [ROB.ET_RobotComponent.AuxAx1..
ROB.ET_RobotComponent.AuxAxAll +
ROB.Gc_udiMaxNumberOfAuxiliaryAxes)]
OF LREAL;
END_VAR
VAR
etAuxAx : ROB.ET_RobotComponent;
END_VAR
Implementation:
// Implementation of the external position source.
// Handover the reference values of the configured robot components.
// Do not write outputs of not configured or not supported robot
components.
//********************************************************************
// Reference values of the Tool Center Point
//********************************************************************
// q_stRefPositionTCP.lrX := ...;
// q_stRefPositionTCP.lrY := ...;
// q_stRefPositionTCP.lrZ := ...;
//********************************************************************
// Reference values of the Tool Center Point
//********************************************************************
// q_stRefOrientationTCP.lrX := ...;
// q_stRefOrientationTCP.lrY := ...;
// q_stRefOrientationTCP.lrZ := ...;
//********************************************************************
// Reference value of the arm configuration
//********************************************************************
// q_etRefArmConfiguration := ...;
//********************************************************************
// Reference values of the auxiliary axes
//********************************************************************
// FOR etAuxAx := ROB.ET_RobotComponent.AuxAx1 TO
// (ROB.ET_RobotComponent.AuxAxAll + ROB.Gc_udiMaxNumberOfAuxiliaryAxes)
DO
//
// q_alrRefPositionAuxAx[etAuxAx] := ...;
//
// END_FOR