Commit aa303b48 刘韬

1

1 个父辈 73158970
......@@ -36,19 +36,39 @@ namespace DeviceLibrary
Msg = "";
string portName = Config.DeviceName;
short slvAddr = Config.GetAxisValue();
AxisManager.AlarmClear(portName, slvAddr);
Thread.Sleep(50);
AxisManager.ServoOn(portName, slvAddr);
Thread.Sleep(50);
//打开所有轴
if (isCheck)
if (AxisManager.IsServeoOn(portName, slvAddr))
return true;
for (int i = 0; i < 15; i++)
{
if (!OpenAxis(out Msg))
Msg += $"第{i}次尝试打开轴:{Config.Explain}\r\n";
for (int j = 0; j < 10; j++)
{
return false;
if (AxisManager.GetAlarmStatus(portName, slvAddr) != 0)
{
AxisManager.AlarmClear(portName, slvAddr);
Msg += "...尝试清除报警第" + j + "次";
Thread.Sleep(500);
continue;
}
break;
}
AxisManager.ServoOn(portName, slvAddr);
Thread.Sleep(50);
if (AxisManager.IsServeoOn(portName, slvAddr))
{
Msg += "...尝试使能成功";
return true;
}
else
Msg += "...尝试使能失败";
Thread.Sleep(2000);
Msg += "\r\n";
}
return true;
return false;
}
/// <summary>
/// 打开所有轴
......
......@@ -23,6 +23,7 @@ namespace DeviceLibrary
int upspeed;
int downspeed;
int StrokeLength = 270000;
MoveInfo moveInfo1 = new MoveInfo("升降机构", false);
bool paused = false;
public LiftMonitor(string _up, string _down,string _break, AxisBean _axisBean,int _StrokeLength,int _upspeed, int _downspeed= 0) {
up = _up;
......@@ -52,7 +53,7 @@ namespace DeviceLibrary
public void LiftUp(MoveInfo moveInfo) {
if (moveInfo == null)
moveInfo = new MoveInfo("界面",false);
moveInfo = moveInfo1;
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
moveInfo.log($"急停未解除");
......@@ -129,7 +130,7 @@ namespace DeviceLibrary
public void LiftDown(MoveInfo moveInfo)
{
if (moveInfo == null)
moveInfo = new MoveInfo("界面", false);
moveInfo = moveInfo1;
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
moveInfo.log($"急停未解除");
......@@ -224,7 +225,11 @@ namespace DeviceLibrary
public void Resume()
{
//throw new NotImplementedException();
if (moveInfo1.WaitList.Count > 0) {
if (moveInfo1.WaitList[0].WaitType == WaitEnum.W013_Action) {
moveInfo1.WaitList[0].Action?.Invoke(moveInfo1.WaitList[0]);
}
}
}
}
}
......@@ -51,7 +51,6 @@ namespace DeviceLibrary
internal AxisBean Comp_Axis;
internal AxisBean Batch_Axis;
internal AxisBean Clamp_Axis;
internal AxisBean StringDoor_Axis;
public LineRunMonitor Line;
public CylinderManger SingleDoor;
......@@ -566,7 +565,15 @@ namespace DeviceLibrary
}
Msg.add(crc.GetString(L.SafetyLight_is_block, "安全光栅被遮挡") + (ok ? ignorestring : ""), MsgLevel.warning);
}
if (ConfigHelper.Config.Get("Device_IO_X08IsStringDoor_SafetyLightCurtains", false))
{
if (IOValue(IO_Type.AGV_OnPosition).Equals(IO_VALUE.LOW))
{
ok = false;
DeviceSuddenStop();
Msg.add("料串门光栅被遮挡", MsgLevel.alarm, ErrInfo.SuddenStop);
}
}
if (!ConfigHelper.Config.Get("Device_Disable_DoorSafeCheck", false))
{
if (IOValue(IO_Type.LeftDoorClose_Check).Equals(IO_VALUE.LOW))
......@@ -674,18 +681,7 @@ namespace DeviceLibrary
else {
lastAirCloseTime = DateTime.MinValue;
}
if (ConfigHelper.Config.Get("Device_IO_X08IsStringDoor_SafetyLightCurtains", false))
{
if(StringDoor_Axis!=null)
{
if(StringDoor_Axis.IsBusy && IOValue(IO_Type.AGV_OnPosition).Equals(IO_VALUE.LOW))
{
ok=false;
StringDoor.Pause();
Msg.add("料串门光栅被遮挡", MsgLevel.alarm, ErrInfo.SuddenStop);
}
}
}
if (alarmType!=AlarmType.SuddenStop)
{
TimeSpan span = DateTime.Now - checkAlarmTime;
......
......@@ -169,6 +169,7 @@
this.lblAlarmcode.Tag = "not";
this.lblAlarmcode.Text = "ErrCode:160";
this.lblAlarmcode.Visible = false;
this.lblAlarmcode.Click += new System.EventHandler(this.lblAlarmcode_Click);
//
// label4
//
......
......@@ -444,5 +444,10 @@ namespace DeviceLibrary
lbl.BackColor = this.BackColor;
}
}
private void lblAlarmcode_Click(object sender, EventArgs e)
{
MessageBox.Show(string.Join(",", HuichuanLibrary.HCBoardManager.GetAxisErrorDetail(currentAxis.Config.GetAxisValue())));
}
}
}
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!