瀏覽代碼

add srd io config releated

chenzk 5 天之前
父節點
當前提交
3ac5e77e45

+ 120 - 0
PunkHPX8_RT/Config/Devices/Beckhoffcfg - plctask.xml

@@ -108,6 +108,35 @@
 		<Input Name="r_TILT_CYLINDER_PRESSURE" Address="MAIN.PlatingCell1_2_AI_8CHANNEL_0_10V_EL3086_N402_4" Scaling="0=0, 100=32767" Type="Analog" DataType="udint"/>
 
 		<!-- facility inputs end -->
+		
+		<!--SRD inputs Start-->
+		<Input Name="r_SRD_FLUID_LEVEL"  Address="MAIN.r_SRD_FLUID_LEVEL" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD_SUPPLY_WATER_PRESS"  Address="MAIN.r_SRD_SUPPLY_WATER_PRESS" Scaling="0=3276.7,50=32767" Type="Analog" DataType="int"/>
+		<!--SRD inputs End-->
+		
+
+		<!--SRD1 inputs Start-->
+		<Input Name="r_SRD1_SHUTTER_CLOSED"  Address="MAIN.r_SRD1_SHUTTER_CLOSED" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_SHUTTER_OPEN"  Address="MAIN.r_SRD1_SHUTTER_OPEN" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_CHUCK_VAC_OK"  Address="MAIN.r_SRD1_CHUCK_VAC_OK" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_WAFER_PRESENT"  Address="MAIN.r_SRD1_WAFER_PRESENT" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_LIFT_UP"  Address="MAIN.r_SRD1_LIFT_UP" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_100_FLIPPER1_OUT"  Address="MAIN.r_SRD1_100_FLIPPER1_OUT" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_100_FLIPPER2_OUT"  Address="MAIN.r_SRD1_100_FLIPPER2_OUT" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_100_FLIPPER3_OUT"  Address="MAIN.r_SRD1_100_FLIPPER3_OUT" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_150_FLIPPER1_OUT"  Address="MAIN.r_SRD1_150_FLIPPER1_OUT" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_150_FLIPPER2_OUT"  Address="MAIN.r_SRD1_150_FLIPPER2_OUT" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_150_FLIPPER3_OUT"  Address="MAIN.r_SRD1_150_FLIPPER3_OUT" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_200_FLIPPER1_OUT"  Address="MAIN.r_SRD1_200_FLIPPER1_OUT" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_200_FLIPPER2_OUT"  Address="MAIN.r_SRD1_200_FLIPPER2_OUT" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_SRD1_200_FLIPPER3_OUT"  Address="MAIN.r_SRD1_200_FLIPPER3_OUT" Invert="false" Type="Digital" DataType="bool"/>
+
+		<Input Name="r_SRD1_CHUCK_VACUUM_anlg"  Address="MAIN.r_SRD1_CHUCK_VACUUM_anlg" Scaling="-757.5=3276.7,757.5=16383.5" Type="Analog" DataType="int"/>
+		<Input Name="r_SRD1_WAFER_PRESENT_anlg"  Address="MAIN.r_SRD1_WAFER_PRESENT_anlg" Scaling="0=0,100=32767" Type="Analog" DataType="int"/>
+		<Input Name="r_SRD1_WATER_FLOW"  Address="MAIN.r_SRD1_WATER_FLOW" Scaling="0=3276.7,2.5=32767" Type="Analog" DataType="int"/>
+		<!--SRD1 inputs End-->
+		
+		
 
 		<!--PlatingCell1 inputs Start-->
 		<Input Name="r_PlatingCell1_2_HEAD_TILTED"  Address="MAIN.PlatingCell1_2_DI_16CHANNEL_EL1819_N400_4" Invert="false" Type="Digital" DataType="bool"/>
@@ -264,6 +293,24 @@
 		
 		<!-- facility outputs end -->
 		
