Commit 63b54a68 刘韬

上报料仓状态信息

1 个父辈 96048526
......@@ -24,31 +24,7 @@ namespace OnlineStore.Common
/// </summary>
public static string CameraName = "CameraName";
public static string Config_Pwd = "Config_Pwd";
public static string UseBuzzer = "UseBuzzer";
/// <summary>
/// 检测到料串自动入料
/// </summary>
public static string AutoInput = "AutoInput";
/// <summary>
/// 进出轴待机点位,进出轴在此位置时,升降和旋转才可以走
/// </summary>
public static string InoutDefaultPosition = "InoutDefaultPosition";
public static string LabelName = "LabelName";
public static string PrinterName = "PrinterName";
public static string NeedPrintLabel = "NeedPrintLabel";
public static string StickingPosJudgment = "StickingPosJudgment";
public static string GratingSignal = " GratingSignal";
/// <summary>
/// 启用贴标功能
/// </summary>
public static string UseLabel = "UseLabel";
public static string CodeType = "CodeType";
public static string CodeParamPath = "CodeParamPath";
......
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
......@@ -110,13 +111,13 @@ namespace OnlineStore.Common
return result;
}
static object lockpost = new object();
public static Operation Post(string url, Operation operation,int timeout=5000, bool printlog=false)
public static T Post<T>(string url, T operation,int timeout=5000, bool printlog=false) where T : new()
{
try
{
string json = JsonHelper.SerializeObject(operation);
string json = JsonConvert.SerializeObject(operation);
string result = Post(url, json, timeout);
Operation op = JsonHelper.DeserializeJsonToObject<Operation>(result);
T op = JsonConvert.DeserializeObject<T>(result);
if (printlog)
{
......@@ -126,9 +127,9 @@ namespace OnlineStore.Common
}
catch (Exception ex)
{
LogUtil.error("Post 出错【operation.op=" + operation.op + "】:" + ex);
LogUtil.error("Post 出错:" + ex);
}
return null;
return default;
}
public static string Get(string url)
{
......
......@@ -84,6 +84,7 @@
<Compile Include="DeviceLibrary\OKLEController.cs" />
<Compile Include="DeviceLibrary\ServerCommunication.cs" />
<Compile Include="DeviceLibrary\AxisBean.cs" />
<Compile Include="DeviceLibrary\ServerCommunication_AgvProcess.cs" />
<Compile Include="theMachine\BoxTransport.cs" />
<Compile Include="theMachine\Common.cs" />
<Compile Include="theMachine\JobList.cs" />
......
......@@ -101,7 +101,8 @@ namespace DeviceLibrary
}
Config.TargetPosition = 0;
LogUtil.info(AxisName + "speed[" + Config.HomeHighSpeed + "]开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(Config, true));
if (MoveInfo!=null)
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(Config, true));
var HomeLowSpeed = Config.HomeLowSpeed > 0 ? Config.HomeLowSpeed : Config.HomeHighSpeed / 10;
var HomeAddSpeed = Config.HomeAddSpeed > 0 ? Config.HomeAddSpeed : Config.HomeHighSpeed * 5;
......@@ -337,7 +338,7 @@ namespace DeviceLibrary
{
axisCheckTimer = new System.Timers.Timer();
axisCheckTimer.AutoReset = true;
axisCheckTimer.Interval += 30;
axisCheckTimer.Interval += 15;
axisCheckTimer.Elapsed += CheckTimer_Elapsed;
axisCheckTimer.Enabled = false;
}
......
......@@ -153,10 +153,11 @@ public class HIKCamera
public string GetFixtureStateFilename(string PositionNum, string WareNumber, StoreMoveType storeMoveType, FixtureState fixtureState)
{
Path.GetInvalidFileNameChars().ToList().ForEach((ix) => { WareNumber = WareNumber.Replace(ix.ToString(), ""); });
if (WareNumber.Length > 200) {
if (WareNumber.Length > 150) {
WareNumber = "";
}
if (string.IsNullOrEmpty(WareNumber))
WareNumber = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
string dir = $"\\image\\Fixture\\{storeMoveType}\\{PositionNum}\\";
Directory.CreateDirectory(dir);
string filename = $"{WareNumber}@@{fixtureState}.jpg";
......
......@@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace DeviceLibrary
{
public class LiftMonitor
public class LiftMonitor:ISafetyDevice
{
string up;
string down;
......@@ -18,16 +18,18 @@ namespace DeviceLibrary
int upspeed;
int downspeed;
int StrokeLength = 270000;
public LiftMonitor(string _up, string _down,string _break, AxisBean _axisBean,int _upspeed, int _downspeed= 0) {
public LiftMonitor(string _up, string _down,string _break, AxisBean _axisBean,int _StrokeLength,int _upspeed, int _downspeed= 0) {
up = _up;
down = _down;
axisBean = _axisBean;
upspeed = _upspeed;
axisbreak = _break;
downspeed = _downspeed;
StrokeLength = _StrokeLength;
if (downspeed == 0) {
downspeed = upspeed;
}
SafetyDevice.AddDevice(this);
}
public bool isAtTOP {
get {
......@@ -44,13 +46,18 @@ namespace DeviceLibrary
public void LiftUp(MoveInfo moveInfo) {
if (moveInfo == null)
moveInfo = new MoveInfo($"界面",false);
moveInfo = new MoveInfo("界面",false);
if (IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH)) {
moveInfo.log($"{axisBean.AxisName},已在位置,无需上升");
return;
}
IOManager.IOMove(axisbreak,IO_VALUE.HIGH);
Thread.Sleep(200);
if (!axisBean.IsServeoOn)
axisBean.Open(true, out string msg);
if (!string.IsNullOrEmpty(axisbreak))
{
IOManager.IOMove(axisbreak, IO_VALUE.HIGH);
Thread.Sleep(200);
}
axisBean.RelMove(StrokeLength, (double)upspeed);
DateTime d = DateTime.Now;
moveInfo.log($"{axisBean.AxisName},LiftUp");
......@@ -61,7 +68,8 @@ namespace DeviceLibrary
Task.Delay(30);
}
axisBean.SuddenStop();
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
if (!string.IsNullOrEmpty(axisbreak))
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
var t = (DateTime.Now - d).TotalSeconds;
moveInfo.log($"{axisBean.AxisName},上升到位,s:{t}");
});
......@@ -70,8 +78,9 @@ namespace DeviceLibrary
{
if (IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH))
{
axisBean.SuddenStop();
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
axisBean.SuddenStop();
if (!string.IsNullOrEmpty(axisbreak))
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
return true;
}
......@@ -83,14 +92,19 @@ namespace DeviceLibrary
public void LiftDown(MoveInfo moveInfo)
{
if (moveInfo == null)
moveInfo = new MoveInfo($"界面", false);
moveInfo = new MoveInfo("界面", false);
if (IOManager.IOValue(down.ToString()).Equals(IO_VALUE.HIGH))
{
moveInfo.log($"{axisBean.AxisName},已在位置,无需下降");
return;
}
IOManager.IOMove(axisbreak, IO_VALUE.HIGH);
Thread.Sleep(200);
if (!axisBean.IsServeoOn)
axisBean.Open(true, out string msg);
if (!string.IsNullOrEmpty(axisbreak))
{
IOManager.IOMove(axisbreak, IO_VALUE.HIGH);
Thread.Sleep(200);
}
axisBean.RelMove(-StrokeLength, (double)downspeed);
DateTime d = DateTime.Now;
moveInfo.log($"{axisBean.AxisName},LiftDown");
......@@ -103,7 +117,8 @@ namespace DeviceLibrary
Task.Delay(30);
}
axisBean.SuddenStop();
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
if (!string.IsNullOrEmpty(axisbreak))
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
var t = (DateTime.Now - d).TotalSeconds;
moveInfo.log($"{axisBean.AxisName},下降到位,s:{t}");
});
......@@ -113,7 +128,8 @@ namespace DeviceLibrary
if (IOManager.IOValue(down.ToString()).Equals(IO_VALUE.HIGH))
{
axisBean.SuddenStop();
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
if (!string.IsNullOrEmpty(axisbreak))
IOManager.IOMove(axisbreak, IO_VALUE.LOW);
return true;
}
......@@ -123,5 +139,15 @@ namespace DeviceLibrary
}
return false;
}
public void Pause()
{
axisBean.SuddenStop();
}
public void Resume()
{
//throw new NotImplementedException();
}
}
}
......@@ -11,7 +11,7 @@ using System.Threading.Tasks;
namespace DeviceLibrary
{
class ServerCommunication
partial class ServerCommunication
{
volatile StoreStatus _storeStatus = StoreStatus.Debugging;
public StoreStatus storeStatus {
......@@ -182,8 +182,9 @@ namespace DeviceLibrary
lineOperation.seq = ConfigAppSettings.nextSeq();
lineOperation.status = 1;
lineOperation.data = GetBtnStatus();
lineOperation.data = new Dictionary<string, string>();
lineOperation.data=lineOperation.data.Concat(GetBtnStatus()).ToDictionary(x=>x.Key,v=>v.Value);
lineOperation.data = lineOperation.data.Concat(AgvStatus()).ToDictionary(x => x.Key, v => v.Value);
lineOperation.status = (int)storeStatus;
//判断如果是等待料盘拿走超时,状态改为4Warning
......@@ -251,6 +252,21 @@ namespace DeviceLibrary
}
return host + api_communication;
}
public static string GetPostApi(string api)
{
var host = server;
if (!host.StartsWith("http://"))
{
host = "http://" + host;
}
if (!host.EndsWith("/"))
{
host = host + "/";
}
if (api.StartsWith("/"))
api = api.Substring(1);
return host + api;
}
int getthtime = 0;
int laststatus = 0;
public void SendLineStatus()
......@@ -322,8 +338,11 @@ namespace DeviceLibrary
ProcessHumidityCMD(resultOperation);
if (resultOperation.data != null)
{
string result = "";
Dictionary<string, string> dataMap = resultOperation.data;
AgvProcess(dataMap);
string result = "";
if (dataMap.ContainsKey(ParamDefine.queueTaskCount))
{
......@@ -385,6 +404,11 @@ namespace DeviceLibrary
}
public Dictionary<string, string> GetBtnStatus()
{
Dictionary<string, string> map = new Dictionary<string, string>();
......
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
partial class ServerCommunication
{
Dictionary<string, string> AgvStatus() {
Dictionary<string, string> status = new Dictionary<string, string>();
status["X16"] = IOManager.GetDIValue("", 0, 16).Equals(IO_VALUE.HIGH) ? "1" : "0";
status["X27"] = IOManager.GetDIValue("", 0, 27).Equals(IO_VALUE.HIGH) ? "1" : "0";
status["X09"] = IOManager.GetDIValue("", 0, 09).Equals(IO_VALUE.HIGH) ? "1" : "0";
status["X10"] = IOManager.GetDIValue("", 0, 10).Equals(IO_VALUE.HIGH) ? "1" : "0";
status["X11"] = IOManager.GetDIValue("", 0, 11).Equals(IO_VALUE.HIGH) ? "1" : "0";
status["X12"] = IOManager.GetDIValue("", 0, 12).Equals(IO_VALUE.HIGH) ? "1" : "0";
status["Y02"] = IOManager.GetDOValue("", 0, 2).Equals(IO_VALUE.HIGH) ? "1" : "0";
return status;
}
private void AgvProcess(Dictionary<string, string> dataMap)
{
bool v;
//紧急料口 1开门 0关门
if (YDataCheck(dataMap, "Y10", out v)|| YDataCheck(dataMap, "Y11", out v))
{
if (v)
RobotManage.mainMachine.SingleDoor.ToHigh(null);
else
RobotManage.mainMachine.SingleDoor.ToLow(null);
}
//折叠门 1开门 0关门
if (YDataCheck(dataMap, "Y15", out v)|| YDataCheck(dataMap, "Y14", out v))
{
if (v)
RobotManage.mainMachine.StringDoorOpen(null);
else
RobotManage.mainMachine.StringDoorClose(null);
}
//滚筒正传
if (YDataCheck(dataMap, "Y08", out v))
{
if (v)
RobotManage.mainMachine.Line.LineRun("remote", false, 999);
else
RobotManage.mainMachine.Line.LineStop("remote");
}
//滚筒反转
if (YDataCheck(dataMap, "Y09", out v))
{
if (v)
RobotManage.mainMachine.Line.LineRun("remote", true, 999);
else
RobotManage.mainMachine.Line.LineStop("remote");
}
}
Dictionary<string, int> LastSingnalSeq = new Dictionary<string, int>();
bool YDataCheck(Dictionary<string, string> dataMap, string key, out bool value) {
value = false;
if (!dataMap.TryGetValue(key, out string v))
return false;
//var vs = v.Split('|');
//if (vs.Length != 2)
// return false;
//if (!int.TryParse(vs[1], out int result))
// return false;
//if (!LastSingnalSeq.ContainsKey(key))
// LastSingnalSeq.Add(key, -1);
//if (LastSingnalSeq[key] == result)
// return false;
//LastSingnalSeq[key] = result;
v = v.Trim().ToLower();
LogUtil.info($"YDataCheck:{key},value:{v}");
if (v == "open")
{
value = true;
return true;
}
else if (v == "close")
{
value = false;
return true;
}
return false;
}
}
}
......@@ -211,12 +211,16 @@ namespace DeviceLibrary
break;
case MoveStep.StoreFIX04:
MoveInfo.NextMoveStep(MoveStep.StoreFIX05);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(400));
break;
case MoveStep.StoreFIX05:
MoveInfo.NextMoveStep(MoveStep.StoreFIX06);
Comp_Axis.AbsMove(MoveInfo, Fix.Comp_PL, Config.Comp_P2_speed);
UpDown_Axis.AbsMove(MoveInfo, Fix.UpDown_PH, Config.UpDown_P3_speed/2);
MoveInfo.log($"{storeMoveType}:压紧轴压紧点:{Fix.Comp_PL}");
MoveInfo.log($"{storeMoveType}:上下轴到达目的高点:{Fix.UpDown_PH}");
break;
case MoveStep.StoreFIX05:
case MoveStep.StoreFIX06:
MoveInfo.NextMoveStep(MoveStep.StoreTS10);
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
MoveInfo.log($"{storeMoveType}:进出轴到达待机点");
......
......@@ -306,7 +306,15 @@ namespace DeviceLibrary
LogUtil.info("关闭翻板门");
//IOMove(IO_Type.ReelFlipDoor_Home, IO_VALUE.LOW);
//IOMove(IO_Type.ReelFlipDoor_Work, IO_VALUE.HIGH);
FlipDoor.ToHigh(null);
if (ConfigHelper.Config.Get("Device_FlipDoorType", FlipDoorTypeE.Cylinder) == FlipDoorTypeE.Cylinder)
{
FlipDoor.ToHigh(null);
}
else
{
MotorFlipDoorA.LiftDown(moveInfo);
MotorFlipDoorB.LiftDown(moveInfo);
}
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ReelFlipDoor_L_Work, IO_VALUE.HIGH));
......@@ -325,9 +333,16 @@ namespace DeviceLibrary
LogUtil.info("打开翻板门");
else
moveInfo.log("打开翻板门");
//IOMove(IO_Type.ReelFlipDoor_Work, IO_VALUE.LOW);
//IOMove(IO_Type.ReelFlipDoor_Home, IO_VALUE.HIGH);
FlipDoor.ToLow(null);
if (MotorFlipDoorA==null)
{
FlipDoor.ToLow(null);
}
else
{
MotorFlipDoorA.LiftUp(moveInfo);
MotorFlipDoorB.LiftUp(moveInfo);
}
if (moveInfo != null)
{
......@@ -344,6 +359,10 @@ namespace DeviceLibrary
InStore,
Full
}
public enum FlipDoorTypeE {
Cylinder,
Motor
}
public enum StringTypeE
{
None=0,
......
......@@ -51,10 +51,14 @@ namespace DeviceLibrary
internal AxisBean Comp_Axis;
internal AxisBean Batch_Axis;
internal AxisBean Clamp_Axis;
internal AxisBean StringDoor_Axis;
public LineRunMonitor Line;
public CylinderManger SingleDoor;
public CylinderManger FlipDoor;
public LiftMonitor MotorFlipDoorA;
public LiftMonitor MotorFlipDoorB;
public LiftMonitor StringDoor;
ReelTransport boxTransport;
public bool boxTransportIsFree { get => boxTransport.IsComplateOrFree; }
......@@ -104,8 +108,53 @@ namespace DeviceLibrary
Crc_LanguageChangeEvent(null, EventArgs.Empty);
#endregion
Line = new LineRunMonitor($"料串进出机构", Config.DOList[IO_Type.LineRun].GetIOAddr(),Config.DOList[IO_Type.LineRev].GetIOAddr());
SingleDoor = new CylinderManger($"单料们", IO_Type.NGDoor_Open, IO_Type.NGDoor_Close);
FlipDoor = new CylinderManger($"翻板托盘", IO_Type.ReelFlipDoor_Work, IO_Type.ReelFlipDoor_Home);
SingleDoor = new CylinderManger($"单料门", IO_Type.NGDoor_Open, IO_Type.NGDoor_Close);
//检测翻板门是否为鸣志点击伺服控制
if (Config.FlipDoor_L_Axis == null && Config.FlipDoor_R_Axis == null)
{
FlipDoor = new CylinderManger($"翻板托盘", IO_Type.ReelFlipDoor_Work, IO_Type.ReelFlipDoor_Home);
var c = RobotManage.Config.configList.Find(x => x.ProName == "FlipDoorSpeed");
if (c != null)
RobotManage.Config.configList.Remove(c);
LogUtil.info("加载翻板门类型为:气缸");
}
else if (Config.FlipDoor_L_Axis != null && Config.FlipDoor_R_Axis != null)
{
RobotManage.Config.DOList.Remove(IO_Type.ReelFlipDoor_Work);
RobotManage.Config.DOList.Remove(IO_Type.ReelFlipDoor_Home);
MotorFlipDoorB = new LiftMonitor(IO_Type.ReelFlipDoor_L_Home, IO_Type.ReelFlipDoor_L_Work, null, new AxisBean(Config.FlipDoor_L_Axis, Name), Config.FlipDoorLength, Config.FlipDoorLength_speed);
MotorFlipDoorA = new LiftMonitor(IO_Type.ReelFlipDoor_R_Home, IO_Type.ReelFlipDoor_R_Work, null, new AxisBean(Config.FlipDoor_R_Axis, Name), Config.FlipDoorLength, Config.FlipDoorLength_speed);
LogUtil.info("加载翻板门类型为:步进");
}
else {
throw new Exception("料仓翻板门配置错误");
}
//检测料串门是否为鸣志电机控制
if (Config.StringDoor_Axis != null) {
RobotManage.Config.DOList.Remove(IO_Type.StringDoor_Open);
RobotManage.Config.DOList.Remove(IO_Type.StringDoor_Close);
StringDoor = new LiftMonitor(IO_Type.StringDoor_Open, IO_Type.StringDoor_Close, null, new AxisBean(Config.StringDoor_Axis, Name), Config.StringDoorLength, Config.StringDoorLength_speed);
LogUtil.info("加载料串门类型为:步进");
//此版本同步删除其他IO
RobotManage.Config.DOList.Remove(IO_Type.NitrogenValve);
}else
LogUtil.info("加载料串门类型为:气缸");
if (ConfigHelper.Config.Get("Device_Disable_DoorSafeCheck", false)) {
RobotManage.Config.DIList.Remove(IO_Type.LeftDoorClose_Check);
RobotManage.Config.DIList.Remove(IO_Type.RightDoorClose_Check);
RobotManage.Config.DIList.Remove(IO_Type.BackDoorClose_Check);
RobotManage.Config.DIList.Remove(IO_Type.AGV_OnPosition);
RobotManage.Config.DOList.Remove(IO_Type.DoorSafe_Disable);
}
boxTransport = new ReelTransport(Config, this);
boxTransport.InOutEndProcessEvent += delegate (string posid, StoreMoveType storeMoveType, bool arg4)
......@@ -305,15 +354,14 @@ namespace DeviceLibrary
return;
}
if (!ConfigHelper.Config.Get("Device_Disable_StringDoor", false))
CylinderMove(ResetMoveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.LOW);
StringDoorClose(null);
break;
case MoveStep.H02_HomeReset_01:
ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
ResetMoveInfo.log("进出轴,批量轴回原,料串检测杆退回避让端");
InOut_Axis.HomeMove(ResetMoveInfo, forceHome);
Batch_Axis.HomeMove(ResetMoveInfo, forceHome);
Batch_Axis.HomeMove(null, forceHome);
CylinderMove(ResetMoveInfo, IO_Type.StringPosChecker_Home, IO_Type.StringPosChecker_Work, IO_VALUE.LOW);
//CylinderMove(ResetMoveInfo, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.LOW);
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
SingleDoor.ToLow(ResetMoveInfo);
break;
......@@ -321,8 +369,6 @@ namespace DeviceLibrary
ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
ResetMoveInfo.log("夹爪轴回原");
Clamp_Axis.HomeMove(ResetMoveInfo, forceHome);
Line.LineRun("n", false, 5);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.H03_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
......@@ -330,13 +376,14 @@ namespace DeviceLibrary
InOut_Axis.AbsMove(ResetMoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
Middle_Axis.HomeMove(ResetMoveInfo, forceHome);
UpDown_Axis.HomeMove(ResetMoveInfo, forceHome);
Batch_Axis.HomeMove(ResetMoveInfo, forceHome);
//OpenFlipDoor(ResetMoveInfo);
break;
case MoveStep.H04_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
ResetMoveInfo.log("夹爪轴,P1待机点");
Clamp_Axis.AbsMove(ResetMoveInfo, Config.Clamp_P1, Config.Clamp_P1_speed);
Line.LineRun("n", false, 5);
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.H05_HomeReset:
......@@ -349,6 +396,7 @@ namespace DeviceLibrary
ResetMoveInfo.NextMoveStep(MoveStep.H07_HomeReset);
ResetMoveInfo.log("压紧轴回原");
Comp_Axis.HomeMove(ResetMoveInfo, forceHome);
break;
case MoveStep.H07_HomeReset:
if (IOValue(IO_Type.WidthCheck_7).Equals(IO_VALUE.HIGH) ||
......
......@@ -270,7 +270,7 @@ namespace DeviceLibrary
if (!ConfigHelper.Config.Get("CamTestReel_Ability", false))
ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_04);
RobotManage.UserPause(crc.GetString("please_take_ngdoor_reel","等待取走单口料盘"));
}
}
}
else
{
......
......@@ -64,7 +64,7 @@ namespace DeviceLibrary
StringMoveInfo.LastSetpTime = DateTime.Now;
StringMoveInfo.IsInWait = true;
if (!ConfigHelper.Config.Get("Device_Disable_StringDoor", false))
CylinderMove(StringMoveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.HIGH);
StringDoorOpen(StringMoveInfo);
return crc.GetString(L.begin_open_string_door, "开始打开料串门");
//LogUtil.info($"批量料门无法打开,料仓正在出入库中:{StringMoveInfo.MoveStep}");
......@@ -84,7 +84,7 @@ namespace DeviceLibrary
StringMoveInfo.LastSetpTime = DateTime.Now;
StringMoveInfo.IsInWait = true;
if (!ConfigHelper.Config.Get("Device_Disable_StringDoor", false))
CylinderMove(StringMoveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.LOW);
StringDoorClose(StringMoveInfo);
return crc.GetString(L.begin_close_string_door, "开始关闭料串门");
}
}
......
......@@ -92,7 +92,7 @@ namespace DeviceLibrary
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_01);
StringMoveInfo.log($"检测到有料串");
CylinderMove(StringMoveInfo, IO_Type.StringFix_Bottom, IO_Type.StringFix_Top, IO_VALUE.LOW);
StringState = StringStateE.OutStore;
//StringState = StringStateE.OutStore;
}
else if (IOValue(IO_Type.StringBack_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.StringFront_Check).Equals(IO_VALUE.LOW))
{
......@@ -106,6 +106,8 @@ namespace DeviceLibrary
Msg.add(crc.GetString(L.detect_string, "感应到料串"), MsgLevel.info);
StringMoveInfo.log($"感应到料串");
Line.LineRun("n", false, 2);
StringState = StringStateE.None;
LastStringState = StringStateE.None;
}
break;
case MoveStep.StringLoad_01:
......@@ -174,17 +176,18 @@ namespace DeviceLibrary
StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
}
}
else
else if(StringState != StringStateE.OutStore)
{
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04a);
StringState = StringStateE.InStore;
StringMoveInfo.log($"判断为入库料串");
}
break;
case MoveStep.StringLoad_04a:
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04b);
//StringMoveInfo.log($"料串下降到x13信号灭");
//BatchAxisToTagLow(StringMoveInfo);
StringMoveInfo.log($"料串下降到x13信号灭");
BatchAxisToTagLow(StringMoveInfo);
break;
case MoveStep.StringLoad_04b:
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_05);
......@@ -217,7 +220,7 @@ namespace DeviceLibrary
{
StringMoveInfo.NextMoveStep(MoveStep.StringReadyGet);
StringMoveInfo.log($"料串有盘上升5mm");
var tpos3 = Batch_Axis.GetAclPosition() + Config.Batch_PoToMM * (Config.Batch_DetectDownMM+0);
var tpos3 = Batch_Axis.GetAclPosition() + Config.Batch_PoToMM * (Config.Batch_DetectDownMM+2);
Batch_Axis.AbsMove(StringMoveInfo, tpos3, Config.Batch_P1);
CylinderMove(StringMoveInfo, IO_Type.Clamping_Relax, IO_Type.Clamping_Work, IO_VALUE.LOW);
//OpenFlipDoor(StringMoveInfo);
......@@ -439,7 +442,7 @@ namespace DeviceLibrary
moveInfo.TimeOutSeconds = 200;
moveInfo.CanWhileCount = 0;
// 需要增加定时器,获取验证信号并停止伺服
StartMovePosition = Batch_Axis.GetAclPosition();
StartMovePosition = Batch_Axis.GetAclPosition()- (Config.Batch_PoToMM * 2);
moveInfo.WaitList.Add(WaitResultInfo.WaitBatchAxisMove(Config.Batch_Axis, targetP2, targetSpeed));
Config.Batch_Axis.TargetPosition = targetP2;
Batch_Axis.AbsMove(null, targetP2, targetSpeed);
......@@ -511,5 +514,27 @@ namespace DeviceLibrary
LogUtil.info(msg);
return LastHeight;
}
public void StringDoorOpen(MoveInfo moveInfo) {
if (StringDoor != null)
{
StringDoor.LiftUp(moveInfo);
}
else
{
CylinderMove(moveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.HIGH);
}
}
public void StringDoorClose(MoveInfo moveInfo)
{
if (StringDoor!=null) {
StringDoor.LiftDown(moveInfo);
}
else {
CylinderMove(moveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.LOW);
}
}
}
}
\ No newline at end of file
......@@ -133,6 +133,7 @@ namespace DeviceLibrary
StoreFIX03,
StoreFIX04,
StoreFIX05,
StoreFIX06,
StoreTS10,
StoreTS11,
StoreTS12,
......
......@@ -5,10 +5,13 @@ AXIS,,进出机构,InOut_Axis,2,HC,,100000,0,0,0,40000,0,10,700,0,0
AXIS,,压紧机构,Comp_Axis,3,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,上料提升机构,Batch_Axis,4,HC,,40000,0,0,0,20000,0,10,700,0,0
AXIS,,取料机构,Clamp_Axis,5,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,左翻转托盘,FlipDoor_L_Axis,6,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,右翻转托盘,FlipDoor_R_Axis,7,HC,,40000,0,0,0,30000,0,10,700,0,0
,,,,,,,,,,,,,,,,
PRO,50,IO信号超时时间(秒),IOSingle_TimerOut,5,,,,,,,,,,,,
PRO,0,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,,
PRO,50,最后一盘料补充高度mm,LastTrayAddHeight,3,,,,,,,,,,,,
PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,10,旋转机构待机点P1,Middle_P1,168460,,,50000,,,,,,,,,
PRO,10,旋转机构单料口P2,Middle_P2,168460,,,50000,,,,,,,,,
......
......@@ -13,7 +13,7 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// ID
/// </summary>
public int Id { get; set; }
public int Id { get; set; }
/// <summary>
/// 设备类型
/// </summary>
......@@ -193,7 +193,11 @@ namespace OnlineStore.LoadCSVLibrary
{
prop.SetValue(this, Convert.ChangeType(0, prop.PropertyType), null);//赋值****在这里需要考虑类型问题
}
else
else if (prop.PropertyType.Equals(typeof(ConfigMoveAxis)))
{
prop.SetValue(this, null, null);//赋值****在这里需要考虑类型问题
}
else
{
prop.SetValue(this, Convert.ChangeType("", prop.PropertyType), null);//赋值****在这里需要考虑类型问题
}
......
......@@ -50,6 +50,24 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[ConfigProAttribute("Clamp_Axis")]
public ConfigMoveAxis Clamp_Axis { get; set; }
/// <summary>
/// AXIS,,左翻转门机构,FlipDoor_L_Axis,6,HC,,40000,0,0,0,30000,0,10,700,0,0
/// </summary>
[ConfigProAttribute("FlipDoor_L_Axis",false)]
public ConfigMoveAxis FlipDoor_L_Axis { get; set; }
/// <summary>
/// AXIS,,右取料机构,FlipDoor_R_Axis,7,HC,,40000,0,0,0,30000,0,10,700,0,0
/// </summary>
[ConfigProAttribute("FlipDoor_R_Axis", false)]
public ConfigMoveAxis FlipDoor_R_Axis { get; set; }
/// <summary>
/// AXIS,,料串口折叠门,FlipDoor_R_Axis,7,HC,,40000,0,0,0,30000,0,10,700,0,0
/// </summary>
[ConfigProAttribute("StringDoor_Axis", false)]
public ConfigMoveAxis StringDoor_Axis { get; set; }
/// <summary>
/// PRO,50,IO信号超时时间(秒),IOSingle_TimerOut,15,,,,,,,,,,,,
/// </summary>
......@@ -60,6 +78,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[ConfigProAttribute("AirCheckSeconds")]
public int AirCheckSeconds { get; set; }
/// <summary>
/// PRO,10,旋转机构待机点P1,Middle_P1,123,,,250000,,,,,,,,,
/// </summary>
......@@ -306,5 +325,30 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("Clamp_P3_speed")]
public int Clamp_P3_speed { get; set; }
/// <summary>
/// PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
/// </summary>
[ConfigProAttribute("FlipDoorLength",false)]
public int FlipDoorLength { get; set; }
/// <summary>
/// PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
/// </summary>
[ConfigProAttribute("FlipDoorLength_speed", false)]
public int FlipDoorLength_speed { get; set; }
/// <summary>
/// PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
/// </summary>
[ConfigProAttribute("StringDoorLength", false)]
public int StringDoorLength { get; set; }
/// <summary>
/// PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
/// </summary>
[ConfigProAttribute("StringDoorLength_speed", false)]
public int StringDoorLength_speed { get; set; }
}
}
......@@ -215,6 +215,8 @@ namespace TheMachine
DataGridViewCellStyle dgv_oout = new DataGridViewCellStyle() { BackColor = Color.LightSeaGreen, Font = font };
DataGridViewCellStyle dgv_none = new DataGridViewCellStyle() { BackColor = Color.White,Font= font };
void FillBoxPos() {
if (RobotManage.PositionNumList.Count == 0)
return;
htpp.Clear();
dataGridView1.Columns.Clear();
dataGridView1.Rows.Clear();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!