Herunterladen Inhalt Inhalt Diese Seite drucken

Siemens Simatic S7-1500 Funktionshandbuch Seite 134

Kinematikfunktionen v4.0 im tia portal v15
Vorschau ausblenden Andere Handbücher für Simatic S7-1500:
Inhaltsverzeichnis

Werbung

Grundlagen
3.8 Kinematiktransformation
SCL
//Caste of the variant "TransformationParameters" to the referenced datatype
//"TO_Struct_TransformationParameter_V1".
//This has to be done in order to access the variant pointer, which references
//the "TransformationParameters" where the "AxisData" and "CartesianData" for
//the calculation of user transformation are stored.
#P ?= #TransformationParameters;
//Check if cast of "TransformationParameters" was successfull. Otherwise abort calcula-
tion.
IF #P = NULL THEN
#FunctionResult := #InvalidCast;
RETURN;
END_IF;
//Check if "KinematicsUserDefined2D" needs transformation.
IF #KinematicsObject = "KinematicsUserDefined2D" THEN
//Read the user defined cartesian parameters.
#GearRatioA1 := "KinematicsUserDefined2D".Kinematics.Parameter[1];
#GearRatioA2 := "KinematicsUserDefined2D".Kinematics.Parameter[2];
//Calculate the forward transformation "AxisData" -> "CartesianData".
//The system fills the "AxisData" of "TransformationParameters" with values.
//To calculate the "CartesianData" evaluate "AxisData".
IF #TransformationType = 0 THEN
//Calculate the position, velocity and acceleration component for the x-vector.
#P^.CartesianData.xPosition := #P^.AxisData.a1Position * #GearRatioA1;
#P^.CartesianData.xVelocity := #P^.AxisData.a1Velocity * #GearRatioA1;
#P^.CartesianData.xAcceleration := #P^.AxisData.a1Acceleration * #GearRatioA1;
//Calculate the position, velocity and acceleration component for the z-vector.
#P^.CartesianData.zPosition := #P^.AxisData.a2Position * #GearRatioA2;
#P^.CartesianData.zVelocity := #P^.AxisData.a2Velocity * #GearRatioA2;
#P^.CartesianData.zAcceleration := #P^.AxisData.a2Acceleration * #GearRatioA2;
//Link constellation can be set to 0 here, hence it is not needed.
#P^.CartesianData.LinkConstellation := 16#0000;
//Transformation was successfull.
#FunctionResult := 0;
//Calculate the backward transformation "CartesianData" -> "AxisData".
//The system fills the "CartesianData" of "TransformationParameters" with values.
//To calculate the "AxisData" evaluate "CartesianData".
ELSIF #TransformationType = 1 THEN
//Calculate the position, velocity and acceleration component for the first axis.
#P^.AxisData.a1Position := #P^.CartesianData.xPosition / #GearRatioA1;
#P^.AxisData.a1Velocity := #P^.CartesianData.xVelocity / #GearRatioA1;
#P^.AxisData.a1Acceleration := #P^.CartesianData.xAcceleration / #GearRatioA1;
134
S7-1500T Kinematikfunktionen V4.0 im TIA Portal V15
Funktionshandbuch, 12/2017, A5E42062539-AA

Quicklinks ausblenden:

Werbung

Inhaltsverzeichnis
loading

Diese Anleitung auch für:

Simatic s7-1500t

Inhaltsverzeichnis