Преглед изворни кода

add platingcell rotation axis reletaed

chenzk пре 1 месец
родитељ
комит
3f42924935

+ 1 - 1
PunkHPX8_MainPages/ViewModels/PlatingCellHomePageViewModel.cs

@@ -499,7 +499,7 @@ namespace PunkHPX8_MainPages.ViewModels
                     PlatingCellCommonData = CommonFunction.GetValue<PlatingCellData>(_rtDataValueDic, $"{Module}.{PLATINGCELLDATA}");
                     ReservoirCommonData = CommonFunction.GetValue<ReservoirData>(_rtDataValueDic, $"{Module}.ReservoirCommonData");
                     Chemistry = CommonFunction.GetValue<string>(_rtDataValueDic, $"{Module}.Chemistry");
-                    VerticalMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"${VerticalName}.MotionData");
+                    VerticalMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{VerticalName}.MotionData");
                     ReservoirName = CommonFunction.GetValue<string>(_rtDataValueDic, $"{Module}.ReservoirName");
                     if ("Manual".Equals(PlatingCellPersistent.OperatingMode))
                     {

+ 117 - 1
PunkHPX8_MainPages/ViewModels/PlatingCellMotionViewModel.cs

@@ -66,6 +66,54 @@ namespace PunkHPX8_MainPages.ViewModels
         private CommandMotionData _platingCell3_4VerticalMotionData;
         #endregion
 
+        #region PlatingCell1Rotation
+        /// <summary>
+        /// PlatingCell1Rotation moduleName
+        /// </summary>
+        private string _platingCell1RotationName;
+
+        /// <summary>
+        /// PlatingCell1Rotation 数据
+        /// </summary>
+        private CommandMotionData _platingCell1RotationMotionData;
+        #endregion
+
+        #region PlatingCell2Rotation
+        /// <summary>
+        /// PlatingCell2Rotation moduleName
+        /// </summary>
+        private string _platingCell2RotationName;
+
+        /// <summary>
+        /// PlatingCell2Rotation 数据
+        /// </summary>
+        private CommandMotionData _platingCell2RotationMotionData;
+        #endregion
+
+        #region PlatingCell3Rotation
+        /// <summary>
+        /// PlatingCell3Rotation moduleName
+        /// </summary>
+        private string _platingCell3RotationName;
+
+        /// <summary>
+        /// PlatingCell1Rotation 数据
+        /// </summary>
+        private CommandMotionData _platingCell3RotationMotionData;
+
+        #region PlatingCell4Rotation
+        /// <summary>
+        /// PlatingCell1Rotation moduleName
+        /// </summary>
+        private string _platingCell4RotationName;
+
+        /// <summary>
+        /// PlatingCell1Rotation 数据
+        /// </summary>
+        private CommandMotionData _platingCell4RotationMotionData;
+        #endregion
+        #endregion
+
 
         #endregion
 
@@ -113,6 +161,50 @@ namespace PunkHPX8_MainPages.ViewModels
         public CommandMotionData PlatingCell3_4VerticalMotionData { get { return _platingCell3_4VerticalMotionData; } set { SetProperty(ref _platingCell3_4VerticalMotionData, value); } }
         #endregion
 
+        #region PlatingCell1Rotaiton
+        /// <summary>
+        /// ModuleName
+        /// </summary>
+        public string PlatingCell1RotationName { get { return _platingCell1RotationName; } set { SetProperty(ref _platingCell1RotationName, value); } }
+        /// <summary>
+        /// 数据
+        /// </summary>
+        public CommandMotionData PlatingCell1RotationMotionData { get { return _platingCell1RotationMotionData; } set { SetProperty(ref _platingCell1RotationMotionData, value); } }
+        #endregion
+
+        #region PlatingCell2Rotaiton
+        /// <summary>
+        /// ModuleName
+        /// </summary>
+        public string PlatingCell2RotationName { get { return _platingCell2RotationName; } set { SetProperty(ref _platingCell2RotationName, value); } }
+        /// <summary>
+        /// 数据
+        /// </summary>
+        public CommandMotionData PlatingCell2RotationMotionData { get { return _platingCell2RotationMotionData; } set { SetProperty(ref _platingCell2RotationMotionData, value); } }
+        #endregion
+
+        #region PlatingCell3Rotaiton
+        /// <summary>
+        /// ModuleName
+        /// </summary>
+        public string PlatingCell3RotationName { get { return _platingCell3RotationName; } set { SetProperty(ref _platingCell3RotationName, value); } }
+        /// <summary>
+        /// 数据
+        /// </summary>
+        public CommandMotionData PlatingCell3RotationMotionData { get { return _platingCell3RotationMotionData; } set { SetProperty(ref _platingCell3RotationMotionData, value); } }
+        #endregion
+
+        #region PlatingCell4Rotaiton
+        /// <summary>
+        /// ModuleName
+        /// </summary>
+        public string PlatingCell4RotationName { get { return _platingCell4RotationName; } set { SetProperty(ref _platingCell4RotationName, value); } }
+        /// <summary>
+        /// 数据
+        /// </summary>
+        public CommandMotionData PlatingCell4RotationMotionData { get { return _platingCell4RotationMotionData; } set { SetProperty(ref _platingCell4RotationMotionData, value); } }
+        #endregion
+
 
 
         #endregion
@@ -130,7 +222,11 @@ namespace PunkHPX8_MainPages.ViewModels
         {
             Module = systemName;
             PlatingCell1_2VerticalName = $"PlatingCell1_2.Vertical"; 
-            PlatingCell3_4VerticalName = $"PlatingCell3_4.Vertical"; 
+            PlatingCell3_4VerticalName = $"PlatingCell3_4.Vertical";
+            PlatingCell1RotationName = "PlatingCell1.Rotation";
+            PlatingCell2RotationName = "PlatingCell2.Rotation";
+            PlatingCell3RotationName = "PlatingCell3.Rotation";
+            PlatingCell4RotationName = "PlatingCell4.Rotation";
 
             _rtDataKeys.Clear();
             _rtDataKeys.Add($"{PlatingCell1_2VerticalName}.IsHomed");
@@ -141,6 +237,21 @@ namespace PunkHPX8_MainPages.ViewModels
             _rtDataKeys.Add($"{PlatingCell3_4VerticalName}.IsSwitchOn");
             _rtDataKeys.Add($"{PlatingCell3_4VerticalName}.{MOTION_DATA}");
 
+            _rtDataKeys.Add($"{PlatingCell1RotationName}.IsHomed");
+            _rtDataKeys.Add($"{PlatingCell1RotationName}.IsSwitchOn");
+            _rtDataKeys.Add($"{PlatingCell1RotationName}.{MOTION_DATA}");
+
+            _rtDataKeys.Add($"{PlatingCell2RotationName}.IsHomed");
+            _rtDataKeys.Add($"{PlatingCell2RotationName}.IsSwitchOn");
+            _rtDataKeys.Add($"{PlatingCell2RotationName}.{MOTION_DATA}");
+
+            _rtDataKeys.Add($"{PlatingCell3RotationName}.IsHomed");
+            _rtDataKeys.Add($"{PlatingCell3RotationName}.IsSwitchOn");
+            _rtDataKeys.Add($"{PlatingCell3RotationName}.{MOTION_DATA}");
+
+            _rtDataKeys.Add($"{PlatingCell4RotationName}.IsHomed");
+            _rtDataKeys.Add($"{PlatingCell4RotationName}.IsSwitchOn");
+            _rtDataKeys.Add($"{PlatingCell4RotationName}.{MOTION_DATA}");
 
             if (_timer == null)
             {
@@ -164,6 +275,11 @@ namespace PunkHPX8_MainPages.ViewModels
                 {
                     PlatingCell1_2VerticalMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell1_2VerticalName}.{MOTION_DATA}");
                     PlatingCell3_4VerticalMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell3_4VerticalName}.{MOTION_DATA}");
+                    
+                    PlatingCell1RotationMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell1RotationName}.{MOTION_DATA}");
+                    PlatingCell2RotationMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell2RotationName}.{MOTION_DATA}");
+                    PlatingCell3RotationMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell3RotationName}.{MOTION_DATA}");
+                    PlatingCell4RotationMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell4RotationName}.{MOTION_DATA}");
                    
                 }
             }