+		
+		<!--SRD1 outputs Start-->
+		<Output Name="c_SRD1_Water_Above_Wafer"  Address="MAIN.c_SRD1_Water_Above_Wafer" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_Water_Below_Wafer"  Address="MAIN.c_SRD1_Water_Below_Wafer" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_Exhaust_Fan_On"  Address="MAIN.c_SRD1_Exhaust_Fan_On" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_Shutter_Close"  Address="MAIN.c_SRD1_Shutter_Close" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_CHUCK_VACUUM"  Address="MAIN.c_SRD1_CHUCK_VACUUM" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_CHUCK_ATM_ON"  Address="MAIN.c_SRD1_CHUCK_ATM_ON" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_LIFT_UP"  Address="MAIN.c_SRD1_LIFT_UP" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_100_FLIPPERS_IN"  Address="MAIN.c_SRD1_100_FLIPPERS_IN" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_150_FLIPPERS_IN"  Address="MAIN.c_SRD1_150_FLIPPERS_IN" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_200_FLIPPERS_IN"  Address="MAIN.c_SRD1_200_FLIPPERS_IN" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_WATER_ON"  Address="MAIN.c_SRD1_WATER_ON" Invert="false" Type="Digital" DataType="bool"/>
+		<Output Name="c_SRD1_N2_FLOW_ON"  Address="MAIN.c_SRD1_N2_FLOW_ON" Invert="false" Type="Digital" DataType="bool"/>
+		<!--SRD1 outputs End-->
+		
+		
+		
 		<!--PlatingCell1 outputs Start-->
 		<Output Name="c_CELL1_CLAMSHELL_CLOSE" Address="MAIN.PlatingCell1_2_DO_16CHANNEL_EL2809_N401_9" Type="Digital" Invert="false" DataType="bool"/>
 		<Output Name="c_PlatingCell1_2_HEAD_TILT" Address="MAIN.PlatingCell1_2_DO_16CHANNEL_EL2809_N401_13" Type="Digital" Invert="false" DataType="bool"/>
@@ -535,5 +582,78 @@
 			<FeedforwardAcceleration>0</FeedforwardAcceleration>
 			<OffOnError>0</OffOnError>
 		</Axis>
