Commit e7e9fd01 刘韬

111

1 个父辈 926496b1
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
<PropertyGroup> <PropertyGroup>
<ApplicationIcon>box.ico</ApplicationIcon> <ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CodeLibrary, Version=1.0.7874.27460, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CodeLibrary, Version=1.0.7874.27460, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
...@@ -204,6 +207,7 @@ ...@@ -204,6 +207,7 @@
<EmbeddedResource Include="useControl\uc_boxdebug.resx"> <EmbeddedResource Include="useControl\uc_boxdebug.resx">
<DependentUpon>uc_boxdebug.cs</DependentUpon> <DependentUpon>uc_boxdebug.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.manifest" />
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="resource\language.resource"> <None Include="resource\language.resource">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
......
...@@ -902,9 +902,9 @@ namespace OnlineStore.ACSingleStore ...@@ -902,9 +902,9 @@ namespace OnlineStore.ACSingleStore
short slvAddr = store.Config.UpDown_Axis.GetAxisValue(); short slvAddr = store.Config.UpDown_Axis.GetAxisValue();
int ioIndex = 0; int ioIndex = 0;
// if (store.Config.StoreDIList.ContainsKey(IO_Type.UpdownPositionSingal)) // if (store.Config.StoreDIList.ContainsKey(IO_Type.UpdownPositionSingal))
if (store.Config.StoreDIList.ContainsKey(IO_Type.TrayCheck_Fixture)) if (store.Config.StoreDIList.ContainsKey(IO_Type.Laser_detection))
{ {
ioIndex = store.Config.StoreDIList[IO_Type.TrayCheck_Fixture].GetIOAddr(); ioIndex = store.Config.StoreDIList[IO_Type.Laser_detection].GetIOAddr();
} }
FrmPositionTool frm = new FrmPositionTool(PortName, slvAddr, ioIndex, store.Config.UpDown_Axis.HomeHighSpeed, store.Config.UpDown_Axis.HomeLowSpeed, store.Config.UpDown_Axis.HomeAddSpeed); FrmPositionTool frm = new FrmPositionTool(PortName, slvAddr, ioIndex, store.Config.UpDown_Axis.HomeHighSpeed, store.Config.UpDown_Axis.HomeLowSpeed, store.Config.UpDown_Axis.HomeAddSpeed);
frm.ShowDialog(); frm.ShowDialog();
......
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。n
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
...@@ -19,6 +19,7 @@ namespace OnlineStore.ACSingleStore.useControl ...@@ -19,6 +19,7 @@ namespace OnlineStore.ACSingleStore.useControl
{ {
public partial class uc_boxdebug : UserControl public partial class uc_boxdebug : UserControl
{ {
private static string ApplicationData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
private AC_SA_BoxBean store; private AC_SA_BoxBean store;
private string StartAuto = ResourceCulture.GetString("开始自动出入库"); private string StartAuto = ResourceCulture.GetString("开始自动出入库");
private string StopAuto = ResourceCulture.GetString("停止自动出入库"); private string StopAuto = ResourceCulture.GetString("停止自动出入库");
...@@ -34,10 +35,21 @@ namespace OnlineStore.ACSingleStore.useControl ...@@ -34,10 +35,21 @@ namespace OnlineStore.ACSingleStore.useControl
public int OutStoreCheck = 0; public int OutStoreCheck = 0;
} }
string checkfiledir;
string poscheckfile;
public uc_boxdebug() public uc_boxdebug()
{ {
InitializeComponent(); InitializeComponent();
checkfiledir = Path.Combine(ApplicationData, "acsinglestore");
Directory.CreateDirectory(checkfiledir);
poscheckfile = positionConfigFile + ".check";
poscheckfile = Path.GetFileName(poscheckfile);
poscheckfile = Path.Combine(checkfiledir, poscheckfile);
if (File.Exists(positionConfigFile + ".check") && !File.Exists(poscheckfile)) {
File.Move(positionConfigFile + ".check", poscheckfile);
}
} }
public void Init(AC_SA_BoxBean store) public void Init(AC_SA_BoxBean store)
{ {
...@@ -115,7 +127,7 @@ namespace OnlineStore.ACSingleStore.useControl ...@@ -115,7 +127,7 @@ namespace OnlineStore.ACSingleStore.useControl
} }
void LoadPosCheck() { void LoadPosCheck() {
var poscheckfile = positionConfigFile + ".check";
if (File.Exists(poscheckfile)) if (File.Exists(poscheckfile))
{ {
try try
...@@ -145,7 +157,7 @@ namespace OnlineStore.ACSingleStore.useControl ...@@ -145,7 +157,7 @@ namespace OnlineStore.ACSingleStore.useControl
posState[posid].InStoreCheck = inStoreCheck; posState[posid].InStoreCheck = inStoreCheck;
if (outStoreCheck > 0) if (outStoreCheck > 0)
posState[posid].OutStoreCheck = outStoreCheck; posState[posid].OutStoreCheck = outStoreCheck;
var poscheckfile = positionConfigFile + ".check";
File.WriteAllText(poscheckfile, JsonHelper.SerializeObject(posState)); File.WriteAllText(poscheckfile, JsonHelper.SerializeObject(posState));
return posState[posid]; return posState[posid];
} }
......
...@@ -44,7 +44,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -44,7 +44,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public bool IsHasCompress_Axis = true; public bool IsHasCompress_Axis = true;
public bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1); public bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1);
public int MaxScanCount = ConfigAppSettings.GetIntValue(Setting_Init.MaxScanCount); public int MaxScanCount = ConfigAppSettings.GetIntValue(Setting_Init.MaxScanCount);
public int CurrScanCount = 1; public int CurrScanCount = 1;
//public ScanSocket scanSocket = new ScanSocket(); //public ScanSocket scanSocket = new ScanSocket();
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer(); private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
...@@ -52,12 +52,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -52,12 +52,12 @@ namespace OnlineStore.DeviceLibrary
private int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds); private int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds);
public AC_SA_BoxBean(AC_SA_Config config) public AC_SA_BoxBean(AC_SA_Config config)
{ {
string msg = "{\"cid\":\"Tower-5\",\"seq\":879,\"op\":1,\"data\":{\"code\":\"=7x8=78.22610.5BLDL-017425|WG1121C4M-2105|4000|M780174250521XG83|MURATA##\",\"boxId\":\"1\",\"doorReelSignal\":\"1\"},\"status\":1,\"msg\":null,\"msgEn\":\"\",\"msgCode\":\"\",\"msgParam\":null,\"boxStatus\":{\"1\":{\"boxId\":1,\"status\":1,\"data\":{},\"msg\":\"\",\"temperature\":\"22.6\",\"humidity\":\"56.1\",\"posId\":null}},\"alarmList\":[],\"time\":1619505231653,\"lastSaveTime\":1619505231653,\"code\":\"=7x8=78.22610.5BLDL-017425|WG1121C4M-2105|4000|M780174250521XG83|MURATA##\",\"doorReelSingnal\":\"1\",\"online\":true,\"codeBoxId\":\"1\",\"posId\":null}"; Operation op = JsonHelper.DeserializeJsonToObject<Operation>(msg); string msg = "{\"cid\":\"Tower-5\",\"seq\":879,\"op\":1,\"data\":{\"code\":\"=7x8=78.22610.5BLDL-017425|WG1121C4M-2105|4000|M780174250521XG83|MURATA##\",\"boxId\":\"1\",\"doorReelSignal\":\"1\"},\"status\":1,\"msg\":null,\"msgEn\":\"\",\"msgCode\":\"\",\"msgParam\":null,\"boxStatus\":{\"1\":{\"boxId\":1,\"status\":1,\"data\":{},\"msg\":\"\",\"temperature\":\"22.6\",\"humidity\":\"56.1\",\"posId\":null}},\"alarmList\":[],\"time\":1619505231653,\"lastSaveTime\":1619505231653,\"code\":\"=7x8=78.22610.5BLDL-017425|WG1121C4M-2105|4000|M780174250521XG83|MURATA##\",\"doorReelSingnal\":\"1\",\"online\":true,\"codeBoxId\":\"1\",\"posId\":null}"; Operation op = JsonHelper.DeserializeJsonToObject<Operation>(msg);
if (op.op.Equals(1)) if (op.op.Equals(1))
{ {
ReviceInStoreProcess("aaa",op); ReviceInStoreProcess("aaa", op);
} }
// int value= CalHeight(37); // int value= CalHeight(37);
Init(); Init();
serverConnectTimer = new System.Timers.Timer(); serverConnectTimer = new System.Timers.Timer();
serverConnectTimer.Interval = 1000; serverConnectTimer.Interval = 1000;
...@@ -97,7 +97,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -97,7 +97,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
LogUtil.info(StoreName + "共加载到["+positionList.Count+"]个库位,["+ PositionNumList.Count + "]个为料仓有效库位"); LogUtil.info(StoreName + "共加载到[" + positionList.Count + "]个库位,[" + PositionNumList.Count + "]个为料仓有效库位");
dlScanSocket = new DLScanSocket(config.Scanner_Ip, config.Scanner_Port, onCodeReceived); dlScanSocket = new DLScanSocket(config.Scanner_Ip, config.Scanner_Port, onCodeReceived);
//初始化摄像机配置 //初始化摄像机配置
CodeManager.LoadConfig(); CodeManager.LoadConfig();
...@@ -108,7 +108,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -108,7 +108,7 @@ namespace OnlineStore.DeviceLibrary
//throw new Exception("伺服板卡加载失败"); //throw new Exception("伺服板卡加载失败");
} }
LogUtil.info(StoreName + "启动主线程");
mainTimer.Enabled = false; mainTimer.Enabled = false;
int isAuto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun); int isAuto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
if (isAuto == 1) if (isAuto == 1)
...@@ -189,7 +189,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -189,7 +189,7 @@ namespace OnlineStore.DeviceLibrary
public override bool StartRun() public override bool StartRun()
{ {
LogUtil.info(LOGGER, StoreName + "开始启动,启动时间:" + StartTime.ToString()); LogUtil.info(LOGGER, StoreName + "开始启动,启动时间:" + StartTime.ToString());
autoNext = false; autoNext = false;
mainTimer.Enabled = false; mainTimer.Enabled = false;
alarmType = StoreAlarmType.None; alarmType = StoreAlarmType.None;
...@@ -232,12 +232,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -232,12 +232,12 @@ namespace OnlineStore.DeviceLibrary
{ {
if (suddenBtn.Equals(IO_VALUE.LOW)) if (suddenBtn.Equals(IO_VALUE.LOW))
{ {
SetWarnMsg(ResourceControl.startFail,"启动失败:急停未开"); SetWarnMsg(ResourceControl.startFail, "启动失败:急停未开");
LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:急停没开 !启动失败!"); LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:急停没开 !启动失败!");
} }
else else
{ {
SetWarnMsg(ResourceControl.startFailAir,"启动失败:没有气压信号"); SetWarnMsg(ResourceControl.startFailAir, "启动失败:没有气压信号");
LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:没有气压信号 !启动失败!"); LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:没有气压信号 !启动失败!");
} }
return false; return false;
...@@ -266,7 +266,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -266,7 +266,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisHomeMove(Config.InOut_Axis); ACAxisHomeMove(Config.InOut_Axis);
LogUtil.info(LOGGER, StoreName + "开始原点返回,先把进出轴回原点"); LogUtil.info(LOGGER, StoreName + "开始原点返回,先把进出轴回原点");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
} }
public void MoveToP1() public void MoveToP1()
{ {
//压紧轴回原点,叉子回到P1,关闭门旋转轴和升降轴回到P1 //压紧轴回原点,叉子回到P1,关闭门旋转轴和升降轴回到P1
...@@ -274,7 +274,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -274,7 +274,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_InOutToP1); StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_InOutToP1);
LogUtil.info(LOGGER, StoreName + "到待机状态,进出轴到P1,判断叉子没有料盘"); LogUtil.info(LOGGER, StoreName + "到待机状态,进出轴到P1,判断叉子没有料盘");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed); ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
// ComBeforeHomeMove(); // ComBeforeHomeMove();
//判断叉子没有料盘 //判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW)); //StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
} }
...@@ -342,7 +342,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -342,7 +342,7 @@ namespace OnlineStore.DeviceLibrary
{ {
string portName = Config.InOut_Axis.DeviceName; string portName = Config.InOut_Axis.DeviceName;
int slvAddr = Config.InOut_Axis.GetAxisValue(); int slvAddr = Config.InOut_Axis.GetAxisValue();
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack); StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
LogUtil.info(LOGGER, StoreName + "复位中,进出轴开始原点返回"); LogUtil.info(LOGGER, StoreName + "复位中,进出轴开始原点返回");
...@@ -383,7 +383,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -383,7 +383,7 @@ namespace OnlineStore.DeviceLibrary
//如果此时轴三还在报警,需要提示错误并等待 //如果此时轴三还在报警,需要提示错误并等待
if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0) if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{ {
LogUtil.error(LOGGER,StoreName+ "复位[" + StoreMove.MoveStep+"]过程中,进出轴报警!复位失败,请检查!"); LogUtil.error(LOGGER, StoreName + "复位[" + StoreMove.MoveStep + "]过程中,进出轴报警!复位失败,请检查!");
return; return;
} }
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴 //复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
...@@ -408,11 +408,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -408,11 +408,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + "复位中:旋转轴运动到P1,上下轴走到P1,压紧轴到P1!"); LogUtil.info(LOGGER, StoreName + "复位中:旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position,Config.CompAxis_P1_Speed); ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break; break;
case StoreMoveStep.BOX_H_MiddleAxisToP1: case StoreMoveStep.BOX_H_MiddleAxisToP1:
HuichuanLibrary.HCBoardManager.SetAxBacklash(Config.Middle_Axis.GetAxisValue(), Config.MiddleAxis_Reverse_Offset, Config.Middle_Axis.HomeLowSpeed, -1); HuichuanLibrary.HCBoardManager.SetAxBacklash(Config.Middle_Axis.GetAxisValue(), Config.MiddleAxis_Reverse_Offset, Config.Middle_Axis.HomeLowSpeed, -1);
LogUtil.info(LOGGER, StoreName + "复位完成,设置旋转轴反向间隙:"+ Config.MiddleAxis_Reverse_Offset); LogUtil.info(LOGGER, StoreName + "复位完成,设置旋转轴反向间隙:" + Config.MiddleAxis_Reverse_Offset);
storeRunStatus = StoreRunStatus.Runing; storeRunStatus = StoreRunStatus.Runing;
StoreMove.EndMove(); StoreMove.EndMove();
storeStatus = StoreStatus.StoreOnline; storeStatus = StoreStatus.StoreOnline;
...@@ -426,7 +426,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -426,7 +426,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_CompressHome); StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_CompressHome);
LogUtil.info(LOGGER, StoreName + "到待机状态,压紧轴回原点,关闭仓门"); LogUtil.info(LOGGER, StoreName + "到待机状态,压紧轴回原点,关闭仓门");
if (IsHasCompress_Axis) if (IsHasCompress_Axis)
{ {
ACAxisHomeMove(Config.Comp_Axis); ACAxisHomeMove(Config.Comp_Axis);
} }
//关闭仓门 //关闭仓门
...@@ -438,7 +438,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -438,7 +438,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1000));
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position,Config.CompAxis_P1_Speed); ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break; break;
case StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1: case StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1:
LogUtil.info(LOGGER, StoreName + "到待机状态完成"); LogUtil.info(LOGGER, StoreName + "到待机状态完成");
...@@ -453,7 +453,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -453,7 +453,7 @@ namespace OnlineStore.DeviceLibrary
default: break; default: break;
} }
} }
private void ComMoveToPosition(int targetPosition, int targetSpeed) private void ComMoveToPosition(int targetPosition, int targetSpeed)
{ {
if (IsHasCompress_Axis) if (IsHasCompress_Axis)
...@@ -483,7 +483,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -483,7 +483,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack_wait); StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack_wait);
LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴回原点"); LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴回原点");
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴 //复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
ACAxisHomeMove(Config.InOut_Axis); ACAxisHomeMove(Config.InOut_Axis);
break; break;
case StoreMoveStep.BOX_H_InOutBack_wait: case StoreMoveStep.BOX_H_InOutBack_wait:
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack); StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
...@@ -514,7 +514,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -514,7 +514,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack_wait); StoreMove.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack_wait);
if (IsHasCompress_Axis) if (IsHasCompress_Axis)
{ {
ACAxisHomeMove(Config.Comp_Axis); ACAxisHomeMove(Config.Comp_Axis);
} }
ACAxisHomeMove(Config.Middle_Axis); ACAxisHomeMove(Config.Middle_Axis);
ACAxisHomeMove(Config.UpDown_Axis); ACAxisHomeMove(Config.UpDown_Axis);
...@@ -528,7 +528,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -528,7 +528,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + "回原点:旋转轴运动到P1,上下轴到P1,压紧轴到P1!"); LogUtil.info(LOGGER, StoreName + "回原点:旋转轴运动到P1,上下轴到P1,压紧轴到P1!");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position,Config.CompAxis_P1_Speed); ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break; break;
case StoreMoveStep.BOX_H_MiddleAxisToP1: case StoreMoveStep.BOX_H_MiddleAxisToP1:
HuichuanLibrary.HCBoardManager.SetAxBacklash(Config.Middle_Axis.GetAxisValue(), Config.MiddleAxis_Reverse_Offset, Config.Middle_Axis.HomeLowSpeed, -1); HuichuanLibrary.HCBoardManager.SetAxBacklash(Config.Middle_Axis.GetAxisValue(), Config.MiddleAxis_Reverse_Offset, Config.Middle_Axis.HomeLowSpeed, -1);
...@@ -558,7 +558,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -558,7 +558,7 @@ namespace OnlineStore.DeviceLibrary
//ACServerManager.InitSlvAddr(portName, slvAddr); //ACServerManager.InitSlvAddr(portName, slvAddr);
if (!IsIntSlvBlock) if (!IsIntSlvBlock)
{ {
ACServerManager.InitSlvAddr(portName, slvAddr, moveAxis.TargetSpeed, moveAxis.TargetSpeed*4, moveAxis.TargetSpeed*4); ACServerManager.InitSlvAddr(portName, slvAddr, moveAxis.TargetSpeed, moveAxis.TargetSpeed * 4, moveAxis.TargetSpeed * 4);
Thread.Sleep(100); Thread.Sleep(100);
} }
ACServerManager.AlarmClear(portName, slvAddr); ACServerManager.AlarmClear(portName, slvAddr);
...@@ -608,10 +608,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -608,10 +608,10 @@ namespace OnlineStore.DeviceLibrary
ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue()); ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue());
int alarmCode = GetAlarmCodeByAxis(axis); int alarmCode = GetAlarmCodeByAxis(axis);
SetWarnMsg(ResourceControl.OpenAxisFail,axis.DisplayStr); SetWarnMsg(ResourceControl.OpenAxisFail, axis.DisplayStr);
// WarnMsg = StoreName + "打开轴" + axis.Explain + "失败 "; // WarnMsg = StoreName + "打开轴" + axis.Explain + "失败 ";
LogUtil.info(LOGGER, StoreName +WarnObj.WarnMsg); LogUtil.info(LOGGER, StoreName + WarnObj.WarnMsg);
Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axis).ToString(), StoreMove.MoveType); Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axis).ToString(), StoreMove.MoveType);
return false; return false;
} }
} }
...@@ -627,7 +627,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -627,7 +627,7 @@ namespace OnlineStore.DeviceLibrary
{ {
ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue()); ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue());
//关闭串口,等下次重新打开 //关闭串口,等下次重新打开
// ACServerManager.ColsePort(axis.DeviceName); // ACServerManager.ColsePort(axis.DeviceName);
} }
Thread.Sleep(100); Thread.Sleep(100);
//IOManager.IOMove(IO_Type.Run_Signal, IO_VALUE.LOW); //IOManager.IOMove(IO_Type.Run_Signal, IO_VALUE.LOW);
...@@ -672,12 +672,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -672,12 +672,12 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - StartTime; TimeSpan span = DateTime.Now - StartTime;
IsRun = false; IsRun = false;
dlScanSocket.Close(); dlScanSocket.Close();
IOManager.instance.CloseAllDO(); IOManager.instance.CloseAllDO();
LogUtil.info(LOGGER, StoreName + ",停止运行,总运行时间:" + span.ToString()); LogUtil.info(LOGGER, StoreName + ",停止运行,总运行时间:" + span.ToString());
} }
public override void Alarm(StoreAlarmType alarmType, string alarmDetial, StoreMoveType storeMoveType) public override void Alarm(StoreAlarmType alarmType, string alarmDetial, StoreMoveType storeMoveType)
{ {
//string alarmMsg,string alarmMsgEn, //string alarmMsg,string alarmMsgEn,
SaveAlarmInfo(alarmType, alarmDetial, WarnObj.WarnMsg, WarnObj.WarnMsgEn, WarnObj.WarnMsgJp, storeMoveType); SaveAlarmInfo(alarmType, alarmDetial, WarnObj.WarnMsg, WarnObj.WarnMsgEn, WarnObj.WarnMsgJp, storeMoveType);
...@@ -713,7 +713,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -713,7 +713,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.EndMove(); StoreMove.EndMove();
StopMove(true); StopMove(true);
storeStatus = StoreStatus.SuddenStop; storeStatus = StoreStatus.SuddenStop;
} }
} }
private bool InProcess = false; private bool InProcess = false;
//private DateTime preProcessTime = DateTime.Now; //private DateTime preProcessTime = DateTime.Now;
...@@ -880,7 +880,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -880,7 +880,7 @@ namespace OnlineStore.DeviceLibrary
} }
//StoreMove.MoveType.Equals(StoreMoveType.InStore) || StoreMove.MoveType.Equals(StoreMoveType.OutStore) //StoreMove.MoveType.Equals(StoreMoveType.InStore) || StoreMove.MoveType.Equals(StoreMoveType.OutStore)
//绿灯闪 //绿灯闪
if (( storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Reset)) if ((storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Reset))
&& IOManager.IOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH)) && IOManager.IOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH))
{ {
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
...@@ -938,6 +938,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -938,6 +938,13 @@ namespace OnlineStore.DeviceLibrary
{ {
IOManager.IOMove(IO_Type.Device_Led, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Device_Led, IO_VALUE.HIGH);
} }
if (UseBuzzer)
{
if (IOManager.IOValue(IO_Type.Alarm_Buzzer).Equals(IO_VALUE.LOW))
{
IOManager.IOMove(IO_Type.Alarm_Buzzer, IO_VALUE.HIGH);
}
}
} }
//else //else
//{ //{
...@@ -983,7 +990,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -983,7 +990,7 @@ namespace OnlineStore.DeviceLibrary
} }
//判断急停 //判断急停
else if (storeRunStatus >= StoreRunStatus.HomeMoving) else if (storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
//急停按钮 //急停按钮
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
...@@ -1092,6 +1099,28 @@ namespace OnlineStore.DeviceLibrary ...@@ -1092,6 +1099,28 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
bool lastSafeCheckstates = true;
bool SafeCheck() {
if (IOManager.IOValue(IO_Type.Door_Limit).Equals(IO_VALUE.LOW)
|| (Config.StoreDIList.ContainsKey(IO_Type.Door_LeftLimit) && IOManager.IOValue(IO_Type.Door_LeftLimit).Equals(IO_VALUE.LOW))
|| (Config.StoreDIList.ContainsKey(IO_Type.Door_RightLimit) && IOManager.IOValue(IO_Type.Door_RightLimit).Equals(IO_VALUE.LOW)))
{
if (lastSafeCheckstates)
{
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue());
StoreMove.CanWhileCount = 5;
}
lastSafeCheckstates = false;
return false;
}
else {
lastSafeCheckstates = true;
return true;
}
}
public void TimerProcess() public void TimerProcess()
{ {
try try
...@@ -1099,7 +1128,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -1099,7 +1128,8 @@ namespace OnlineStore.DeviceLibrary
DateTime time = DateTime.Now; DateTime time = DateTime.Now;
if (StoreMove.MoveType != StoreMoveType.None) if (StoreMove.MoveType != StoreMoveType.None)
{ {
BusyMoveProcess(); //if(SafeCheck())
BusyMoveProcess();
ShowTimeLog("BusyMoveProcess"); ShowTimeLog("BusyMoveProcess");
} }
else if (storeRunStatus.Equals(StoreRunStatus.Runing)) else if (storeRunStatus.Equals(StoreRunStatus.Runing))
...@@ -1338,7 +1368,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -1338,7 +1368,6 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public override void StopMove(bool IsCloseAxis) public override void StopMove(bool IsCloseAxis)
{ {
//IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
//运动版停止 //运动版停止
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
...@@ -1346,7 +1375,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -1346,7 +1375,6 @@ namespace OnlineStore.DeviceLibrary
if (IsHasCompress_Axis) if (IsHasCompress_Axis)
{ {
ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue());
// ShuoKeControls.SuddownStop(Config.CompressAxis_Slv);
} }
else else
{ {
......
...@@ -86,7 +86,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -86,7 +86,7 @@ namespace OnlineStore.DeviceLibrary
while (true) { while (true) {
if (DoorRunMonitorEnable) if (DoorRunMonitorEnable)
{ {
Thread.Sleep(5); Thread.Sleep(10);
} }
else { else {
//检测到门在运行立刻开始监控 //检测到门在运行立刻开始监控
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!