+ 208 - 5
PunkHPX8_MainPages/ViewModels/PlatingCellSetupViewModel.cs

@@ -54,6 +54,68 @@ namespace PunkHPX8_MainPages.ViewModels
 
         #endregion
 
+        #region PlatingCell1Rotation
+        /// <summary>
+        /// 模块名称
+        /// </summary>
+        private string _platingCell1RotationName;
+        /// <summary>
+        /// 运动数据
+        /// </summary>
+        private CommandMotionData _platingCell1RotationMotionData;
+        /// <summary>
+        /// 当前位置
+        /// </summary>
+        private string _platingCell1RotationCurrentStation;
+        #endregion
+
+  
+
+        #region PlatingCell2Rotation
+        /// <summary>
+        /// 模块名称
+        /// </summary>
+        private string _platingCell2RotationName;
+        /// <summary>
+        /// 运动数据
+        /// </summary>
+        private CommandMotionData _platingCell2RotationMotionData;
+        /// <summary>
+        /// 当前位置
+        /// </summary>
+        private string _platingCell2RotationCurrentStation;
+        #endregion
+
+        #region PlatingCell3Rotation
+        /// <summary>
+        /// 模块名称
+        /// </summary>
+        private string _platingCell3RotationName;
+        /// <summary>
+        /// 运动数据
+        /// </summary>
+        private CommandMotionData _platingCell3RotationMotionData;
+        /// <summary>
+        /// 当前位置
+        /// </summary>
+        private string _platingCell3RotationCurrentStation;
+        #endregion
+
+        #region PlatingCell4Rotation
+        /// <summary>
+        /// 模块名称
+        /// </summary>
+        private string _platingCell4RotationName;
+        /// <summary>
+        /// 运动数据
+        /// </summary>
+        private CommandMotionData _platingCell4RotationMotionData;
+        /// <summary>
+        /// 当前位置
+        /// </summary>
+        private string _platingCell4RotationCurrentStation;
+        #endregion
+
 
 
 
@@ -90,7 +152,7 @@ namespace PunkHPX8_MainPages.ViewModels
             set { SetProperty(ref _platingCell1_2VerticalName, value); }
         }
         /// <summary>
-        /// SRD1Arm运动数据
+        /// 运动数据
         /// </summary>
         public CommandMotionData PlatingCell1_2VerticalMotionData
         {
@@ -98,7 +160,7 @@ namespace PunkHPX8_MainPages.ViewModels
             set { SetProperty(ref _platingCell1_2VerticalMotionData, value); }
         }
         /// <summary>
-        /// SRD1Arm当前位置
+        ///当前位置
         /// </summary>
         public string PlatingCell1_2VerticalCurrentStation
         {
@@ -117,7 +179,7 @@ namespace PunkHPX8_MainPages.ViewModels
             set { SetProperty(ref _platingCell3_4VerticalName, value); }
         }
         /// <summary>
-        /// SRD1Arm运动数据
+        /// 运动数据
         /// </summary>
         public CommandMotionData PlatingCell3_4VerticalMotionData
         {
@@ -125,7 +187,7 @@ namespace PunkHPX8_MainPages.ViewModels
             set { SetProperty(ref _platingCell3_4VerticalMotionData, value); }
         }
         /// <summary>
-        /// SRD1Arm当前位置
+        /// 当前位置
         /// </summary>
         public string PlatingCell3_4VerticalCurrentStation
         {
@@ -134,6 +196,114 @@ namespace PunkHPX8_MainPages.ViewModels
         }
         #endregion
 
+        #region PlatingCell1Rotation
+        /// <summary>
+        ///名称
+        /// </summary>
+        public string PlatingCell1RotationName
+        {
+            get { return _platingCell1RotationName; }
+            set { SetProperty(ref _platingCell1RotationName, value); }
+        }
+        /// <summary>
+        /// 运动数据
+        /// </summary>
+        public CommandMotionData PlatingCell1RotationMotionData
+        {
+            get { return _platingCell1RotationMotionData; }
+            set { SetProperty(ref _platingCell1RotationMotionData, value); }
+        }
+        /// <summary>
+        /// 当前位置
+        /// </summary>
+        public string PlatingCell1RotationCurrentStation
+        {
+            get { return _platingCell1RotationCurrentStation; }
+            set { SetProperty(ref _platingCell1RotationCurrentStation, value); }
+        }
+        #endregion
+
+        #region PlatingCell2Rotation
+        /// <summary>
+        ///名称
+        /// </summary>
+        public string PlatingCell2RotationName
+        {
+            get { return _platingCell2RotationName; }
+            set { SetProperty(ref _platingCell2RotationName, value); }
+        }
+        /// <summary>
+        /// 运动数据
+        /// </summary>
+        public CommandMotionData PlatingCell2RotationMotionData
+        {
+            get { return _platingCell2RotationMotionData; }
+            set { SetProperty(ref _platingCell2RotationMotionData, value); }
+        }
+        /// <summary>
+        /// 当前位置
+        /// </summary>
+        public string PlatingCell2RotationCurrentStation
+        {
+            get { return _platingCell2RotationCurrentStation; }
+            set { SetProperty(ref _platingCell2RotationCurrentStation, value); }
+        }
+        #endregion
+
+        #region PlatingCell3Rotation
+        /// <summary>
+        ///名称
+        /// </summary>
+        public string PlatingCell3RotationName
+        {
+            get { return _platingCell3RotationName; }
+            set { SetProperty(ref _platingCell3RotationName, value); }
+        }
+        /// <summary>
+        /// 运动数据
+        /// </summary>
+        public CommandMotionData PlatingCell3RotationMotionData
+        {
+            get { return _platingCell3RotationMotionData; }
+            set { SetProperty(ref _platingCell3RotationMotionData, value); }
+        }
+        /// <summary>
+        /// 当前位置
+        /// </summary>
+        public string PlatingCell3RotationCurrentStation
+        {
+            get { return _platingCell3RotationCurrentStation; }
+            set { SetProperty(ref _platingCell3RotationCurrentStation, value); }
+        }
+        #endregion
+
+        #region PlatingCell4Rotation
+        /// <summary>
+        ///名称
+        /// </summary>
+        public string PlatingCell4RotationName
+        {
+            get { return _platingCell4RotationName; }
+            set { SetProperty(ref _platingCell4RotationName, value); }
+        }
+        /// <summary>
+        /// 运动数据
+        /// </summary>
+        public CommandMotionData PlatingCell4RotationMotionData
+        {
+            get { return _platingCell4RotationMotionData; }
+            set { SetProperty(ref _platingCell4RotationMotionData, value); }
+        }
+        /// <summary>
+        /// 当前位置
+        /// </summary>
+        public string PlatingCell4RotationCurrentStation
+        {
+            get { return _platingCell4RotationCurrentStation; }
+            set { SetProperty(ref _platingCell4RotationCurrentStation, value); }
+        }
+        #endregion
+
 
 
         #endregion