+		<Axis Name="SRD1.Rotation" MotorType="Kollmorgen" COEAddress="192.168.0.14.4.1" COEPort="1016" DebugLogging="false">
+			<Input Address="MAIN.SRD1RotationStatusWord" Type="StatusWord" DataType="uint"/>
+			<Input Address="MAIN.SRD1RotationDigitalInputs" Type="DigitalInputs" DataType="udint"/>
+			<Input Address="MAIN.SRD1RotationMotorPosition" Type="MotorPosition" DataType="dint"/>
+			<Input Address="MAIN.SRD1RotationPositionError" Type="PositionError" DataType="dint"/>
+			<Input Address="MAIN.SRD1RotationActualVelocity" Type="ActualVelocity" DataType="dint"/>
+			<Input Address="MAIN.SRD1RotationActualTorque" Type="ActualTorque" DataType="int"/>
+			<!-- Input Address="MAIN.Loader1Rotation_DigitalOutputs" Type="DigitalOutputs" DataType="dint"/ -->
+			<Input Address="0x607D:01" Type="SoftwareLimitMinus" DataType="dint"/>
+			<Input Address="0x607D:02" Type="SoftwareLimitPlus" DataType="dint"/>
+			<Input Address="0x6098:00" Type="HomingMethod" DataType="byte"/>
+			<Input Address="0x607C:00" Type="HomeOffset" DataType="dint"/>
+			<Input Address="0x6099:01" Type="HomingVelocity" DataType="dint"/>
+			<Input Address="0x6099:02" Type="HomingVelocitySlow" DataType="dint"/>
+			<Input Address="0x609A:00" Type="HomingAccel" DataType="dint"/>
+			<Input Address="0x2403:00" Type="NegativeTorqueLimit" DataType="uint"/>
+			<Input Address="0x2402:00" Type="PositiveTorqueLimit" DataType="uint"/>
+			<Input Address="0x6085:00" Type="EStopDecel" DataType="udint"/>
+			<Input Address="0x2406:00" Type="EStopTorque" DataType="uint"/>
+			<Input Address="0x607F:00" Type="VelocityLimit" DataType="udint"/>
+			<Input Address="0x2522:00" Type="PositionWindow" DataType="udint"/>
+			<Input Address="0x2520:00" Type="FollowingErrorWindow" DataType="udint"/>
+			<Input Address="0x603F:00" Type="ErrorCode" DataType="uint"/>
+
+			<Output Address="MAIN.SRD1RotationControlWord" Type="ControlWord" DataType="uint"/>
+			<Output Address="MAIN.SRD1RotationModeOfOperation" Type="ModeOfOperation" DataType="byte"/>
+			<Output Address="MAIN.SRD1RotationTargetPosition" Type="TargetPosition" DataType="dint"/>
+			<Output Address="MAIN.SRD1RotationProfileVelocity" Type="ProfileVelocity" DataType="dint"/>
+			<Output Address="MAIN.SRD1RotationProfileAccel" Type="ProfileAccel" DataType="dint"/>
+			<Output Address="MAIN.SRD1RotationProfileDecel" Type="ProfileDecel" DataType="dint"/>
+			<!-- Output Address="MAIN.Loader1Rotation_DigitalOutputs" Type="DigitalOutputs" DataType="dint"/ -->
+			<Output Address="0x607D:01" Type="SoftwareLimitMinus" DataType="dint"/>
+			<Output Address="0x607D:02" Type="SoftwareLimitPlus" DataType="dint"/>
+			<Output Address="0x607C:00" Type="HomeOffset" DataType="dint"/>
+			<Output Address="0x6098:00" Type="HomingMethod" DataType="byte"/>
+			<Output Address="0x6099:01" Type="HomingVelocity" DataType="dint"/>
+			<Output Address="0x6099:02" Type="HomingVelocitySlow" DataType="dint"/>
+			<Output Address="0x609A:00" Type="HomingAccel" DataType="dint"/>
+			<Output Address="0x2403:00" Type="NegativeTorqueLimit" DataType="uint"/>
+			<Output Address="0x2402:00" Type="PositiveTorqueLimit" DataType="uint"/>
+
+			<MotorType>Servo</MotorType>
+			<MotorDriveDirection>0</MotorDriveDirection>
+			<EncoderFeedbackDirectionMValue>0</EncoderFeedbackDirectionMValue>
+			<EncoderFeedbackDirectionNValue>0</EncoderFeedbackDirectionNValue>
+			<ReverseLimitSwitchPolarity>0</ReverseLimitSwitchPolarity>
+			<ForwardLimitSwitchPolarity>0</ForwardLimitSwitchPolarity>
+			<HomeSwitchPolarity>0</HomeSwitchPolarity>
+			<HomingMethod>24</HomingMethod>
+			<HomeConfig>0</HomeConfig>
+			<HomingOffset>0</HomingOffset>
+			<HomingSpeedHomeSwitch>1500000</HomingSpeedHomeSwitch>
+			<HomingSpeedEncoderIndex>0</HomingSpeedEncoderIndex>
+			<HomingAccelDecel>10000000</HomingAccelDecel>
+			<HomingTimeOut>60000</HomingTimeOut>
+			<ProportionalGain>0</ProportionalGain>
+			<IntegralGain>0</IntegralGain>
+			<DerivativeGain>0</DerivativeGain>
+			<IntegralLimit>0</IntegralLimit>
+			<ErrorLimit>6766</ErrorLimit>
+			<VoltageOffset>0</VoltageOffset>
+			<!-- -193 degrees * 169161 = -32648073 -->
+			<ReverseSoftwareLimit>0</ReverseSoftwareLimit>
+			<!-- 13 degrees * 169161 = 2199093 -->
+			<ForwardSoftwareLimit>0</ForwardSoftwareLimit>
+			<Speed>360</Speed>
+			<Acceleration>1000</Acceleration>
+			<Deceleration>1000</Deceleration>
+			<Jerk>0</Jerk>
+			<FeedforwardVelocity>0</FeedforwardVelocity>
+			<FeedforwardAcceleration>0</FeedforwardAcceleration>
+			<OffOnError>0</OffOnError>
+		</Axis>
 	</Controller>
 </BeckhoffCfg>

+ 4 - 3
PunkHPX8_RT/Devices/DeviceManager.cs

@@ -22,6 +22,7 @@ using PunkHPX8_RT.Devices.SRD;
 using PunkHPX8_RT.Devices.Temperature;
 using PunkHPX8_RT.Devices.VpwCell;
 using PunkHPX8_RT.Devices.VpwMain;