@@ -152,12 +322,17 @@ namespace PunkHPX8_MainPages.ViewModels
         {
             PlatingCell1_2VerticalName = $"PlatingCell1_2.Vertical";
             PlatingCell3_4VerticalName = $"PlatingCell3_4.Vertical";
+            
+            PlatingCell1RotationName = $"PlatingCell1.Rotation";
+            PlatingCell2RotationName = $"PlatingCell2.Rotation";
+            PlatingCell3RotationName = $"PlatingCell3.Rotation";
+            PlatingCell4RotationName = $"PlatingCell4.Rotation";
             AddDataKeys();
             if (_timer == null)
             {
                 _timer = new DispatcherTimer();
                 _timer.Interval = TimeSpan.FromMilliseconds(200);
-                _timer.Tick += Timer_Tick; ;
+                _timer.Tick += Timer_Tick;
             }
             _timer.Start();
 
@@ -195,6 +370,22 @@ namespace PunkHPX8_MainPages.ViewModels
             _rtDataKeys.Add($"{PlatingCell3_4VerticalName}.{IS_SWITCH_ON}");
             _rtDataKeys.Add($"{PlatingCell3_4VerticalName}.{CURRENT_STATION}");
 
+            _rtDataKeys.Add($"{PlatingCell1RotationName}.{MOTION_DATA}");
+            _rtDataKeys.Add($"{PlatingCell1RotationName}.{IS_SWITCH_ON}");
+            _rtDataKeys.Add($"{PlatingCell1RotationName}.{CURRENT_STATION}");
+
+            _rtDataKeys.Add($"{PlatingCell2RotationName}.{MOTION_DATA}");
+            _rtDataKeys.Add($"{PlatingCell2RotationName}.{IS_SWITCH_ON}");
+            _rtDataKeys.Add($"{PlatingCell2RotationName}.{CURRENT_STATION}");
+
+            _rtDataKeys.Add($"{PlatingCell3RotationName}.{MOTION_DATA}");
+            _rtDataKeys.Add($"{PlatingCell3RotationName}.{IS_SWITCH_ON}");
+            _rtDataKeys.Add($"{PlatingCell3RotationName}.{CURRENT_STATION}");
+
+            _rtDataKeys.Add($"{PlatingCell4RotationName}.{MOTION_DATA}");
+            _rtDataKeys.Add($"{PlatingCell4RotationName}.{IS_SWITCH_ON}");
+            _rtDataKeys.Add($"{PlatingCell4RotationName}.{CURRENT_STATION}");
+
 
         }
         /// <summary>
@@ -214,6 +405,18 @@ namespace PunkHPX8_MainPages.ViewModels
                     PlatingCell3_4VerticalMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell3_4VerticalName}.{MOTION_DATA}");
                     PlatingCell3_4VerticalCurrentStation = CommonFunction.GetCurrentStationLastContent(CommonFunction.GetValue<string>(_rtDataValueDic, $"{PlatingCell3_4VerticalName}.{CURRENT_STATION}"), PlatingCell3_4VerticalName);
 
+                    PlatingCell1RotationMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell1RotationName}.{MOTION_DATA}");
+                    PlatingCell1RotationCurrentStation = CommonFunction.GetCurrentStationLastContent(CommonFunction.GetValue<string>(_rtDataValueDic, $"{PlatingCell1RotationName}.{CURRENT_STATION}"), PlatingCell1RotationName);
+
+                    PlatingCell2RotationMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell2RotationName}.{MOTION_DATA}");
+                    PlatingCell2RotationCurrentStation = CommonFunction.GetCurrentStationLastContent(CommonFunction.GetValue<string>(_rtDataValueDic, $"{PlatingCell2RotationName}.{CURRENT_STATION}"), PlatingCell2RotationName);
+
+                    PlatingCell3RotationMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell3RotationName}.{MOTION_DATA}");
+                    PlatingCell3RotationCurrentStation = CommonFunction.GetCurrentStationLastContent(CommonFunction.GetValue<string>(_rtDataValueDic, $"{PlatingCell3RotationName}.{CURRENT_STATION}"), PlatingCell3RotationName);
+
+                    PlatingCell3RotationMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{PlatingCell4RotationName}.{MOTION_DATA}");
+                    PlatingCell3RotationCurrentStation = CommonFunction.GetCurrentStationLastContent(CommonFunction.GetValue<string>(_rtDataValueDic, $"{PlatingCell4RotationName}.{CURRENT_STATION}"), PlatingCell4RotationName);
+
                 }
             }
             return true;

+ 9 - 2
PunkHPX8_MainPages/Views/PlatingCellMotionView.xaml

@@ -19,13 +19,20 @@
                     <ColumnDefinition Width="450"></ColumnDefinition>
                     <ColumnDefinition Width="450"></ColumnDefinition>
                     <ColumnDefinition Width="450"></ColumnDefinition>
-                    <ColumnDefinition Width="450"></ColumnDefinition>
                     <ColumnDefinition/>
                 </Grid.ColumnDefinitions>
                 <UserControls:MotionControl Grid.Column="0" ModuleTitle="PlatingCell1/2 Vertical" ModuleName="{Binding PlatingCell1_2VerticalName}" ModuleUnit="mm" 
                                MotionData="{Binding PlatingCell1_2VerticalMotionData}" IncrementValue="{Binding IncrementValue}"/>
                 <UserControls:MotionControl Grid.Column="1" ModuleTitle="PlatingCell3/4 Vertical" ModuleName="{Binding PlatingCell3_4VerticalName}" ModuleUnit="mm" 
-                   MotionData="{Binding PlatingCell3_4VerticalMotionData}" IncrementValue="{Binding IncrementValue}"/>
+                               MotionData="{Binding PlatingCell3_4VerticalMotionData}" IncrementValue="{Binding IncrementValue}"/>
+                <UserControls:MotionControl Grid.Column="2" ModuleTitle="PlatingCell1 Rotation" ModuleName="{Binding PlatingCell1RotationName}" ModuleUnit="deg" 
+                               MotionData="{Binding PlatingCell1RotationMotionData}" IncrementValue="{Binding IncrementValue}"/>
+                <UserControls:MotionControl Grid.Column="3" ModuleTitle="PlatingCell2 Rotation" ModuleName="{Binding PlatingCell2RotationName}" ModuleUnit="deg" 
+                               MotionData="{Binding PlatingCell2RotationMotionData}" IncrementValue="{Binding IncrementValue}"/>
+                <UserControls:MotionControl Grid.Column="4" ModuleTitle="PlatingCell3 Rotation" ModuleName="{Binding PlatingCell3RotationName}" ModuleUnit="deg" 
+                               MotionData="{Binding PlatingCell3RotationMotionData}" IncrementValue="{Binding IncrementValue}"/>
+                <UserControls:MotionControl Grid.Column="5" ModuleTitle="PlatingCell4 Rotation" ModuleName="{Binding PlatingCell4RotationName}" ModuleUnit="deg" 
+                               MotionData="{Binding PlatingCell4RotationMotionData}" IncrementValue="{Binding IncrementValue}"/>
             </Grid>
         </ScrollViewer>
     </Grid>

+ 56 - 0
PunkHPX8_MainPages/Views/PlatingCellSetupView.xaml

@@ -50,5 +50,61 @@
                                 Unit="mm"
                                      />
         </Grid>
+        <Grid Grid.Row="1" Grid.Column="0">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="380"></ColumnDefinition>
+                <ColumnDefinition/>
+            </Grid.ColumnDefinitions>
+            <UserControls:SrdStationPositionControl HorizontalAlignment="Center" Margin="10,0,0,0" VerticalAlignment="Center" Grid.ColumnSpan="2" Width="430" Height="175"
+                        ModuleTitle="{Binding PlatingCell1RotationName}" 
+                        ModuleName="{Binding PlatingCell1RotationName}" 
+                        CurrentPosition="{Binding PlatingCell1RotationMotionData.MotorPosition}" 
+                        Torque="{Binding PlatingCell1RotationMotionData.Torque}" 
+                        CurrentStation="{Binding PlatingCell1RotationCurrentStation}"
+                        Unit="deg"
+                             />
+        </Grid>
+        <Grid Grid.Row="1" Grid.Column="2">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="380"></ColumnDefinition>
+                <ColumnDefinition/>
+            </Grid.ColumnDefinitions>
+            <UserControls:SrdStationPositionControl HorizontalAlignment="Center" Margin="10,0,0,0" VerticalAlignment="Center" Grid.ColumnSpan="2" Width="430" Height="175"
+                            ModuleTitle="{Binding PlatingCell2RotationName}" 
+                            ModuleName="{Binding PlatingCell2RotationName}" 
+                            CurrentPosition="{Binding PlatingCell2RotationMotionData.MotorPosition}" 
+                            Torque="{Binding PlatingCell2RotationMotionData.Torque}" 
+                            CurrentStation="{Binding PlatingCell2RotationCurrentStation}"
+                            Unit="deg"
+                      />
+        </Grid>
+        <Grid Grid.Row="2" Grid.Column="0">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="380"></ColumnDefinition>
+                <ColumnDefinition/>
+            </Grid.ColumnDefinitions>
+            <UserControls:SrdStationPositionControl HorizontalAlignment="Center" Margin="10,0,0,0" VerticalAlignment="Center" Grid.ColumnSpan="2" Width="430" Height="175"
+                        ModuleTitle="{Binding PlatingCell3RotationName}" 
+                        ModuleName="{Binding PlatingCell3RotationName}" 
+                        CurrentPosition="{Binding PlatingCell3RotationMotionData.MotorPosition}" 
+                        Torque="{Binding PlatingCell3RotationMotionData.Torque}" 
+                        CurrentStation="{Binding PlatingCell3RotationCurrentStation}"
+                        Unit="deg"
+              />
+        </Grid>
+        <Grid Grid.Row="2" Grid.Column="2">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="380"></ColumnDefinition>
+                <ColumnDefinition/>
+            </Grid.ColumnDefinitions>
+            <UserControls:SrdStationPositionControl HorizontalAlignment="Center" Margin="10,0,0,0" VerticalAlignment="Center" Grid.ColumnSpan="2" Width="430" Height="175"
+                    ModuleTitle="{Binding PlatingCell4RotationName}" 
+                    ModuleName="{Binding PlatingCell4RotationName}" 
+                    CurrentPosition="{Binding PlatingCell4RotationMotionData.MotorPosition}" 
+                    Torque="{Binding PlatingCell4RotationMotionData.Torque}" 
+                    CurrentStation="{Binding PlatingCell4RotationCurrentStation}"
+                    Unit="deg"
+      />
+        </Grid>
     </Grid>
 </UserControl>

+ 56 - 0
PunkHPX8_RT/Config/Devices/AxisProviderCfg.xml

@@ -78,4 +78,60 @@
     <Outputs>
     </Outputs>
   </Axis>
+  <Axis Name="PlatingCell1.Rotation">
+    <Driver>Beckhoff</Driver>
+    <!-- <Driver>Sim</Driver> -->
+    <Units>deg</Units>
+	<!-- 5294 X 4 counts/rev * 1/360 rev/deg = 58.822222 counts/deg -->
+    <ScaleFactor>1</ScaleFactor>
+    <JogLimit>100000000</JogLimit>
+    <!--Units>rev</Units-->
+	<!-- 5294 X 4 counts/rev = 21176 counts/rev -->
+    <!--ScaleFactor>21176</ScaleFactor-->
+	<MinMoveTime>0.5</MinMoveTime>
+	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
+  </Axis> 
+  <Axis Name="PlatingCell2.Rotation">
+    <Driver>Beckhoff</Driver>
+    <!-- <Driver>Sim</Driver> -->
+    <Units>deg</Units>
+	<!-- 5294 X 4 counts/rev * 1/360 rev/deg = 58.822222 counts/deg -->
+    <ScaleFactor>1</ScaleFactor>
+    <JogLimit>100000000</JogLimit>
+    <!--Units>rev</Units-->
+	<!-- 5294 X 4 counts/rev = 21176 counts/rev -->
+    <!--ScaleFactor>21176</ScaleFactor-->
+	<MinMoveTime>0.5</MinMoveTime>
+	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
+  </Axis> 
+  <Axis Name="PlatingCell3.Rotation">
+    <Driver>Beckhoff</Driver>
+    <!-- <Driver>Sim</Driver> -->
+    <Units>deg</Units>
+	<!-- 5294 X 4 counts/rev * 1/360 rev/deg = 58.822222 counts/deg -->
+    <ScaleFactor>1</ScaleFactor>
+    <JogLimit>100000000</JogLimit>
+    <!--Units>rev</Units-->
+	<!-- 5294 X 4 counts/rev = 21176 counts/rev -->
+    <!--ScaleFactor>21176</ScaleFactor-->
+	<MinMoveTime>0.5</MinMoveTime>
+	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
+  </Axis> 
+  <Axis Name="PlatingCell4.Rotation">
+    <Driver>Beckhoff</Driver>
+    <!-- <Driver>Sim</Driver> -->
+    <Units>deg</Units>
+	<!-- 5294 X 4 counts/rev * 1/360 rev/deg = 58.822222 counts/deg -->
+    <ScaleFactor>1</ScaleFactor>
+    <JogLimit>100000000</JogLimit>
+    <!--Units>rev</Units-->
+	<!-- 5294 X 4 counts/rev = 21176 counts/rev -->
+    <!--ScaleFactor>21176</ScaleFactor-->
+	<MinMoveTime>0.5</MinMoveTime>
+	<MotorPositionRate>1</MotorPositionRate>
+	<VelocityRate>1</VelocityRate>
+  </Axis> 
 </Axes>

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

@@ -856,5 +856,293 @@
 			<NegativeTorqueLimit>130</NegativeTorqueLimit>
 			<PositiveTorqueLimit>20</PositiveTorqueLimit>
 		</Axis>