+using SecsGem.Core.ItemModel;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -89,12 +90,12 @@ namespace PunkHPX8_RT.Instances
         /// <param name="moduleName"></param>
         private void InitialSRD(ModuleName moduleName)
         {
-            GalilAxisConfig rotationBeckhoffAxis = GalilControllerCfgManager.Instance.GetGalilAxisConfig(moduleName.ToString(), "Rotation");
+            BeckhoffAxis rotationBeckhoffAxis = BeckhoffAxisManager.Instance.GetAxis($"{moduleName.ToString()}.Rotation");
             if (rotationBeckhoffAxis != null)
             {
-                JetAxisBase rotationAxis = AxisManager.Instance.GetAxisInstance(rotationBeckhoffAxis.Type, moduleName.ToString(), "Rotation");
+                JetAxisBase rotationAxis = AxisManager.Instance.GetAxisInstance(rotationBeckhoffAxis.MotorType, moduleName.ToString(), "Rotation");
                 AddCustomModuleDevice(rotationAxis);
-                rotationAxis.InterLock = new SrdRotationAxisInterLock(rotationAxis);
+                rotationAxis.InterLock = new VpwRotationAxisInterLock(rotationAxis);
                 AxisManager.Instance.AddModuleAxis(moduleName.ToString(), rotationAxis);
             }
             SrdCommonDevice srdCommon = new SrdCommonDevice(moduleName.ToString());

+ 3 - 0
PunkHPX8_RT/Devices/SRD/SrdCommonDevice.cs

@@ -193,6 +193,9 @@ namespace PunkHPX8_RT.Devices.SRD
             _flipperRoutine = new SrdCommonFlipperRoutine(Module);
             _chuckATMRoutine = new SrdCommonChuckATMRoutine(Module);    
         }
+
+
+
         /// <summary>
         /// 订阅数据
         /// </summary>

+ 2 - 1
PunkHPX8_Themes/UserControls/SRDUIControl.xaml

@@ -44,7 +44,8 @@
                     </TransformGroup>
                 </local:Blower.RenderTransform>
             </local:Blower>
-            <Image Source="pack://application:,,,/PunkHPX8_Themes;component/Themes/Images/parts/DoubleChamber.png" Canvas.Left="19" Canvas.Top="31" />
+            <Image Source="pack://application:,,,/PunkHPX8_Themes;component/Themes/Images/parts/DoubleChamber.png" Canvas.Left="0" Canvas.Top="0" />
+            <Image Source="pack://application:,,,/PunkHPX8_Themes;component/Themes/Images/parts/SRDDevice.png" Canvas.Left="19" Canvas.Top="31" />
 
             <Ellipse Width="45" Height="45" Fill="#F8F8F8" Stroke="Transparent" StrokeThickness="2" Canvas.Left="105" Canvas.Top="50" HorizontalAlignment="Center" VerticalAlignment="Top"/>
             <!--WaterBelow-->

+ 175 - 5
PunkHPX8_Twincate/PunkHPX8/PlcTest/POUs/MAIN.TcPOU

@@ -505,10 +505,127 @@ VAR
 	PlatingCell1_2_DO_16CHANNEL_EL2809_N401_12 AT%Q* :BOOL;
 	
 	