+		<Axis Name="PlatingCell1.Rotation" MotorType="Kollmorgen" COEAddress="192.168.0.14.4.1" COEPort="1016" DebugLogging="false">
+			<Input Address="MAIN.PlatingCell1_RotationStatusWord" Type="StatusWord" DataType="uint"/>
+			<Input Address="MAIN.PlatingCell1_RotationDigitalInputs" Type="DigitalInputs" DataType="udint"/>
+			<Input Address="MAIN.PlatingCell1_RotationMotorPosition" Type="MotorPosition" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell1_RotationPositionError" Type="PositionError" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell1_RotationActualVelocity" Type="ActualVelocity" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell1_RotationActualTorque" 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.PlatingCell1_RotationControlWord" Type="ControlWord" DataType="uint"/>
+			<Output Address="MAIN.PlatingCell1_RotationModeOfOperation" Type="ModeOfOperation" DataType="byte"/>
+			<Output Address="MAIN.PlatingCell1_RotationTargetPosition" Type="TargetPosition" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell1_RotationProfileVelocity" Type="ProfileVelocity" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell1_RotationProfileAccel" Type="ProfileAccel" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell1_RotationProfileDecel" 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>
+		<Axis Name="PlatingCell2.Rotation" MotorType="Kollmorgen" COEAddress="192.168.0.14.4.1" COEPort="1016" DebugLogging="false">
+			<Input Address="MAIN.PlatingCell2_RotationStatusWord" Type="StatusWord" DataType="uint"/>
+			<Input Address="MAIN.PlatingCell2_RotationDigitalInputs" Type="DigitalInputs" DataType="udint"/>
+			<Input Address="MAIN.PlatingCell2_RotationMotorPosition" Type="MotorPosition" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell2_RotationPositionError" Type="PositionError" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell2_RotationActualVelocity" Type="ActualVelocity" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell2_RotationActualTorque" 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.PlatingCell2_RotationControlWord" Type="ControlWord" DataType="uint"/>
+			<Output Address="MAIN.PlatingCell2_RotationModeOfOperation" Type="ModeOfOperation" DataType="byte"/>
+			<Output Address="MAIN.PlatingCell2_RotationTargetPosition" Type="TargetPosition" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell2_RotationProfileVelocity" Type="ProfileVelocity" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell2_RotationProfileAccel" Type="ProfileAccel" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell2_RotationProfileDecel" 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>
+		<Axis Name="PlatingCell3.Rotation" MotorType="Yaskawa" COEAddress="192.168.0.14.4.1" COEPort="1016" DebugLogging="false">
+			<Input Address="MAIN.PlatingCell3_RotationStatusWord" Type="StatusWord" DataType="uint"/>
+			<Input Address="MAIN.PlatingCell3_RotationDigitalInputs" Type="DigitalInputs" DataType="udint"/>
+			<Input Address="MAIN.PlatingCell3_RotationMotorPosition" Type="MotorPosition" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell3_RotationPositionError" Type="PositionError" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell3_RotationActualVelocity" Type="ActualVelocity" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell3_RotationActualTorque" 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.PlatingCell3_RotationControlWord" Type="ControlWord" DataType="uint"/>
+			<Output Address="MAIN.PlatingCell3_RotationModeOfOperation" Type="ModeOfOperation" DataType="byte"/>
+			<Output Address="MAIN.PlatingCell3_RotationTargetPosition" Type="TargetPosition" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell3_RotationProfileVelocity" Type="ProfileVelocity" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell3_RotationProfileAccel" Type="ProfileAccel" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell3_RotationProfileDecel" 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>-46180953</ReverseSoftwareLimit>
+			<!-- 13 degrees * 169161 = 2199093 -->
+			<ForwardSoftwareLimit>2706576</ForwardSoftwareLimit>
+			<Speed>15000000</Speed>
+			<Acceleration>10000000</Acceleration>
+			<Deceleration>10000000</Deceleration>
+			<Jerk>0</Jerk>
+			<FeedforwardVelocity>0</FeedforwardVelocity>
+			<FeedforwardAcceleration>0</FeedforwardAcceleration>
+			<OffOnError>0</OffOnError>
+		</Axis>
+		<Axis Name="PlatingCell4.Rotation" MotorType="Yaskawa" COEAddress="192.168.0.14.4.1" COEPort="1016" DebugLogging="false">
+			<Input Address="MAIN.PlatingCell4_RotationStatusWord" Type="StatusWord" DataType="uint"/>
+			<Input Address="MAIN.PlatingCell4_RotationDigitalInputs" Type="DigitalInputs" DataType="udint"/>
+			<Input Address="MAIN.PlatingCell4_RotationMotorPosition" Type="MotorPosition" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell4_RotationPositionError" Type="PositionError" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell4_RotationActualVelocity" Type="ActualVelocity" DataType="dint"/>
+			<Input Address="MAIN.PlatingCell4_RotationActualTorque" 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.PlatingCell4_RotationControlWord" Type="ControlWord" DataType="uint"/>
+			<Output Address="MAIN.PlatingCell4_RotationModeOfOperation" Type="ModeOfOperation" DataType="byte"/>
+			<Output Address="MAIN.PlatingCell4_RotationTargetPosition" Type="TargetPosition" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell4_RotationProfileVelocity" Type="ProfileVelocity" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell4_RotationProfileAccel" Type="ProfileAccel" DataType="dint"/>
+			<Output Address="MAIN.PlatingCell4_RotationProfileDecel" 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>-46180953</ReverseSoftwareLimit>
+			<!-- 13 degrees * 169161 = 2199093 -->
+			<ForwardSoftwareLimit>2706576</ForwardSoftwareLimit>
+			<Speed>15000000</Speed>
+			<Acceleration>10000000</Acceleration>
+			<Deceleration>10000000</Deceleration>
+			<Jerk>0</Jerk>
+			<FeedforwardVelocity>0</FeedforwardVelocity>
+			<FeedforwardAcceleration>0</FeedforwardAcceleration>
+			<OffOnError>0</OffOnError>
+		</Axis>
 	</Controller>
 </BeckhoffCfg>

+ 2 - 2
PunkHPX8_RT/Config/Devices/PowerSupplierCfg-Simulator.xml

@@ -6,8 +6,8 @@
   <PowerSupplierDeviceConfig Name="Power2" IpAddress="127.0.0.1" Port="821" Type="1" SendTimeout="2000" RecvTimeout="2000"> 
     <Device Name="Power2-1" Address="1"  VoltageUnitSetScale ="1000" UnitSetScale="1000000" UnitScale="1000000" VoltageUnitScale="10000"/>
   </PowerSupplierDeviceConfig>
-  <PowerSupplierDeviceConfig Name="Power3" IpAddress="127.0.0.1" Port="822" Type="0" SendTimeout="2000" RecvTimeout="2000"> 
-    <Device Name="Power3-1" Address="1"  VoltageUnitSetScale ="1000" UnitSetScale="1000" UnitScale="10000" VoltageUnitScale="10000"/>
+  <PowerSupplierDeviceConfig Name="Power3" IpAddress="192.168.0.200" Port="20" Type="0" SendTimeout="2000" RecvTimeout="2000"> 
+    <Device Name="Power3-1" Address="1"  VoltageUnitSetScale ="1000" UnitSetScale="100000" UnitScale="100000" VoltageUnitScale="100"/>
   </PowerSupplierDeviceConfig>
   <PowerSupplierDeviceConfig Name="Power4" IpAddress="127.0.0.1" Port="823" Type="0" SendTimeout="2000" RecvTimeout="2000"> 
     <Device Name="Power4-1" Address="1"  VoltageUnitSetScale ="1000" UnitSetScale="1000" UnitScale="10000" VoltageUnitScale="10000"/>

+ 123 - 0
PunkHPX8_RT/Devices/PlatingCell/PlatingCellDevice.cs

@@ -8,6 +8,7 @@ using MECF.Framework.Common.Beckhoff.ModuleIO;
 using MECF.Framework.Common.CommonData.Metal;
 using MECF.Framework.Common.CommonData.PlatingCell;
 using MECF.Framework.Common.CommonData.Reservoir;
+using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.IOCore;
 using MECF.Framework.Common.Persistent.Reservoirs;
 using MECF.Framework.Common.ToolLayout;
@@ -16,6 +17,7 @@ using PunkHPX8_RT.Devices.AXIS;
 using PunkHPX8_RT.Devices.LinMot;
 using PunkHPX8_RT.Devices.PowerSupplier;
 using PunkHPX8_RT.Devices.Reservoir;
+using PunkHPX8_RT.Devices.VpwMain;
 using PunkHPX8_RT.Modules;
 using PunkHPX8_RT.Modules.PlatingCell;
 using System;
@@ -85,6 +87,10 @@ namespace PunkHPX8_RT.Devices.PlatingCell
         /// vertical电机
         /// </summary>
         private JetAxisBase _verticalAxis;
+        /// <summary>
+        /// vertical电机
+        /// </summary>
+        private JetAxisBase _rotationAxis;
         #endregion
 
         #region 属性
@@ -169,6 +175,10 @@ namespace PunkHPX8_RT.Devices.PlatingCell
             {
                 _verticalAxis.OnTimer();
             }
+            if (_rotationAxis != null) 
+            { 
+                _rotationAxis.OnTimer();
+            }
             return true;
         }
 
@@ -205,6 +215,7 @@ namespace PunkHPX8_RT.Devices.PlatingCell
             {
                 _verticalAxis = DEVICE.GetDevice<JetAxisBase>("PlatingCell3_4.Vertical");
             }
+            _rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Rotation");
         }
         protected virtual void SubscribeValueAction()
         {
@@ -331,9 +342,34 @@ namespace PunkHPX8_RT.Devices.PlatingCell
             OP.Subscribe($"{Module}.RinseEnable", (cmd, para) => { return RinseEnableAction(); });
             OP.Subscribe($"{Module}.RinseDisable", (cmd, para) => { return RinseDisableAction(); });
 
+            OP.Subscribe($"{Module}.StartRotation", StartRotationAction);
+            OP.Subscribe($"{Module}.StopRotation", StopRotationAction);
+
 
         }
         #region Operation
+        private bool StartRotationAction(string cmd, object[] args)
+        {
+            if (args.Length < 2 && (int)args[0] < 0 && (int)args[1] < 0)
+            {
+                LOG.WriteLog(eEvent.ERR_VPW, Module, $"Start rotation paramater is wrong");
+                return false;
+            }
+            double targetPostion = (int)args[0] * 6 * (int)args[1];
+            object[] param = new object[] { "", targetPostion };
+            int degSpeed = (int)args[0] * 6;
+            SetRotationSpeed(degSpeed);
+     
+
+            double AfterChangetargetPostion = (int)args[0] * 6 * (int)args[1];
+            return RotationProfilePosition(AfterChangetargetPostion);
+
+        }
+
+        private bool StopRotationAction(string cmd, object[] args)
+        {
+            return _rotationAxis.StopPositionOperation();
+        }
         public bool ClamShellClose()
         {
             return WriteVariableValue(CLAMSHELL_CLOSE, true);
@@ -510,6 +546,93 @@ namespace PunkHPX8_RT.Devices.PlatingCell
         }
         #endregion
 
+        #region RotationAxis
+        /// <summary>
+        /// 电机是否上电
+        /// </summary>
+        /// <returns></returns>
+        public bool CheckRotationSwitchOn()
+        {
+            return _rotationAxis.IsSwitchOn;
+        }
+        /// <summary>
+        /// Home rotation
+        /// </summary>
+        /// <returns></returns>
+        public bool HomeRotation()
+        {
+            return _rotationAxis.Home();
+        }
+        /// <summary>
+        /// 检验Rotation Home结果
+        /// </summary>
+        /// <returns></returns>
+        public bool CheckHomeEndStatus()
+        {
+            return CheckRotationEndStatus() && _rotationAxis.IsHomed;
+        }
+        /// <summary>
+        /// 检验Rotation结束状态
+        /// </summary>
+        /// <returns></returns>
+        public bool CheckRotationEndStatus()
+        {
+            return _rotationAxis.Status == PunkHPX8_Core.RState.End;
+        }
+        /// <summary>
+        /// 检验Rotation失败状态
+        /// </summary>
+        /// <returns></returns>
+        public bool CheckRotationStopStatus()
+        {
+            return _rotationAxis.Status == PunkHPX8_Core.RState.Failed;
+        }
+        /// <summary>
+        /// 设置速度
+        /// </summary>
+        /// <param name="speed"></param>
+        /// <returns></returns>
+        public bool SetRotationSpeed(int speed)
+        {
+            _rotationAxis.SetProfileSpeed(speed);
+            return true;
+        }
+        /// <summary>
+        /// 改变速度
+        /// </summary>
+        /// <param name="speed"></param>
+        /// <returns></returns>
+        public bool ChangeRotationSpeed(int speed)
+        {
+            return _rotationAxis.ChangeSpeed(speed);
+        }
+        /// <summary>
+        /// 电机运动
+        /// </summary>
+        /// <param name="position"></param>
+        /// <returns></returns>
+        public bool RotationProfilePosition(double position)
+        {
+            return _rotationAxis.ProfilePositionOperation(position);
+        }
+        /// <summary>
+        /// 停止运动 
+        /// </summary>
+        /// <returns></returns>
+        public bool StopProfilePosition()
+        {
+            return _rotationAxis.StopPositionOperation();
+        }
+        /// <summary>
+        /// 是否Rotation运动
+        /// </summary>
+        /// <returns></returns>
+        public bool CheckRotationRunning()
+        {
+            return _rotationAxis.IsRun;
+        }
+        #endregion
+
 
 
 

+ 2 - 2
PunkHPX8_Themes/UserControls/PlatingCellStatusControl.xaml

@@ -71,12 +71,12 @@
         </Grid>
 
         <Control:NumbericTextBox Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="15" FontWeight="Bold" Height="22" Width="50" Margin="5,0,5,0"
-                Value="{Binding ElementName=self,Path=InputRotationSpeed}"  
+                Value="{Binding ElementName=self,Path=InputRotationSpeed,Mode=TwoWay}"  
                 IsEnabled="True"/>
         <TextBlock Grid.Row="7" Background="White"   Grid.Column="2" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center"  FontSize="15" FontWeight="Bold" Height="22" Width="40" Margin="-35,0,30,0" Text="rpm"/>
 
         <Control:NumbericTextBox Grid.Row="7" Grid.Column="3" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="15" FontWeight="Bold" Height="22" Width="50" Margin="-7,0,5,0"
-          Value="{Binding ElementName=self,Path=InputRotationTime}"  
+          Value="{Binding ElementName=self,Path=InputRotationTime,Mode=TwoWay}"  
           IsEnabled="True"/>
         <TextBlock Grid.Row="7" Background="White"   Grid.Column="4" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center"  FontSize="15" FontWeight="Bold" Height="22" Width="40" Margin="-65,0,50,0" Text="sec"/>
 

+ 246 - 2
PunkHPX8_Twincate/PunkHPX8/PlcTest/POUs/MAIN.TcPOU

@@ -684,10 +684,69 @@ VAR
 	PlatingCell3_4Vertical_FollowingErrorActualValue AT%I* :DINT;
 	PlatingCell3_4Vertical_MotorStep :DINT;
 	