-	
-	
-END_VAR
-]]></Declaration>
+	//SRD1 Rotation Status word
+	SRD1RotationStatusWord AT%I* :UINT;
+	//SRD1 Rotation digital inputs
+	SRD1RotationDigitalInputs AT%I* :UDINT;
+	//SRD1 Rotation position error
+	SRD1RotationPositionError AT%I* :UDINT;
+	//SRD1 Rotation actual velocity
+	SRD1RotationActualVelocity AT%I* :UDINT;
+	//SRD1 Rotation actual torque
+	SRD1RotationActualTorque AT%I* :DINT;
+	//SRD1 Rotation motor position
+	SRD1RotationMotorPosition AT%I* :DINT;	
+	//SRD1 Rotation control word
+	SRD1RotationControlWord AT%Q* :UINT;	
+	//SRD1 Rotation mode of operation
+	SRD1RotationModeOfOperation AT%Q* :SINT;	
+	//SRD1 Rotation target position
+	SRD1RotationTargetPosition AT%Q* :DINT;	
+	//SRD1 Rotation profile volecity
+	SRD1RotationProfileVelocity AT%Q* :DINT;
+	//SRD1 Rotation profile acceleration
+	SRD1RotationProfileAccel AT%Q* :UDINT;
+	//SRD1 Rotation profile deceleration
+	SRD1RotationProfileDecel AT%Q* :UDINT;	
+	//SRD1 Rotation motor step
+	SRD1RotationMotorStep :DINT;
+	
+	//SRD2 Rotation Status word
+	SRD2RotationStatusWord AT%I* :UINT;
+	//SRD2 Rotation digital inputs
+	SRD2RotationDigitalInputs AT%I* :UDINT;
+	//SRD2 Rotation position error
+	SRD2RotationPositionError AT%I* :UDINT;
+	//SRD2 Rotation actual velocity
+	SRD2RotationActualVelocity AT%I* :UDINT;
+	//SRD2 Rotation actual torque
+	SRD2RotationActualTorque AT%I* :DINT;
+	//SRD2 Rotation motor position
+	SRD2RotationMotorPosition AT%I* :DINT;	
+	//SRD2 Rotation control word
+	SRD2RotationControlWord AT%Q* :UINT;	
+	//SRD2 Rotation mode of operation
+	SRD2RotationModeOfOperation AT%Q* :SINT;	
+	//SRD2 Rotation target position
+	SRD2RotationTargetPosition AT%Q* :DINT;	
+	//SRD2 Rotation profile volecity
+	SRD2RotationProfileVelocity AT%Q* :DINT;
+	//SRD2 Rotation profile acceleration
+	SRD2RotationProfileAccel AT%Q* :UDINT;
+	//SRD2 Rotation profile deceleration
+	SRD2RotationProfileDecel AT%Q* :UDINT;	
+	//SRD2 Rotation motor step
+	SRD2RotationMotorStep :DINT;
+	
+	//SRD.FluidContainment
+	r_SRD_FLUID_LEVEL AT%I* :BOOL;
+	//SRD.WaterPressure
+	r_SRD_SUPPLY_WATER_PRESS AT%I* :DINT;
+	
+	//SRD1.DoorClosed
+	r_SRD1_SHUTTER_CLOSED AT%I* :BOOL;
+	//SRD1.DoorOpened
+	r_SRD1_SHUTTER_OPEN AT%I* :BOOL;
+	//SRD1.ChuckVacuumOK
+	r_SRD1_CHUCK_VAC_OK AT%I* :BOOL;
+	//SRD1.WaferPresent
+	r_SRD1_WAFER_PRESENT AT%I* :BOOL;
+	//SRD1.LiftUpStatus
+	r_SRD1_LIFT_UP AT%I* :BOOL;
+	//SRD1.Flipper1Out100Status
+	r_SRD1_100_FLIPPER1_OUT AT%I* :BOOL;
+	//SRD1.Flipper2Out100Status
+	r_SRD1_100_FLIPPER2_OUT AT%I* :BOOL;
+	//SRD1.Flipper3Out100Status
+	r_SRD1_100_FLIPPER3_OUT AT%I* :BOOL;
+	//SRD1.Flipper1Out150Status
+	r_SRD1_150_FLIPPER1_OUT AT%I* :BOOL;
+	//SRD1.Flipper2Out150Status
+	r_SRD1_150_FLIPPER2_OUT AT%I* :BOOL;
+	//SRD1.Flipper3Out150Status
+	r_SRD1_150_FLIPPER3_OUT AT%I* :BOOL;
+	//SRD1.Flipper1Out200Status
+	r_SRD1_200_FLIPPER1_OUT AT%I* :BOOL;
+	//SRD1.Flipper2Out200Status
+	r_SRD1_200_FLIPPER2_OUT AT%I* :BOOL;
+	//SRD1.Flipper3Out200Status
+	r_SRD1_200_FLIPPER3_OUT AT%I* :BOOL;
+	//SRD1.ChuckVacuum
+	r_SRD1_CHUCK_VACUUM_anlg AT%I* :DINT;
+	//SRD1.WaferPresence
+	r_SRD1_WAFER_PRESENT_anlg AT%I* :DINT;
+	//SRD1.WaterFlow
+	r_SRD1_WATER_FLOW AT%I* :DINT;
+	
+	
+	//SRD1.WaterAbove
+	c_SRD1_Water_Above_Wafer AT%Q* :BOOL;
+	//SRD1.WaterBelow
+	c_SRD1_Water_Below_Wafer AT%Q* :BOOL;
+	//SRD1.ExhaustOn
+	c_SRD1_Exhaust_Fan_On AT%Q* :BOOL;
+	//SRD1.DoorClose
+	c_SRD1_Shutter_Close AT%Q* :BOOL;
+	//SRD1.ChuckVacuum
+	c_SRD1_CHUCK_VACUUM AT%Q* :BOOL;
+	//SRD1.ChuckATMOn
+	c_SRD1_CHUCK_ATM_ON AT%Q* :BOOL;
+	//SRD1.LiftUp
+	c_SRD1_LIFT_UP AT%Q* :BOOL;
+	//SRD1.FlippersIn100
+	c_SRD1_100_FLIPPERS_IN AT%Q* :BOOL;
+	//SRD1.FlippersIn150
+	c_SRD1_150_FLIPPERS_IN AT%Q* :BOOL;
+	//SRD1.FlippersIn200
+	c_SRD1_200_FLIPPERS_IN AT%Q* :BOOL;
+	//SRD1.WaterOn
+	c_SRD1_WATER_ON AT%Q* :BOOL;
+	//SRD1.N2On
+	c_SRD1_N2_FLOW_ON AT%Q* :BOOL;
+	
+END_VAR]]></Declaration>
     <Implementation>
       <ST><![CDATA[IF VPW1RotationControlWord =7 THEN
 	VPW1RotationStatusWord := 563;
@@ -738,7 +855,56 @@ END_IF
 //reservoir 4 ca DIreplen
 IF  RES3_4_PNEU_SMC_EX260_V01_V04.6=TRUE AND RES3_4_AI_8CHANNEL_4_20MA_EL3058_N232_6 <= 32760 THEN
 	RES3_4_AI_8CHANNEL_4_20MA_EL3058_N232_6:= RES3_4_AI_8CHANNEL_4_20MA_EL3058_N232_6 + 10;
-END_IF]]></ST>
+END_IF
+
+
+
+IF SRD1RotationControlWord =7 THEN
+	SRD1RotationStatusWord := 563;
+	ELSE IF SRD1RotationControlWord =6 THEN
+		SRD1RotationStatusWord :=33;
+	ELSE IF SRD1RotationControlWord=15 THEN
+		SRD1RotationStatusWord :=567;
+		SRD1RotationDigitalInputs.22:=FALSE;
+		ELSE IF SRD1RotationControlWord=31 THEN
+			SRD1RotationDigitalInputs.22:=TRUE;
+			SRD1RotationStatusWord :=5687;
+			SRD1RotationMotorPosition:=0;
+		END_IF
+	END_IF
+	END_IF
+	
+END_IF
+
+IF SRD1RotationModeOfOperation=1 THEN
+	IF SRD1RotationControlWord=63 THEN
+		IF SRD1RotationMotorPosition<SRD1RotationTargetPosition THEN
+			SRD1RotationMotorStep :=(SRD1RotationTargetPosition-SRD1RotationMotorPosition)/20;
+			IF SRD1RotationMotorStep >1 THEN
+				SRD1RotationMotorPosition :=SRD1RotationMotorPosition+SRD1RotationMotorStep;
+			ELSE
+				SRD1RotationMotorPosition :=SRD1RotationMotorPosition+1;
+			END_IF
+		ELSE IF SRD1RotationMotorPosition>SRD1RotationTargetPosition THEN	
+			SRD1RotationMotorStep :=(SRD1RotationMotorPosition-SRD1RotationTargetPosition)/20;
+			IF SRD1RotationMotorStep >1 THEN
+				SRD1RotationMotorPosition :=SRD1RotationMotorPosition-SRD1RotationMotorStep;
+			ELSE
+				SRD1RotationMotorPosition :=SRD1RotationMotorPosition-1;
+			END_IF		
+		ELSE
+			SRD1RotationStatusWord :=1591;				
+		END_IF			
+		END_IF		
+	ELSE IF SRD1RotationControlWord=319 THEN
+		SRD1RotationStatusWord :=1591;
+	END_IF
+	END_IF
+END_IF
+
+
+
+]]></ST>
     </Implementation>
     <LineIds Name="MAIN">
       <LineId Id="52" Count="5" />
@@ -815,6 +981,10 @@ END_IF]]></ST>
       <LineId Id="2275" Count="6" />
       <LineId Id="2284" Count="2" />
       <LineId Id="2274" Count="0" />
+      <LineId Id="2850" Count="2" />
+      <LineId Id="2856" Count="41" />
+      <LineId Id="2853" Count="2" />
+      <LineId Id="2849" Count="0" />
     </LineIds>
   </POU>
 </TcPlcObject>