+
+	PlatingCell1_RotationStatusWord AT%I* :UINT;
+	PlatingCell1_RotationDigitalInputs AT%I* :UDINT;
+	PlatingCell1_RotationPositionError AT%I* :UDINT;
+	PlatingCell1_RotationActualVelocity AT%I* :UDINT;
+	PlatingCell1_RotationActualTorque AT%I* :DINT;
+	PlatingCell1_RotationMotorPosition AT%I* :DINT;	
+	PlatingCell1_RotationControlWord AT%Q* :UINT;	
+	PlatingCell1_RotationModeOfOperation AT%Q* :SINT;	
+	PlatingCell1_RotationTargetPosition AT%Q* :DINT;	
+	PlatingCell1_RotationProfileVelocity AT%Q* :DINT;
+	PlatingCell1_RotationProfileAccel AT%Q* :UDINT;
+	PlatingCell1_RotationProfileDecel AT%Q* :UDINT;	
+	PlatingCell1_RotationMotorStep :DINT;
+	
+    PlatingCell2_RotationStatusWord AT%I* :UINT;
+	PlatingCell2_RotationDigitalInputs AT%I* :UDINT;
+	PlatingCell2_RotationPositionError AT%I* :UDINT;
+	PlatingCell2_RotationActualVelocity AT%I* :UDINT;
+	PlatingCell2_RotationActualTorque AT%I* :DINT;
+	PlatingCell2_RotationMotorPosition AT%I* :DINT;	
+	PlatingCell2_RotationControlWord AT%Q* :UINT;	
+	PlatingCell2_RotationModeOfOperation AT%Q* :SINT;	
+	PlatingCell2_RotationTargetPosition AT%Q* :DINT;	
+	PlatingCell2_RotationProfileVelocity AT%Q* :DINT;
+	PlatingCell2_RotationProfileAccel AT%Q* :UDINT;
+	PlatingCell2_RotationProfileDecel AT%Q* :UDINT;	
+	PlatingCell2_RotationMotorStep :DINT;
+	
+
+	PlatingCell3_RotationStatusWord AT%I* :UINT;
+	PlatingCell3_RotationDigitalInputs AT%I* :UDINT;
+	PlatingCell3_RotationPositionError AT%I* :UDINT;
+	PlatingCell3_RotationActualVelocity AT%I* :UDINT;
+	PlatingCell3_RotationActualTorque AT%I* :DINT;
+	PlatingCell3_RotationMotorPosition AT%I* :DINT;	
+	PlatingCell3_RotationControlWord AT%Q* :UINT;	
+	PlatingCell3_RotationModeOfOperation AT%Q* :SINT;	
+	PlatingCell3_RotationTargetPosition AT%Q* :DINT;	
+	PlatingCell3_RotationProfileVelocity AT%Q* :DINT;
+	PlatingCell3_RotationProfileAccel AT%Q* :UDINT;
+	PlatingCell3_RotationProfileDecel AT%Q* :UDINT;	
+	PlatingCell3_RotationMotorStep :DINT;
+	
+	PlatingCell4_RotationStatusWord AT%I* :UINT;
+	PlatingCell4_RotationDigitalInputs AT%I* :UDINT;
+	PlatingCell4_RotationPositionError AT%I* :UDINT;
+	PlatingCell4_RotationActualVelocity AT%I* :UDINT;
+	PlatingCell4_RotationActualTorque AT%I* :DINT;
+	PlatingCell4_RotationMotorPosition AT%I* :DINT;	
+	PlatingCell4_RotationControlWord AT%Q* :UINT;	
+	PlatingCell4_RotationModeOfOperation AT%Q* :SINT;	
+	PlatingCell4_RotationTargetPosition AT%Q* :DINT;	
+	PlatingCell4_RotationProfileVelocity AT%Q* :DINT;
+	PlatingCell4_RotationProfileAccel AT%Q* :UDINT;
+	PlatingCell4_RotationProfileDecel AT%Q* :UDINT;	
+	PlatingCell4_RotationMotorStep :DINT;
+	
 	
 END_VAR]]></Declaration>
     <Implementation>
-      <ST><![CDATA[IF VPW1RotationControlWord =7 THEN
+      <ST><![CDATA[//vpw1 rotation
+IF VPW1RotationControlWord =7 THEN
 	VPW1RotationStatusWord := 563;
 	ELSE IF VPW1RotationControlWord =6 THEN
 		VPW1RotationStatusWord :=33;
@@ -730,7 +789,7 @@ IF VPW1RotationModeOfOperation=1 THEN
 	END_IF
 END_IF
 
-
+//vpw2 rotation
 IF VPW2RotationControlWord =7 THEN
 	VPW2RotationStatusWord := 563;
 	ELSE IF VPW2RotationControlWord =6 THEN
@@ -1202,10 +1261,187 @@ IF PlatingCell3_4Vertical_ModeOfOperation=1 THEN
 END_IF
 
 
+//PlatingCell1 rotation
+IF PlatingCell1_RotationControlWord =7 THEN
+	PlatingCell1_RotationStatusWord := 563;
+	ELSE IF PlatingCell1_RotationControlWord =6 THEN
+		PlatingCell1_RotationStatusWord :=33;
+	ELSE IF PlatingCell1_RotationControlWord=15 THEN
+		PlatingCell1_RotationStatusWord :=567;
+		PlatingCell1_RotationDigitalInputs.22:=FALSE;
+		ELSE IF PlatingCell1_RotationControlWord=31 THEN
+			PlatingCell1_RotationDigitalInputs.22:=TRUE;
+			PlatingCell1_RotationStatusWord :=5687;
+			PlatingCell1_RotationMotorPosition:=0;
+		END_IF
+	END_IF
+	END_IF
+	
+END_IF
+IF PlatingCell1_RotationModeOfOperation=1 THEN
+	IF PlatingCell1_RotationControlWord=63 THEN
+		IF PlatingCell1_RotationMotorPosition<PlatingCell1_RotationTargetPosition THEN
+			PlatingCell1_RotationMotorStep :=(PlatingCell1_RotationTargetPosition-PlatingCell1_RotationMotorPosition)/20;
+			IF PlatingCell1_RotationMotorStep >1 THEN
+				PlatingCell1_RotationMotorPosition :=PlatingCell1_RotationMotorPosition+PlatingCell1_RotationMotorStep;
+			ELSE
+				PlatingCell1_RotationMotorPosition :=PlatingCell1_RotationMotorPosition+1;
+			END_IF
+		ELSE IF PlatingCell1_RotationMotorPosition>PlatingCell1_RotationTargetPosition THEN	
+			PlatingCell1_RotationMotorStep :=(PlatingCell1_RotationMotorPosition-PlatingCell1_RotationTargetPosition)/20;
+			IF PlatingCell1_RotationMotorStep >1 THEN
+				PlatingCell1_RotationMotorPosition :=PlatingCell1_RotationMotorPosition-PlatingCell1_RotationMotorStep;
+			ELSE
+				PlatingCell1_RotationMotorPosition :=PlatingCell1_RotationMotorPosition-1;
+			END_IF		
+		ELSE
+			PlatingCell1_RotationStatusWord :=1591;				
+		END_IF			
+		END_IF		
+	ELSE IF PlatingCell1_RotationControlWord=319 THEN
+		PlatingCell1_RotationStatusWord :=1591;
+	END_IF
+	END_IF
+END_IF
+
+
+//PlatingCell2 rotation
+IF PlatingCell2_RotationControlWord =7 THEN
+	PlatingCell2_RotationStatusWord := 563;
+	ELSE IF PlatingCell2_RotationControlWord =6 THEN
+		PlatingCell2_RotationStatusWord :=33;
+	ELSE IF PlatingCell2_RotationControlWord=15 THEN
+		PlatingCell2_RotationStatusWord :=567;
+		PlatingCell2_RotationDigitalInputs.22:=FALSE;
+		ELSE IF PlatingCell2_RotationControlWord=31 THEN
+			PlatingCell2_RotationDigitalInputs.22:=TRUE;
+			PlatingCell2_RotationStatusWord :=5687;
+			PlatingCell2_RotationMotorPosition:=0;
+		END_IF
+	END_IF
+	END_IF
+	
+END_IF
+IF PlatingCell2_RotationModeOfOperation=1 THEN
+	IF PlatingCell2_RotationControlWord=63 THEN
+		IF PlatingCell2_RotationMotorPosition<PlatingCell2_RotationTargetPosition THEN
+			PlatingCell2_RotationMotorStep :=(PlatingCell2_RotationTargetPosition-PlatingCell2_RotationMotorPosition)/20;
+			IF PlatingCell2_RotationMotorStep >1 THEN
+				PlatingCell2_RotationMotorPosition :=PlatingCell2_RotationMotorPosition+PlatingCell2_RotationMotorStep;
+			ELSE
+				PlatingCell2_RotationMotorPosition :=PlatingCell2_RotationMotorPosition+1;
+			END_IF
+		ELSE IF PlatingCell2_RotationMotorPosition>PlatingCell2_RotationTargetPosition THEN	
+			PlatingCell2_RotationMotorStep :=(PlatingCell2_RotationMotorPosition-PlatingCell2_RotationTargetPosition)/20;
+			IF PlatingCell2_RotationMotorStep >1 THEN
+				PlatingCell2_RotationMotorPosition :=PlatingCell2_RotationMotorPosition-PlatingCell2_RotationMotorStep;
+			ELSE
+				PlatingCell2_RotationMotorPosition :=PlatingCell2_RotationMotorPosition-1;
+			END_IF		
+		ELSE
+			PlatingCell2_RotationStatusWord :=1591;				
+		END_IF			
+		END_IF		
+	ELSE IF PlatingCell2_RotationControlWord=319 THEN
+		PlatingCell2_RotationStatusWord :=1591;
+	END_IF
+	END_IF
+END_IF
+
+// platingcell3 rotation
+IF PlatingCell3_RotationControlWord =7 THEN
+	PlatingCell3_RotationStatusWord := 563;
+	ELSE IF PlatingCell3_RotationControlWord =6 THEN
+		PlatingCell3_RotationStatusWord :=33;
+	ELSE IF PlatingCell3_RotationControlWord=15 THEN
+		PlatingCell3_RotationStatusWord :=567;
+		PlatingCell3_RotationDigitalInputs.22:=FALSE;
+		ELSE IF PlatingCell3_RotationControlWord=31 THEN
+			PlatingCell3_RotationDigitalInputs.22:=TRUE;
+			PlatingCell3_RotationStatusWord :=5687;
+			PlatingCell3_RotationMotorPosition:=0;
+		END_IF
+	END_IF
+	END_IF
+	
+END_IF
+
+IF PlatingCell3_RotationModeOfOperation=1 THEN
+	IF PlatingCell3_RotationControlWord=63 THEN
+		IF PlatingCell3_RotationMotorPosition<PlatingCell3_RotationTargetPosition THEN
+			PlatingCell3_RotationMotorStep :=(PlatingCell3_RotationTargetPosition-PlatingCell3_RotationMotorPosition)/20;
+			IF PlatingCell3_RotationMotorStep >1 THEN
+				PlatingCell3_RotationMotorPosition :=PlatingCell3_RotationMotorPosition+PlatingCell3_RotationMotorStep;
+			ELSE
+				PlatingCell3_RotationMotorPosition :=PlatingCell3_RotationMotorPosition+1;
+			END_IF
+		ELSE IF PlatingCell3_RotationMotorPosition>PlatingCell3_RotationTargetPosition THEN	
+			PlatingCell3_RotationMotorStep :=(PlatingCell3_RotationMotorPosition-PlatingCell3_RotationTargetPosition)/20;
+			IF PlatingCell3_RotationMotorStep >1 THEN
+				PlatingCell3_RotationMotorPosition :=PlatingCell3_RotationMotorPosition-PlatingCell3_RotationMotorStep;
+			ELSE
+				PlatingCell3_RotationMotorPosition :=PlatingCell3_RotationMotorPosition-1;
+			END_IF		
+		ELSE
+			PlatingCell3_RotationStatusWord :=1591;				
+		END_IF			
+		END_IF		
+	ELSE IF PlatingCell3_RotationControlWord=319 THEN
+		PlatingCell3_RotationStatusWord :=1591;
+	END_IF
+	END_IF
+END_IF
+
+// platingcell4 rotation
+IF PlatingCell4_RotationControlWord =7 THEN
+	PlatingCell4_RotationStatusWord := 563;
+	ELSE IF PlatingCell4_RotationControlWord =6 THEN
+		PlatingCell4_RotationStatusWord :=33;
+	ELSE IF PlatingCell4_RotationControlWord=15 THEN
+		PlatingCell4_RotationStatusWord :=567;
+		PlatingCell4_RotationDigitalInputs.22:=FALSE;
+		ELSE IF PlatingCell4_RotationControlWord=31 THEN
+			PlatingCell4_RotationDigitalInputs.22:=TRUE;
+			PlatingCell4_RotationStatusWord :=5687;
+			PlatingCell4_RotationMotorPosition:=0;
+		END_IF
+	END_IF
+	END_IF
+	
+END_IF
+
+IF PlatingCell4_RotationModeOfOperation=1 THEN
+	IF PlatingCell4_RotationControlWord=63 THEN
+		IF PlatingCell4_RotationMotorPosition<PlatingCell4_RotationTargetPosition THEN
+			PlatingCell4_RotationMotorStep :=(PlatingCell4_RotationTargetPosition-PlatingCell4_RotationMotorPosition)/20;
+			IF PlatingCell4_RotationMotorStep >1 THEN
+				PlatingCell4_RotationMotorPosition :=PlatingCell4_RotationMotorPosition+PlatingCell4_RotationMotorStep;
+			ELSE
+				PlatingCell4_RotationMotorPosition :=PlatingCell4_RotationMotorPosition+1;
+			END_IF
+		ELSE IF PlatingCell4_RotationMotorPosition>PlatingCell4_RotationTargetPosition THEN	
+			PlatingCell4_RotationMotorStep :=(PlatingCell4_RotationMotorPosition-PlatingCell4_RotationTargetPosition)/20;
+			IF PlatingCell4_RotationMotorStep >1 THEN
+				PlatingCell4_RotationMotorPosition :=PlatingCell4_RotationMotorPosition-PlatingCell4_RotationMotorStep;
+			ELSE
+				PlatingCell4_RotationMotorPosition :=PlatingCell4_RotationMotorPosition-1;
+			END_IF		
+		ELSE
+			PlatingCell4_RotationStatusWord :=1591;				
+		END_IF			
+		END_IF		
+	ELSE IF PlatingCell4_RotationControlWord=319 THEN
+		PlatingCell4_RotationStatusWord :=1591;
+	END_IF
+	END_IF
+END_IF
+
+
 
 ]]></ST>
     </Implementation>
     <LineIds Name="MAIN">
+      <LineId Id="5518" Count="0" />
       <LineId Id="52" Count="5" />
       <LineId Id="104" Count="0" />
       <LineId Id="59" Count="0" />
@@ -1337,6 +1573,14 @@ END_IF
       <LineId Id="3855" Count="38" />
       <LineId Id="3854" Count="0" />
       <LineId Id="4579" Count="41" />
+      <LineId Id="5348" Count="42" />
+      <LineId Id="5347" Count="0" />
+      <LineId Id="5433" Count="42" />
+      <LineId Id="5432" Count="0" />
+      <LineId Id="5562" Count="0" />
+      <LineId Id="5519" Count="42" />
+      <LineId Id="5564" Count="42" />
+      <LineId Id="5563" Count="0" />
       <LineId Id="4578" Count="0" />
       <LineId Id="3182" Count="0" />
       <LineId Id="3181" Count="0" />