Commit 022d033f LN

修改项目名

1 个父辈 5bda3d61
正在显示 66 个修改的文件 包含 664 行增加417 行删除
......@@ -18,7 +18,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\source\ACSingleStore\bin\</OutputPath>
<OutputPath>..\source\HCSingleStore\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
......
......@@ -3,30 +3,22 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29519.87
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ACSingleStore", "source\ACSingleStore\ACSingleStore.csproj", "{0D2542F5-DD62-4352-82D0-383D9A045E74}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "source\Common\Common.csproj", "{43CDD09E-FCF3-4960-A01D-3BBFE9933122}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLibrary", "source\DeviceLibrary\DeviceLibrary.csproj", "{513BC1C9-800D-43A6-9499-3700BAEC3554}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserFromControl", "source\UserFromControl\UserFromControl.csproj", "{F018462A-D9BC-4365-97F2-F6D71751641E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "source\LoadCVSLibrary\LoadCSVLibrary.csproj", "{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProCopyClient", "ProCopyClient\ProCopyClient.csproj", "{63ED00F8-B7E2-4674-859C-22B11625CAE8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HuichuanLibrary", "source\HuichuanLibrary\HuichuanLibrary.csproj", "{C9575C5E-9D4B-4B4F-BE41-926652B8985F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HCSingleStore", "source\HCSingleStore\HCSingleStore.csproj", "{0D2542F5-DD62-4352-82D0-383D9A045E74}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.Build.0 = Release|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Release|Any CPU.ActiveCfg = Release|Any CPU
......@@ -35,22 +27,18 @@ Global
{513BC1C9-800D-43A6-9499-3700BAEC3554}.Debug|Any CPU.Build.0 = Debug|Any CPU
{513BC1C9-800D-43A6-9499-3700BAEC3554}.Release|Any CPU.ActiveCfg = Release|Any CPU
{513BC1C9-800D-43A6-9499-3700BAEC3554}.Release|Any CPU.Build.0 = Release|Any CPU
{F018462A-D9BC-4365-97F2-F6D71751641E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F018462A-D9BC-4365-97F2-F6D71751641E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F018462A-D9BC-4365-97F2-F6D71751641E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F018462A-D9BC-4365-97F2-F6D71751641E}.Release|Any CPU.Build.0 = Release|Any CPU
{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}.Debug|Any CPU.Build.0 = Debug|Any CPU
{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}.Release|Any CPU.ActiveCfg = Release|Any CPU
{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}.Release|Any CPU.Build.0 = Release|Any CPU
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Release|Any CPU.Build.0 = Release|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Release|Any CPU.Build.0 = Release|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
此文件类型无法预览
......@@ -14,93 +14,109 @@ namespace OnlineStore.Common
/// </summary>
public class HumitureController
{
public static bool IsRun = false;
public static string serialPort = "";
private static int bautRate = 4800;//波特率
private static Parity parity = Parity.None;//校验位
private static int dataBits = 8;//数据位
private static StopBits stopBits = StopBits.One; //停止位
private static AcSerialBean sb = null;
private static string LogName = "";
private static string LogName = "";
private static Dictionary<string, AcSerialBean> serialBeanMap = new Dictionary<string, AcSerialBean>();
public static int HumitureControllerType = ConfigAppSettings.GetIntValue(Setting_Init.HumitureControllerType);
public static bool Init(string port)
{
if (IsRun && port.Equals(serialPort))
if (serialBeanMap.ContainsKey(port))
{
return true;
}
else if (IsRun)
{
Release();
}
LogName = "温湿度传感器[" + port + "]";
if (sb == null)
LogName = "温湿度传感器[" + port + "]";
AcSerialBean sb = null;
if (HumitureControllerType.Equals(1))
{
serialPort = port;
if (HumitureControllerType.Equals(1))
{
bautRate = 9600;//波特率
}
sb = new AcSerialBean(serialPort, bautRate, parity, dataBits, stopBits);
bautRate = 9600;//波特率
}
sb = new AcSerialBean(port, bautRate, parity, dataBits, stopBits);
try
{
if (sb.openPort())
{
IsRun = true;
serialBeanMap.Add(port, sb);
return true;
}
else
{
LogUtil.error( LogName + "串口打开失败!");
IsRun = false;
LogUtil.error(LogName + "串口" + port + "打开失败!");
return false;
}
}
catch (Exception ex)
{
IsRun = false;
LogUtil.error("串口" + port + "打开失败:" + ex.ToString());
}
return true;
}
/// <summary>
/// 释放资源
/// </summary>
public static void Release()
public static void CloseAllPort()
{
List<string> kes = new List<string>(serialBeanMap.Keys);
foreach (string key in kes)
{
ClosePort(key);
}
}
public static void ClosePort(string portName)
{
if (sb != null)
AcSerialBean bean = GetSerialBean(portName);
if (bean == null)
{
sb.closePort();
LogUtil.info("串口【" + portName + "】未打开,不需要关闭");
return;
}
IsRun = false;
//清理缓存
bean.clearInBuffer();
bean.clearOutBuffer();
bean.closePort();
if (serialBeanMap.ContainsKey(portName))
{
serialBeanMap.Remove(portName);
}
LogUtil.info("温湿度控制器 关闭串口【" + portName + "】 ");
}
private static AcSerialBean GetSerialBean(string portName)
{
if (serialBeanMap.ContainsKey(portName))
{
return serialBeanMap[portName];
}
return null;
}
public static ASTemperateParam LastData = new ASTemperateParam(0, 0);
public static ASTemperateParam QueryData()
// public static ASTemperateParam LastData = new ASTemperateParam(0, 0);
public static HumitureParam QueryData(string port)
{
ASTemperateParam param = new ASTemperateParam(0, 0);
List<double> data = queryData();
HumitureParam param = new HumitureParam(0, 0);
List<double> data = queryData(port);
if (data.Count.Equals(2))
{
param = new ASTemperateParam(data[1], data[0]);
param = new HumitureParam(data[1], data[0]);
}
LastData = param;
return param;
}
/// <summary>
/// 返回温度和湿度
/// </summary>
/// <returns></returns>
private static List<double> queryData()
private static List<double> queryData(string port)
{
// 温度计算:
//当温度低于 0 ℃ 时温度数据以补码的形式上传。
//温度:FF9B H(十六进制)= -101 => 温度 = -10.1℃
//湿度计算:
//湿度:292 H(十六进制) = 658 => 湿度 = 65.8 % RH
if (IsRun.Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null)
{
return new List<double>();
}
......@@ -108,7 +124,7 @@ namespace OnlineStore.Common
sendData[0] = 0x01;
if (HumitureControllerType.Equals(1))
{
sendData[1] = 0x04;
sendData[1] = 0x04;
}
else
{
......@@ -129,10 +145,11 @@ namespace OnlineStore.Common
return getReviceData(reviceData);
}
public static int QueryHistoryCount()
public static int QueryHistoryCount(string port)
{
if (IsRun.Equals(false) || HumitureControllerType.Equals(2).Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null || HumitureControllerType.Equals(2).Equals(false))
{
return -1;
}
......@@ -164,9 +181,10 @@ namespace OnlineStore.Common
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
return getReviceIntData(reviceData);
}
public static int QueryCurrCount()
public static int QueryCurrCount(string port)
{
if (IsRun.Equals(false) || HumitureControllerType.Equals(2).Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null || HumitureControllerType.Equals(2).Equals(false))
{
return -1;
}
......@@ -187,10 +205,11 @@ namespace OnlineStore.Common
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
return getReviceIntData(reviceData);
}
public static List<object> QueryHistory()
public static List<object> QueryHistory(string port)
{
List<object> list = new List<object>();
if (IsRun.Equals(false)||HumitureControllerType.Equals(2).Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null || HumitureControllerType.Equals(2).Equals(false))
{
return list;
}
......@@ -240,7 +259,7 @@ namespace OnlineStore.Common
return list;
}
private static byte[] buildCheckData(byte[] sendData, int length)
{
ushort pChecksum = 0;
......@@ -257,7 +276,7 @@ namespace OnlineStore.Common
{
sendData[length + 1] = checkByte[0];
sendData[length] = checkByte[1];
}
}
return sendData;
}
......@@ -272,7 +291,7 @@ namespace OnlineStore.Common
}
if (dataArray.Length >= 9)
{
string data = String.Format("{0:X2}", dataArray[5]) + String.Format("{0:X2}", dataArray[6]+String.Format("{0:X2}", dataArray[3]) + String.Format("{0:X2}", dataArray[4]) );
string data = String.Format("{0:X2}", dataArray[5]) + String.Format("{0:X2}", dataArray[6] + String.Format("{0:X2}", dataArray[3]) + String.Format("{0:X2}", dataArray[4]));
int tempV = Convert.ToInt32(data, 16);
return tempV;
}
......@@ -286,7 +305,7 @@ namespace OnlineStore.Common
private static List<double> getReviceData(byte[] dataArray)
{
List<double> list = new List<double>();
List<double> list = new List<double>();
try
{
if (dataArray == null)
......@@ -296,10 +315,10 @@ namespace OnlineStore.Common
if (dataArray.Length >= 9)
{
string temp = String.Format("{0:X2}", dataArray[3])+ String.Format("{0:X2}", dataArray[4]);
string temp = String.Format("{0:X2}", dataArray[3]) + String.Format("{0:X2}", dataArray[4]);
string hum = String.Format("{0:X2}", dataArray[5]) + String.Format("{0:X2}", dataArray[6]);
double tempV = (double)Convert.ToInt32(temp, 16)/10;
double humV =(double) Convert.ToInt32(hum, 16)/10;
double tempV = (double)Convert.ToInt32(temp, 16) / 10;
double humV = (double)Convert.ToInt32(hum, 16) / 10;
list.Add(tempV);
list.Add(humV);
}
......@@ -310,6 +329,6 @@ namespace OnlineStore.Common
}
return list;
}
}
}
......@@ -19,28 +19,28 @@ namespace OnlineStore.Common
/// <summary>
/// 最后一次接受到的温度信息,key=温湿度传感器IP地址
/// </summary>
public static Dictionary<string, ASTemperateParam> TemperateParamMap = new Dictionary<string, ASTemperateParam>();
public static Dictionary<string, HumitureParam> TemperateParamMap = new Dictionary<string, HumitureParam>();
/// <summary>
/// 根据IP 地址获得最后一次取到的温湿度
/// </summary>
public static ASTemperateParam GetTemperateParam(string ipAddr)
public static HumitureParam GetTemperateParam(string ipAddr)
{
ASTemperateParam temperate = null;
HumitureParam temperate = null;
TemperateParamMap.TryGetValue(ipAddr, out temperate);
return temperate;
}
/// <summary>
/// 显示用的温湿度信息(改为计算平均温湿度)
/// </summary>
public static ASTemperateParam GetTemperateParam(List<string> ipAddrList)
public static HumitureParam GetTemperateParam(List<string> ipAddrList)
{
ASTemperateParam temperate = null;
HumitureParam temperate = null;
int allCount = 0;
double wenDu = 0;
double shiDu = 0;
foreach (string addr in ipAddrList)
{
ASTemperateParam param = GetTemperateParam(addr);
HumitureParam param = GetTemperateParam(addr);
if (param != null && param.IsValid())
{
allCount++;
......@@ -52,7 +52,7 @@ namespace OnlineStore.Common
{
double avgWendu = Math.Round(wenDu / allCount, 1);
double avgShidu = Math.Round(shiDu / allCount, 1);
temperate = new ASTemperateParam(avgWendu, avgShidu);
temperate = new HumitureParam(avgWendu, avgShidu);
}
return temperate;
}
......@@ -61,7 +61,7 @@ namespace OnlineStore.Common
double maxValue = 0;
foreach (string addr in ipAddrList)
{
ASTemperateParam param = GetTemperateParam(addr);
HumitureParam param = GetTemperateParam(addr);
if (param != null && param.IsValid())
{
if (param.Humidity > maxValue)
......@@ -140,7 +140,7 @@ namespace OnlineStore.Common
else
{
double newShiDu = GetRandomSD();
ASTemperateParam ast = new ASTemperateParam(add, deviceId, pwd, wendu, newShiDu, DateTime.Now);
HumitureParam ast = new HumitureParam(add, deviceId, pwd, wendu, newShiDu, DateTime.Now);
if (TemperateParamMap.ContainsKey(add))
{
TemperateParamMap.Remove(add);
......@@ -164,7 +164,7 @@ namespace OnlineStore.Common
{
double newShiDu = GetRandomSD();
double newWenDu = GetRandomWD();
ASTemperateParam ast = new ASTemperateParam(IP, "", "", newWenDu, newShiDu, DateTime.Now);
HumitureParam ast = new HumitureParam(IP, "", "", newWenDu, newShiDu, DateTime.Now);
if (TemperateParamMap.ContainsKey(IP))
{
TemperateParamMap.Remove(IP);
......@@ -212,9 +212,9 @@ namespace OnlineStore.Common
/// <summary>
/// 奥松温湿度上传参数
/// </summary>
public class ASTemperateParam
public class HumitureParam
{
public ASTemperateParam(string clientipe, string add, string pwd, double wendu, double shidu, DateTime updateTime)
public HumitureParam(string clientipe, string add, string pwd, double wendu, double shidu, DateTime updateTime)
{
this.IpAddress = clientipe;
this.DeviceAddress = add;
......@@ -224,7 +224,7 @@ namespace OnlineStore.Common
this.UpdateTime = updateTime;
}
//获取平均值时使用此 参数,只做显示用
public ASTemperateParam(double wendu, double shidu)
public HumitureParam(double wendu, double shidu)
{
this.IpAddress = "";
this.DeviceAddress = "";
......
......@@ -13,13 +13,14 @@ namespace OnlineStore.DeviceLibrary
public bool IsShowMsg = false;
public static AxisManager instance;
public void Init()
public static bool UseHCBoard = true;
public static void Init()
{
bool UseHCBoard = ConfigAppSettings.GetIntValue(Setting_Init.UseHCBoard).Equals(1);
UseHCBoard = ConfigAppSettings.GetIntValue(Setting_Init.UseHCBoard).Equals(1);
if (UseHCBoard)
{
//instance = new HCAxisManager();
instance = new HCAxisManager();
}
else
{
......@@ -27,38 +28,37 @@ namespace OnlineStore.DeviceLibrary
}
}
#region 485通信方法
public abstract bool OpenPort(string portName);
public abstract void ColsePort(string portName);
public abstract void CloseAllPort();
public abstract bool ServerOnStatus(string portName, short slvAddr);
public abstract void ClearSpeed();
public abstract void InitSlvAddr(string portName, short slvAddr, int targetSpeed, int addSpeed, int delSpeed);
public abstract bool IsHomeMoveEnd(string portName, short slvAddr);
public abstract void ServoOn(string portName, short slvAddr);
public abstract void ServoOff(string portName, short slvAddr);
public abstract void InitSlvAddr(string portName, short slvAddr);
public abstract bool IsServeoOn(string portName, short slvAddr);
public abstract void InitSlvAddr(string portName, short slvAddr, int targetSpeed, int addSpeed, int delSpeed);
#endregion
public abstract void RelMove(string portName, short slvAddr, int position, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0);
public abstract bool IsHomeMoveEnd(string portName, short slvAddr);
public abstract bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError);
public abstract void ServoOn(string portName, short slvAddr);
public abstract void ServoOff(string portName, short slvAddr);
public abstract void RelMove(string portName, short slvAddr, int position, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0);
public abstract void HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc);
public abstract void HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc);
public abstract void SpeedMove(string portName, short slvAddr, int speed);
public abstract void SpeedMove(string portName, short slvAddr, int speed);
public abstract void SuddenStop(string portName, short slvAddr);
public abstract bool isInPosition(ConfigMoveAxis Axis, int PPosition, bool isLog = false);
public abstract bool isInPosition(string portName, short slvAddr, int PPosition, int canErrorCount, bool isLog = false);
public abstract void AbsMove(string portName, short slvAddr, int targetPosition, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0);
public abstract void AbsMove(string portName, short slvAddr, int targetPosition, int targetSpeed=0 , int ptpAcc=0, int ptpDec=0);
public abstract void AlarmClear(string portName, short slvAddr);
public abstract int GetTargetPosition(string portName, short slvAddr);
public abstract int GetActualtPosition(string portName, short slvAddr);
public abstract int GetActualtPosition(string portName, short slvAddr);
public abstract int GetAlarmStatus(string portName, short slvAddr);
public abstract int GetBusyStatus(string portName, short slvAddr);
......@@ -70,11 +70,11 @@ namespace OnlineStore.DeviceLibrary
/// 负极限
/// </summary>
public abstract int GetLimitNegativeSingle(string portName, short slvAddr);
/// <summary>
/// 正极限
/// </summary>
public abstract int GetLimitPositiveSingle(string portName, short slvAddr);
}
}
......@@ -19,7 +19,10 @@ namespace OnlineStore.DeviceLibrary
{
HCBoardManager.ClearAxisSts((short)slvAddr);
}
public override bool OpenPort(string portName)
{
return true;
}
public override void ClearSpeed()
{
}
......@@ -32,7 +35,11 @@ namespace OnlineStore.DeviceLibrary
{
}
public override void InitSlvAddr(string portName, short slvAddr, int targetSpeed, int addSpeed, int delSpeed)
{
}
public override int GetActualtPosition(string portName, short slvAddr)
{
......@@ -66,9 +73,7 @@ namespace OnlineStore.DeviceLibrary
{
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
return axisS.NEL;
}
}
public override int GetLimitPositiveSingle(string portName, short slvAddr)
{
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
......@@ -83,38 +88,22 @@ namespace OnlineStore.DeviceLibrary
public override void HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc)
{
HCBoardManager.StartHomeMove(slvAddr,(uint) highVel, (uint)lowVel, (uint)acc);
}
public override void InitSlvAddr(string portName, short slvAddr)
{
}
public override void InitSlvAddr(string portName, short slvAddr, int targetSpeed, int addSpeed, int delSpeed)
{
}
}
public override bool IsHomeMoveEnd(string portName, short slvAddr)
{
return HCBoardManager.HomeingIsEnd(slvAddr);
}
public override bool isInPosition(ConfigMoveAxis Axis, int PPosition, bool isLog = false)
{
return HCBoardManager.IsInPosition(Axis.GetAxisValue(), PPosition,Axis .CanErrorCountMax);
}
public override bool OpenPort(string portName)
public override bool isInPosition(string portName, short slvAddr, int PPosition, int canErrorCount, bool isLog = false)
{
return true;
}
return HCBoardManager.IsInPosition(slvAddr, PPosition,canErrorCount );
}
public override void RelMove(string portName, short slvAddr, int position, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0)
{
HCBoardManager.RelMove(slvAddr, position, targetSpeed, ptpAcc, ptpDec);
}
public override bool ServerOnStatus(string portName, short slvAddr)
public override bool IsServeoOn(string portName, short slvAddr)
{
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
return axisS.ServoOn.Equals(1);
......@@ -138,5 +127,19 @@ namespace OnlineStore.DeviceLibrary
{
HCBoardManager.AxisStop(slvAddr);
}
public override bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError)
{
countError = false;
bool isOk = HCBoardManager.MoveIsEnd(axisNo);
if (HCBoardManager.IsInPosition(axisNo, targetPosition, canErrorCount))
{
return true;
}
else
{
countError = true;
}
return false;
}
}
}
......@@ -141,7 +141,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 是否成功打开伺服
/// </summary>
public override bool ServerOnStatus(string portName, short slvAddr)
public override bool IsServeoOn(string portName, short slvAddr)
{
if (!serialBeanMap.ContainsKey(portName))
{
......@@ -167,11 +167,7 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
public override void InitSlvAddr(string portName, short slvAddr)
{
InitSlvAddr(portName, slvAddr, 100, 30, 30);
//InitSlvAddr(portName, slvAddr, 100, 30, 30, 100, 50, 30);
}
//把数字转换为四位的字符串
public string SpeedToStr(int speed, int length)
{
......@@ -411,15 +407,16 @@ namespace OnlineStore.DeviceLibrary
OpenAndCloseSTB(portName, slvAddr);
}
public override bool isInPosition(ConfigMoveAxis Axis, int PPosition, bool isLog = false)
public override bool isInPosition(string portName, short slvAddr, int PPosition, int canErrorCount,bool isLog = false)
{
int outCount = GetActualtPosition(Axis.DeviceName, Axis.GetAxisValue());
string Name = "轴【" + portName + "_" + slvAddr + "】";
int outCount = GetActualtPosition(portName, slvAddr);
int errorCount = Math.Abs(outCount - PPosition);
if (errorCount <= Axis.CanErrorCountMin)
if (errorCount <= canErrorCount)
{
if (isLog)
{
LogUtil.info("【" + Axis.GetNameStr() + "】isInPosition【" + PPosition + "】,当前实时位置:【" + outCount + "】 return true");
LogUtil.info("【" + Name + "】isInPosition【" + PPosition + "】,当前实时位置:【" + outCount + "】 return true");
}
return true;
}
......@@ -427,7 +424,7 @@ namespace OnlineStore.DeviceLibrary
{
if (isLog)
{
LogUtil.info("【" + Axis.GetNameStr() + "】isInPosition【" + PPosition + "】,当前实时位置:【" + outCount + "】 return false");
LogUtil.info("【" + Name + "】isInPosition【" + PPosition + "】,当前实时位置:【" + outCount + "】 return false");
}
return false;
}
......@@ -497,5 +494,24 @@ namespace OnlineStore.DeviceLibrary
//Thread.Sleep(SleepMSendons);
OpenAndCloseSTB(portName, slvAddr);
}
public override bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError)
{
countError = false;
bool isOk = AxisManager.instance.GetBusyStatus(portName, axisNo).Equals(0);
int CurrPosition = AxisManager.instance.GetActualtPosition(portName, axisNo);
int errorCount = Math.Abs(CurrPosition - targetPosition);
if (isOk)
{
if (errorCount <= canErrorCount)
{
return true;
}
else
{
countError = true;
}
}
return false;
}
}
}
......@@ -13,8 +13,7 @@ namespace OnlineStore.DeviceLibrary
partial class ACServerManager
{
private Dictionary<int, Dictionary<string, RegisterInfo>> LastDataMap = new Dictionary<int, Dictionary<string, RegisterInfo>>();
//private SerialBean bean = null;
private string strFromat = "{0:X2}";
private Dictionary<string, AcSerialBean> serialBeanMap = new Dictionary<string, AcSerialBean>();
......@@ -467,6 +466,7 @@ namespace OnlineStore.DeviceLibrary
byte[] reviceData = SendCommand(portName, dataArray, ReviceOutTimeMS, 6);
return GetCoilData(portName, reviceData, ACCMDManager.Home_Single);
}
}
/// <summary>
/// 记录最后一次获得的寄存器的值
......
......@@ -57,6 +57,7 @@
<Compile Include="acSingleStore\BoxBean.cs" />
<Compile Include="acSingleStore\BoxBean_Inventory.cs" />
<Compile Include="acSingleStore\BoxBean_Partial.cs" />
<Compile Include="acSingleStore\HumitureBean.cs" />
<Compile Include="acSingleStore\StoreBean.cs" />
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="AXIS\AxisManager.cs" />
......
......@@ -343,7 +343,9 @@ namespace OnlineStore.DeviceLibrary
}
private void SI_05_DeviceToDoor()
{
if (!AxisManager.instance.isInPosition(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1,true))
ConfigMoveAxis updown = Config.UpDown_Axis;
if (!AxisManager.instance.isInPosition(updown.DeviceName, updown.GetAxisValue(), MoveInfo.MoveParam.MoveP.UpDown_P1, updown.CanErrorCountMax,true))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
......@@ -351,7 +353,8 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
return;
}
if (!AxisManager.instance.isInPosition(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P1))
ConfigMoveAxis middle = Config.Middle_Axis;
if (!AxisManager.instance.isInPosition(middle.DeviceName, middle.GetAxisValue(), MoveInfo.MoveParam.MoveP.Middle_P1, middle.CanErrorCountMax, true))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
......@@ -395,7 +398,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsTimeOut(10))
{
WarnMsg = Name + "入库 等待料仓门口检测到料盘 [" + MoveInfo.MoveParam.PosInfo.barcode + "] [" + MoveInfo.MoveParam.PosInfo.PosId + "] 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒 ";
LogUtil.error( WarnMsg, 100);
LogUtil.error(WarnMsg, 100);
Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnMsg, MoveInfo.MoveType);
//InStoreLog(" 入库:SI_00 入库等待仓门口料盘信号");
......@@ -428,7 +431,8 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
if (!AxisManager.instance.isInPosition(Config.UpDown_Axis, moveP.UpDown_P1))
ConfigMoveAxis updown = Config.UpDown_Axis;
if (!AxisManager.instance.isInPosition(updown.DeviceName, updown.GetAxisValue(), moveP.UpDown_P1, updown.CanErrorCountMax))
{
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
}
......@@ -436,7 +440,8 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("入库:SI_03 升降轴已在P1[" + moveP.UpDown_P1 + "]");
}
if (!AxisManager.instance.isInPosition(Config.Middle_Axis, moveP.Middle_P1))
ConfigMoveAxis middle = Config.Middle_Axis;
if (!AxisManager.instance.isInPosition(middle.DeviceName, middle.GetAxisValue(), moveP.Middle_P1, middle.GetAxisValue()))
{
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
......@@ -477,14 +482,14 @@ namespace OnlineStore.DeviceLibrary
CodeMsg = "入库[" + posId + "]叉子取料后退后,未检测到料叉有料";
LogUtil.error(CodeMsg);
}
InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点)[" + moveP.Middle_P2 + "], 升降轴至P3(库位入库前点)[" + moveP.UpDown_P3 + "] ");
MoveInfo.NextMoveStep(StoreMoveStep.SI_09_MoveToBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
CloseDoor(false);
InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点)[" + moveP.Middle_P2 + "], 升降轴至P3(库位入库前点)[" + moveP.UpDown_P3 + "] ");
MoveInfo.NextMoveStep(StoreMoveStep.SI_09_MoveToBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
CloseDoor(false);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_08_LocationCylinder_Up)
{
......@@ -499,11 +504,9 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_09_MoveToBag)
{
InStoreLog("入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) [" + moveP.InOut_P3 + "]");
MoveInfo.NextMoveStep(StoreMoveStep.SI_11_DeviceToBag);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
InStoreLog("入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) [" + moveP.InOut_P3 + "]");
MoveInfo.NextMoveStep(StoreMoveStep.SI_11_DeviceToBag);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_10_LocationCylinder_Down)
{
......@@ -554,7 +557,7 @@ namespace OnlineStore.DeviceLibrary
{
TimeSpan span = DateTime.Now - startInStoreTime;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosInfo.PosId : "";
LogUtil.info( Name + " 【" + posId + "】 整个入库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!" );
LogUtil.info(Name + " 【" + posId + "】 整个入库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
//设备连接,入库后,BOX恢复原始状态
......@@ -563,7 +566,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.info( Name + " 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
LogUtil.info(Name + " 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
}
}
......
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class HumitureBean
{
private string PortName = "";
private string Name = "";
public HumitureParam LastData = new HumitureParam(0, 0);
internal HumitureBean(string port, string deviceName)
{
this.Name = deviceName;
this.PortName = port;
}
public HumitureParam QueryData()
{
HumitureParam param = HumitureController.QueryData(PortName);
LastData = param;
return LastData;
}
internal void ProcessHumidityCMD(Operation resultOperation)
{
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.maxHumidity) && data.ContainsKey(ParamDefine.maxTemperature))
{
string maxHumidity = data[ParamDefine.maxHumidity];
string maxTemp = data[ParamDefine.maxTemperature];
LogUtil.info(Name + "收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
try
{
this.Max_Humidity = (float)Convert.ToDouble(maxHumidity);
this.Max_Temperature = (float)Convert.ToDouble(maxTemp);
LogUtil.info(Name + "保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
}
catch (Exception ex)
{
LogUtil.error(Name + "转换温湿度失败:" + ex.ToString());
}
}
}
#region 温湿度处理
/// <summary>
/// 湿度标准,超过后需要报警
/// </summary>
private float Max_Humidity = 0;
/// <summary>
/// 温度标准,超过后需要报警
/// </summary>
private float Max_Temperature = 0;
private bool IsInBlowing = false;
private DateTime LastBeginBlowTime = DateTime.Now;
private DateTime LastEndBlowTime = new DateTime(1997, 1, 1);
private DateTime preLogTime = DateTime.Now;
public bool TempOrHumidityIsAlarm = false;
public DateTime TempAlarmTime = DateTime.Now;
private float StartBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StartBlowValue);
private float StopBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StopBlowValue);
public string currTempStr = "";
internal void HumidityProcess(BoxBean box)
{
try
{
if ((DateTime.Now - preLogTime).TotalSeconds > (8 + box.DeviceID))
{
preLogTime = DateTime.Now;
//用最大的湿度判断是否需要吹气,开始吹气的值=发过来的值-4
//温湿度
//ASTemperateParam param = HumitureServer.GetTemperateParam(Config.GetTempAddrList());
HumitureParam param = QueryData();
double humidity = 0;
double temp = 0;
if (param != null)
{
humidity = param.Humidity;
temp = param.Temperate;
currTempStr = Name + ("湿度:" + humidity.ToString() + ",温度:" + temp);
}
//double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
double currMaxHumidity = param.Humidity;
float startBlowHumidity = Max_Humidity - StartBlowValue;
float stopBlowHumidity = Max_Humidity - StopBlowValue;
////判断是否需要吹气
//if (startBlowHumidity > 0 && startBlowHumidity < currMaxHumidity && IsInBlowing.Equals(false))
//{
// //判断是否距离上次结束指定的时间
// TimeSpan span = DateTime.Now - LastEndBlowTime;
// if (span.TotalMinutes > box.Config.BlowAir_Interval)
// {
// LogUtil.info(Name + "当前最大湿度:" + currMaxHumidity.ToString() + ",开始吹气湿度:" + startBlowHumidity + ",当前不在吹气中,且间隔超过" + box.Config.BlowAir_Interval + "分钟,开始吹气!");
// IsInBlowing = true;
// //Thread.Sleep(100);
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.HIGH);
// LastBeginBlowTime = DateTime.Now;
// LastEndBlowTime = DateTime.Now;
// }
//}
//if (IsInBlowing && stopBlowHumidity > currMaxHumidity)
//{
// LogUtil.info(Name + "当前最大湿度:" + currMaxHumidity.ToString() + ",停止吹气湿度:" + stopBlowHumidity + ",停止吹气!");
// IsInBlowing = false;
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// LastEndBlowTime = DateTime.Now;
//}
//if (IsInBlowing)
//{
// //判断是否需要结束吹气
// TimeSpan span = DateTime.Now - LastBeginBlowTime;
// if (span.TotalMinutes > box.Config.BlowAir_Time)
// {
// LogUtil.info(Name + "已经吹气" + span.TotalMinutes + "分钟,超过配置的吹气时间" + box.Config.BlowAir_Time + "分钟,停止吹气!");
// IsInBlowing = false;
// //Thread.Sleep(100);
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// LastEndBlowTime = DateTime.Now;
// }
//}
bool needAlarm = false;
//如果开始吹气并且当前达到报警值
if (IsInBlowing && humidity > Max_Humidity)
{
needAlarm = true;
}
else if (temp > Max_Temperature && Max_Temperature > 0)
{
LogUtil.info(Name + "当前温度【" + param.Temperate + "】超过最高温度【" + Max_Temperature + "】,开始报警!");
needAlarm = true;
//box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
else if (temp < Max_Temperature)
{
if (IsInBlowing.Equals(false) && TempOrHumidityIsAlarm)
{
LogUtil.info(Name + "不在吹气中,且当前温度【" + param.Temperate + "】低于【" + Max_Temperature + "】,关闭报警!");
TempOrHumidityIsAlarm = false;
//box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
}
else
{
TempOrHumidityIsAlarm = false;
}
if (needAlarm)
{
HTAlarm();
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "HumidityProcess出错:" + ex.ToString());
}
}
private void HTAlarm()
{
if (TempOrHumidityIsAlarm)
{
return;
}
TempAlarmTime = DateTime.Now;
TempOrHumidityIsAlarm = true;
}
internal bool NeedGetTem()
{
if (Max_Humidity <= 0 || (Max_Temperature <= 0))
{
return true;
}
return false;
}
#endregion
}
}
......@@ -13,15 +13,9 @@ using System.Threading.Tasks;
using System.Timers;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 流水线自动料仓-流水线类
/// </summary>
{
public partial class StoreBean : KTK_Store
{
/// <summary>
/// 灯闪烁定时器
/// </summary>
{
private System.Timers.Timer ledProcessTimer = null;
public Dictionary<int, BoxConfig> BoxConfigMap { get; set; }
......@@ -49,25 +43,20 @@ namespace OnlineStore.DeviceLibrary
List<string> ioList = new List<string>();
IOManager.Init();
//AddDeviceName(ioList, Config.DIODeviceNameList);
AxisManager.Init();
foreach (BoxConfig config in configList.Values)
{
BoxBean equip = new BoxBean(config);
//增加站号名称
//AddDeviceName(ioList, config.DIODeviceNameList);
BoxMap.Add(config.DeviceID, equip);
BoxConfigMap.Add(config.DeviceID, config);
}
//先初始化设备
//先初始化设备
Task.Factory.StartNew(delegate
{
// RFIDManager.RfidReader.Open(rfidList.ToArray());
{
IOManager.instance.ConnectionIOList(ioList);
addLastDI(IO_Type.Airpressure_Check, IOValue(IO_Type.Airpressure_Check));
addLastDI(IO_Type.SuddenStop_BTN, IOValue(IO_Type.SuddenStop_BTN));
......@@ -76,21 +65,10 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
mainTimer.Enabled = true;
canStart = true;
canStart = true;
});
}
private void AddDeviceName(List<string> targetList, List<string> list)
{
foreach (string str in list)
{
if (!targetList.Contains(str))
{
targetList.Add(str);
}
}
}
public void InitTimer()
{
ledProcessTimer = new System.Timers.Timer();
......
......@@ -4,6 +4,7 @@ using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO.IsolatedStorage;
using System.Linq;
using System.Text;
using System.Threading;
......@@ -26,7 +27,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 提示消息,一般发给服务器后清空(LineBean表示报警提示消息,BoxBean表示出入库失败的原因记录)
/// </summary>
public string WarnMsg = "";
public string WarnMsg = "";
public string Name { get; set; }
public int DeviceID { get; set; }
......@@ -42,18 +43,18 @@ namespace OnlineStore.DeviceLibrary
private bool isInit = false;
public bool IsDebug = false;
public bool IsDebug = false;
public StoreMoveInfo MoveInfo = null;
public KTK_Store()
{
}
}
public DateTime StartTime { get; set; }
public DateTime lastAirCloseTime = DateTime.Now;
public bool isInSuddenDown = false;
public bool isNoAirCheck = false;
public StoreAlarmType alarmType = StoreAlarmType.None;
public DateTime lastAirCloseTime = DateTime.Now;
public bool isInSuddenDown = false;
public bool isNoAirCheck = false;
public StoreAlarmType alarmType = StoreAlarmType.None;
public AlarmInfo alarmInfo = new AlarmInfo();
/// <summary>
......@@ -82,7 +83,7 @@ namespace OnlineStore.DeviceLibrary
}
}
public TimeSpan GetStoreRunTime()
{
if (StartTime != null)
......@@ -93,7 +94,7 @@ namespace OnlineStore.DeviceLibrary
{
return new TimeSpan(0);
}
}
}
protected bool isInPro = false;
protected virtual void BusyMoveProcess()
{
......@@ -114,10 +115,7 @@ namespace OnlineStore.DeviceLibrary
OutStoreProcess();
isInPro = false;
break;
case StoreMoveType.ReturnHome:
ReturnHomeProcess();
isInPro = false;
break;
case StoreMoveType.ReturnHome:
case StoreMoveType.StoreReset:
ResetProcess();
isInPro = false;
......@@ -197,7 +195,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 停止所有运动
/// </summary>
public abstract void StopMove( );
public abstract void StopMove();
/// <summary>
/// 重置处理
......@@ -208,65 +206,41 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
protected virtual void InventoryProcess()
{
}
/// <summary>
/// 原点返回处理
/// </summary>
protected virtual void ReturnHomeProcess() { }
}
/// <summary>
/// 松下伺服轴原点返回运动,等待收到反馈后才会返回
/// </summary>
protected void ACAxisHomeMove(ConfigMoveAxis moveAxis)
{
moveAxis.TargetPosition = 0;
LogUtil.info( moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
AxisManager.instance.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed,moveAxis.HomeLowSpeed,moveAxis.HomeAddSpeed);
LogUtil.info(moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
AxisManager.instance.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed, moveAxis.HomeLowSpeed, moveAxis.HomeAddSpeed);
}
/// <summary>
/// 松下伺服电机运动
/// </summary>
protected void ACAxisMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, targetPosition, targetSpeed));
moveAxis.TargetPosition = targetPosition;
moveAxis.TargetPosition = targetPosition;
AxisManager.instance.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
}
/// <summary>
/// 判断AC伺服电机轴是否运动完成
/// </summary>
protected bool ACAxisMoveIsEnd(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed, out string msg)
{
msg = "";
string deviceName = moveAxis.DeviceName;
short axisNo = moveAxis.GetAxisValue();
//如果是进出轴,并且光栅被遮挡,直接返回false
//if (NeedCheckSafetyLight.Equals(2))
//{
// if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor) ||
// StoreMove.MoveStep.Equals(StoreMoveStep.SI_05_DeviceToDoor))
// {
// return false;
// }
//}
bool isOk = AxisManager.instance.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = AxisManager.instance.GetActualtPosition(deviceName, axisNo);
int errorCount = Math.Abs(outCount - targetPosition);
if (isOk)
bool countError = false;
bool IsOk = AxisManager.instance.AbsMoveIsEnd(deviceName, axisNo, targetPosition, moveAxis.CanErrorCountMax, out countError);
if (IsOk)
{
if (errorCount <= moveAxis.CanErrorCountMax)
{
return true;
}
return true;
}
if (countError)
{
int outCount = AxisManager.instance.GetActualtPosition(deviceName, axisNo);
//判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0)
{
LogUtil.error( moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
LogUtil.error(moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
AxisManager.instance.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
MoveInfo.CanWhileCount--;
......@@ -275,9 +249,9 @@ namespace OnlineStore.DeviceLibrary
{
msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount
+ "],误差过大,需要报警";
LogUtil.error( msg);
LogUtil.error(msg);
}
}
}
return false;
}
protected bool ACHomeMoveIsEnd(ConfigMoveAxis moveAxis, out string msg)
......
......@@ -122,10 +122,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
Wait = 0,
#region 料仓原点返回和重置步骤
/// <summary>
/// 料仓原点返回和重置步骤,,定位气缸下降
/// </summary>
BOX_H_LocationCylinderBack = 010,
///// <summary>
///// 料仓原点返回和重置步骤,,定位气缸下降
///// </summary>
//BOX_H_LocationCylinderBack = 010,
/// <summary>
/// 料仓原点返回和重置步骤,轴三先相对走3000
......
......@@ -39,6 +39,7 @@
<!--是否调试状态-->
<add key="IsInDebug" value="1" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key ="App_AutoRun" value ="0"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -17,16 +17,12 @@ namespace OnlineStore.ACSingleStore
{
public partial class FrmAxisDebug : FrmBase
{
//private KTK_LA_BoxBean store;
{
private ConfigMoveAxis middle = null;
private ConfigMoveAxis updown = null;
//private ConfigMoveAxis compress = null;
private ConfigMoveAxis updown = null;
private ConfigMoveAxis inout = null;
private ConfigMoveAxis comp = null;
//private int compress_Slv = 0;
private BoxBean boxBean;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private ConfigMoveAxis comp = null;
private BoxBean boxBean;
public FrmAxisDebug(BoxBean boxBean)
{
this.boxBean = boxBean;
......@@ -42,7 +38,7 @@ namespace OnlineStore.ACSingleStore
private void AxisMove(ConfigMoveAxis axis, int speed)
{
LogUtil.debug(LOGGER, "点动:deviceName=" + axis.DeviceName + ",axis=" + axis.GetAxisValue() + ",speed=" + speed);
LogUtil.debug( "点动:deviceName=" + axis.DeviceName + ",axis=" + axis.GetAxisValue() + ",speed=" + speed);
AxisManager.instance.SpeedMove(axis.DeviceName, axis.GetAxisValue(), speed);
}
......
......@@ -24,7 +24,7 @@ namespace OnlineStore.ACSingleStore
{
private int StoreId = 1;
private BoxBean boxBean;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmIOStatus()
{
Control.CheckForIllegalCrossThreadCalls = false;
......@@ -49,7 +49,7 @@ namespace OnlineStore.ACSingleStore
this.tableLayoutPanel1.RowCount = boxBean.Config.DIList.Count;
foreach (ConfigIO ioValue in boxBean.Config.DIList.Values)
{
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
this.tableLayoutPanel1.Controls.Add(control, 0, roleindex);
roleindex++;
......@@ -95,7 +95,7 @@ namespace OnlineStore.ACSingleStore
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace);
LogUtil.error( ex.StackTrace);
}
}
......@@ -185,33 +185,12 @@ namespace OnlineStore.ACSingleStore
boxBean.CloseDoor(false);
}
private void btnLocationUp_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.HIGH);
}
private void btnLocationDown_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
}
private void FrmIOStatus_Shown(object sender, EventArgs e)
{
timer1.Start();
}
private void btnOpenAxisBreak_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.HIGH);
}
private void btnCloseAxisBreak_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
......
......@@ -203,9 +203,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.logBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.logBox.Location = new System.Drawing.Point(241, 88);
this.logBox.Location = new System.Drawing.Point(241, 6);
this.logBox.Name = "logBox";
this.logBox.Size = new System.Drawing.Size(1085, 531);
this.logBox.Size = new System.Drawing.Size(1085, 613);
this.logBox.TabIndex = 106;
this.logBox.Text = "";
this.logBox.VisibleChanged += new System.EventHandler(this.logBox_VisibleChanged);
......@@ -257,54 +257,54 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
//
// 启动AToolStripMenuItem
//
this.启动AToolStripMenuItem.Name = "启动AToolStripMenuItem";
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启动AToolStripMenuItem.Text = "启动 ";
this.启动AToolStripMenuItem.Click += new System.EventHandler(this.启动所有料仓AToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
//
// 复位RToolStripMenuItem
//
this.复位RToolStripMenuItem.Name = "复位RToolStripMenuItem";
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复位RToolStripMenuItem.Text = "复位";
this.复位RToolStripMenuItem.Click += new System.EventHandler(this.复位RToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
//
// 停止TToolStripMenuItem
//
this.停止TToolStripMenuItem.Name = "停止TToolStripMenuItem";
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.停止TToolStripMenuItem.Text = "停止";
this.停止TToolStripMenuItem.Click += new System.EventHandler(this.停止所有料仓TToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Visible = false;
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click_1);
//
......@@ -399,19 +399,19 @@
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem3.Size = new System.Drawing.Size(144, 26);
this.toolStripMenuItem3.Text = "料仓配置";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator9.Size = new System.Drawing.Size(141, 6);
//
// 版本号ToolStripMenuItem
//
this.版本号ToolStripMenuItem.Name = "版本号ToolStripMenuItem";
this.版本号ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.版本号ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.版本号ToolStripMenuItem.Text = "关于软件";
this.版本号ToolStripMenuItem.Click += new System.EventHandler(this.版本号ToolStripMenuItem_Click);
//
......
......@@ -7,8 +7,8 @@
<ProjectGuid>{0D2542F5-DD62-4352-82D0-383D9A045E74}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.ACSingleStore</RootNamespace>
<AssemblyName>ACSingleStore</AssemblyName>
<RootNamespace>OnlineStore.HCSingleStore</RootNamespace>
<AssemblyName>HCSingleStore</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
......@@ -69,6 +69,10 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="UserFromControl, Version=1.0.7592.26798, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\UserFromControl.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="FormManager.cs" />
......@@ -207,10 +211,6 @@
<Project>{064bebf5-8faa-4ea2-a5f3-a06e6e7d9251}</Project>
<Name>LoadCSVLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\UserFromControl\UserFromControl.csproj">
<Project>{f018462a-d9bc-4365-97f2-f6d71751641e}</Project>
<Name>UserFromControl</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="AuToRunManager.exe">
......
......@@ -43,7 +43,7 @@ namespace OnlineStore.ACSingleStore
public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
public const int SW_RESTORE = 9;
public static IntPtr formhwnd;
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
......@@ -157,7 +157,7 @@ namespace OnlineStore.ACSingleStore
static void LogUnhandledException(object exceptionobj)
{
//这里可以进一步地写日志
LOGGER.Error(exceptionobj.ToString());
LogUtil.error(exceptionobj.ToString());
}
}
}
......@@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace OnlineStore.ACSingleStore.Properties {
namespace OnlineStore.HCSingleStore.Properties {
using System;
......@@ -19,7 +19,7 @@ namespace OnlineStore.ACSingleStore.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
......@@ -39,7 +39,7 @@ namespace OnlineStore.ACSingleStore.Properties {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OnlineStore.ACSingleStore.Properties.Resources", typeof(Resources).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OnlineStore.HCSingleStore.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
......
......@@ -8,11 +8,11 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace OnlineStore.ACSingleStore.Properties {
namespace OnlineStore.HCSingleStore.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......
......@@ -24,7 +24,7 @@ namespace OnlineStore.ACSingleStore
private short SlvAddr = 0;
private string IoIp = "";
private int IoIndex = 0;
public string Axis_Brake = IO_Type.Axis_Brake;
public string Axis_Brake = "";
private System.Timers.Timer toolTimer = new System.Timers.Timer();
private ConfigMoveAxis configAxis;
......@@ -89,7 +89,7 @@ namespace OnlineStore.ACSingleStore
SaveConfig(tSpeed, tPosition);
//判断伺服是否已经打开
bool isOn = AxisManager.instance.ServerOnStatus(PortName, SlvAddr);
bool isOn = AxisManager.instance.IsServeoOn(PortName, SlvAddr);
formStatus(isOn);
timer1.Start();
ioStatusControl1.IOName = ResourceCulture.GetString("检测信号");
......@@ -106,7 +106,7 @@ namespace OnlineStore.ACSingleStore
}
formStatus(true);
AxisManager.instance.InitSlvAddr(PortName, SlvAddr);
AxisManager.instance.InitSlvAddr(PortName, SlvAddr, configAxis.TargetSpeed, configAxis.AddSpeed, configAxis.DelSpeed);
Thread.Sleep(100);
AxisManager.instance.AlarmClear(PortName, SlvAddr);
AxisManager.instance.ServoOn(PortName, SlvAddr);
......
......@@ -184,7 +184,7 @@ namespace OnlineStore.AutoCountClient
this.txtHomeSingle.Text = AxisManager.instance.GetHomeSingle(PortName, SlvAddr).ToString();
this.txtLimit1.Text = AxisManager.instance.GetLimitPositiveSingle(PortName, SlvAddr).ToString();
this.txtLimit2.Text = AxisManager.instance.GetLimitNegativeSingle(PortName, SlvAddr).ToString();
txtServoStatue.Text = AxisManager.instance.ServerOnStatus(PortName, SlvAddr) ? "✔" : "✘";
txtServoStatue.Text = AxisManager.instance.IsServeoOn(PortName, SlvAddr) ? "✔" : "✘";
}
......
......@@ -199,15 +199,15 @@ namespace HuichuanLibrary
return false;
}
public static bool AbsMoveIsEnd(short axisNo, double targetPos)
public static bool MoveIsEnd(short axisNo )
{
AxisSts sts = GetAxisSts(axisNo);
if (sts.BUSY.Equals(0) && sts.INP.Equals(0))
{
if (IsInPosition(axisNo, targetPos))
{
return true;
}
//if (IsInPosition(axisNo, targetPos))
//{
return true;
//}
}
return false;
}
......
......@@ -209,7 +209,12 @@ namespace OnlineStore.LoadCSVLibrary
{
string[] newArray = array;
string proName = array[2];
string proValue = array[3];
string proValue = array[3];
if (proName.ToUpper().Contains(BaseConfig.IOIP_Str.ToUpper()))
{
index++;
continue;
}
try
{
PropertyInfo prop = props.First(c => c.Name == proName);//获取同名属性
......@@ -227,6 +232,10 @@ namespace OnlineStore.LoadCSVLibrary
{
newLine = newLine + s + ",";
}
if (newLine.EndsWith(","))
{
newLine = newLine.Substring(0, newLine.Length - 1);
}
newLines[index] = newLine;
}
}
......
......@@ -131,7 +131,7 @@ namespace OnlineStore.LoadCSVLibrary
SubDIList[io.SubType].Add(io.ProName, io);
}
if (!ioTypeList.Contains(con.ProName))
//if (!ioTypeList.Contains(con.ProName))
{
AddBuffer(con, builder);
}
......@@ -165,7 +165,7 @@ namespace OnlineStore.LoadCSVLibrary
{
SubDOList[io.SubType].Add(io.ProName, io);
}
if (!ioTypeList.Contains(con.ProName))
//if (!ioTypeList.Contains(con.ProName))
{
AddBuffer(con, builder);
}
......
......@@ -200,6 +200,11 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("CompAxis_P3_Speed")]
public int CompAxis_P3_Speed { get; set; }
/// <summary>
/// PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
/// </summary>
[ConfigProAttribute("Humiture_Port", true)]
public string Humiture_Port { get; set; }
/// <summary>
/// PRO 每次吹气的时间(分钟) BlowAir_Time 10
......
......@@ -26,104 +26,193 @@ namespace OnlineStore.LoadCSVLibrary
return TypeList;
}
/// <summary>
/// 料仓,DI 急停 SuddenStop_BTN X01 DI-01
///// <summary>
///// 料仓,DI 急停 SuddenStop_BTN X01 DI-01
///// </summary>
//public static string SuddenStop_BTN = "SuddenStop_BTN";
///// <summary>
///// 料仓 DI 复位 Reset_BTN X02 DI-02
///// </summary>
//public static string Reset_BTN = "Reset_BTN";
///// <summary>
///// DI,盘点,CheckPos,2,PRO_AOI_IP_1,0,盘点,X03,DI-03,0,
///// </summary>
//public static string CheckPos = "CheckPos";
///// <summary>
/////DI 自动运行 AutoRun_Signal
///// </summary>
//// public static string AutoRun_Signal = "AutoRun_Signal";
///// <summary>
///// 料仓DI。气压检测(料仓) Airpressure_Check
///// </summary>
//public static string Airpressure_Check = "Airpressure_Check";
///// <summary>
///// DI 料仓门口料盘检测 TrayCheck_1
///// </summary>
//public static string TrayCheck_Door = "TrayCheck_Door";
///// <summary>
///// DI 叉子料盘检测 TrayCheck_Fixture
///// </summary>
//public static string TrayCheck_Fixture = "TrayCheck_Fixture";
///// <summary>
///// 料仓IO。定位气缸上升端(料仓) LocationCylinder_Up
///// </summary>
//public static string LocationCylinder_Up = "LocationCylinder_Up";
///// <summary>
/////料仓IO。 定位气缸下降端(料仓) LocationCylinder_Down
///// </summary>
//public static string LocationCylinder_Down = "LocationCylinder_Down";
///// <summary>
///// 料仓IO。定位气缸上升端(料仓) LocationCylinder2_Up
///// </summary>
//public static string LocationCylinder2_Up = "LocationCylinder2_Up";
///// <summary>
/////料仓IO。 定位气缸下降端(料仓) LocationCylinder2_Down
///// </summary>
//public static string LocationCylinder2_Down = "LocationCylinder2_Down";
///// <summary>
///// 料仓DO 。料仓运转ON Run_Signal
///// </summary>
//public static string Run_Signal = "Run_Signal";
///// <summary>
///// 料仓DO 。料仓轴2刹车ON Axis_Brake
///// </summary>
//public static string Axis_Brake = "Axis_Brake";
///// <summary>
///// 料仓DO 。料仓吹气SOL ON StartOrStopBlow
///// </summary>
//public static string StartOrStopBlow = "StartOrStopBlow";
///// <summary>
///// DO 自动指示灯 AutoRun_HddLed
///// </summary>
//public static string AutoRun_HddLed = "AutoRun_HddLed";
///// <summary>
///// DO 待机指示灯 RunSign_HddLed
///// </summary>
//public static string RunSign_HddLed = "RunSign_HddLed";
///// <summary>
/////DO 故障指示灯 Alarm_HddLed
///// </summary>
//public static string Alarm_HddLed = "Alarm_HddLed";
///// <summary>
///// 吹气SOL Blow_Single
///// </summary>
//public static string Blow_Single = "Blow_Single";
///// <summary>
///// 进出料口门上升端 Door_Up
///// </summary>
//public static string Door_Up = "Door_Up";
///// <summary>
///// 进出料口门下降端 Door_Down
///// </summary>
//public static string Door_Down = "Door_Down";
//public static string DoorLimit = "DoorLimit";
///// <summary>
///// DO,0,报警蜂鸣器,Alarm_Buzzer,3,HC,Y04,
///// </summary>
//public static string Alarm_Buzzer = "Alarm_Buzzer";
///// <summary>
///// DO,0,设备照明ON,Device_Led,8,HC,Y09,
///// </summary>
//public static string Device_Led = "Device_Led";
/// <summary>
/// DI,0,急停,SuddenStop_BTN,0,HC,X00,
/// </summary>
public static string SuddenStop_BTN = "SuddenStop_BTN";
/// <summary>
/// 料仓 DI 复位 Reset_BTN X02 DI-02
/// DI,0,复位,Reset_BTN,1,HC,X01,
/// </summary>
public static string Reset_BTN = "Reset_BTN";
/// <summary>
/// DI,盘点,CheckPos,2,PRO_AOI_IP_1,0,盘点,X03,DI-03,0,
/// </summary>
public static string CheckPos = "CheckPos";
/// <summary>
///DI 自动运行 AutoRun_Signal
/// </summary>
// public static string AutoRun_Signal = "AutoRun_Signal";
/// <summary>
/// 料仓DI。气压检测(料仓) Airpressure_Check
/// DI,0,气压检测,Airpressure_Check,2,HC,X02,
/// </summary>
public static string Airpressure_Check = "Airpressure_Check";
/// <summary>
/// DI 料仓门口料盘检测 TrayCheck_1
/// DI,1,左料仓进料口料盘检测,TrayCheck_Door,3,HC,X03,
/// </summary>
public static string TrayCheck_Door = "TrayCheck_Door";
/// <summary>
/// DI 叉子料盘检测 TrayCheck_Fixture
/// </summary>
public static string TrayCheck_Fixture = "TrayCheck_Fixture";
/// <summary>
/// 料仓IO。定位气缸上升端(料仓) LocationCylinder_Up
/// DI,1,左料仓料叉料盘检测,TrayCheck_Fixture,4,HC,X04,
/// </summary>
public static string LocationCylinder_Up = "LocationCylinder_Up";
/// <summary>
///料仓IO。 定位气缸下降端(料仓) LocationCylinder_Down
/// </summary>
public static string LocationCylinder_Down = "LocationCylinder_Down";
/// <summary>
/// 料仓IO。定位气缸上升端(料仓) LocationCylinder2_Up
/// </summary>
public static string LocationCylinder2_Up = "LocationCylinder2_Up";
/// <summary>
///料仓IO。 定位气缸下降端(料仓) LocationCylinder2_Down
/// </summary>
public static string LocationCylinder2_Down = "LocationCylinder2_Down";
public static string TrayCheck_Fixture = "TrayCheck_Fixture";
/// <summary>
/// 料仓DO 。料仓运转ON Run_Signal
/// DI,1,左料仓进料口门上升端,Door_Up,5,HC,X05,
/// </summary>
public static string Run_Signal = "Run_Signal";
public static string Door_Up = "Door_Up";
/// <summary>
/// 料仓DO 。料仓轴2刹车ON Axis_Brake
/// DI,1,左料仓进料口门下降端,Door_Down,6,HC,X06,
/// </summary>
public static string Axis_Brake = "Axis_Brake";
public static string Door_Down = "Door_Down";
/// <summary>
/// 料仓DO 。料仓吹气SOL ON StartOrStopBlow
/// DI,1,左料仓激光检测,CheckPos,7,HC,X07,
/// </summary>
public static string StartOrStopBlow = "StartOrStopBlow";
/// <summary>
/// DO 自动指示灯 AutoRun_HddLed
public static string CheckPos = "CheckPos";
///// <summary>
///// DI,2,右料仓进料口料盘检测,TrayCheck_Door,8,HC,X08,
///// </summary>
//public static string TrayCheck_Door = "TrayCheck_Door";
///// <summary>
///// DI,2,右料仓料叉料盘检测,TrayCheck_Fixture,9,HC,X09,
///// </summary>
//public static string TrayCheck_Fixture = "TrayCheck_Fixture";
///// <summary>
///// DI,2,右料仓进料口门上升端,Door_Up,10,HC,X10,
///// </summary>
//public static string Door_Up = "Door_Up";
///// <summary>
///// DI,2,右料仓进料口门下降端,Door_Down,11,HC,X11,
///// </summary>
//public static string Door_Down = "Door_Down";
///// <summary>
///// DI,2,右料仓激光检测,CheckPos,12,HC,X12,
///// </summary>
//public static string CheckPos = "CheckPos";
/// <summary>
/// DO,0,自动指示灯,AutoRun_HddLed,0,HC,Y01,
/// </summary>
public static string AutoRun_HddLed = "AutoRun_HddLed";
/// <summary>
/// DO 待机指示灯 RunSign_HddLed
/// </summary>
public static string RunSign_HddLed = "RunSign_HddLed";
/// <summary>
///DO 故障指示灯 Alarm_HddLed
/// DO,0,故障指示灯,Alarm_HddLed,1,HC,Y02,
/// </summary>
public static string Alarm_HddLed = "Alarm_HddLed";
/// <summary>
/// 吹气SOL Blow_Single
/// DO,0,待机指示灯,RunSign_HddLed,2,HC,Y03,
/// </summary>
public static string Blow_Single = "Blow_Single";
/// <summary>
/// 进出料口门上升端 Door_Up
/// </summary>
public static string Door_Up = "Door_Up";
/// <summary>
/// 进出料口门下降端 Door_Down
/// </summary>
public static string Door_Down = "Door_Down";
public static string DoorLimit = "DoorLimit";
public static string RunSign_HddLed = "RunSign_HddLed";
/// <summary>
/// DO,0,报警蜂鸣器,Alarm_Buzzer,3,HC,Y04,
/// </summary>
public static string Alarm_Buzzer = "Alarm_Buzzer";
///// <summary>
///// DO,1,左料仓进料口门上升SOL,Door_Up,4,HC,Y05,
///// </summary>
//public static string Door_Up = "Door_Up";
///// <summary>
///// DO,1,左料仓进料口门下降SOL,Door_Down,5,HC,Y06,
///// </summary>
//public static string Door_Down = "Door_Down";
///// <summary>
///// DO,2,右料仓进料口门上升SOL,Door_Up,6,HC,Y07,
///// </summary>
//public static string Door_Up = "Door_Up";
///// <summary>
///// DO,2,右料仓进料口门下降SOL,Door_Down,7,HC,Y08,
///// </summary>
//public static string Door_Down = "Door_Down";
/// <summary>
/// DO,0,设备照明ON,Device_Led,8,HC,Y09,
/// </summary>
......
......@@ -39,36 +39,31 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut", false)]
public int IOSingle_TimerOut { get; set; }
/// <summary>
/// PRO 需要吹气的温度(温度标准) Max_Temperature 10
/// </summary>
[ConfigProAttribute("Max_Temperature", false)]
public int Max_Temperature { get; set; }
/// <summary>
/// PRO 需要吹气的湿度(湿度标准) Max_Humidity 10
/// </summary>
[ConfigProAttribute("Max_Humidity", false)]
public int Max_Humidity { get; set; }
///// <summary>
///// PRO 需要吹气的温度(温度标准) Max_Temperature 10
///// </summary>
//[ConfigProAttribute("Max_Temperature", false)]
//public int Max_Temperature { get; set; }
///// <summary>
///// PRO 需要吹气的湿度(湿度标准) Max_Humidity 10
///// </summary>
//[ConfigProAttribute("Max_Humidity", false)]
//public int Max_Humidity { get; set; }
/// <summary>
/// PRO 每次吹气的时间(分钟) BlowAir_Time 10
/// </summary>
[ConfigProAttribute("BlowAir_Time", false)]
public int BlowAir_Time { get; set; }
///// <summary>
///// PRO 每次吹气的时间(分钟) BlowAir_Time 10
///// </summary>
//[ConfigProAttribute("BlowAir_Time", false)]
//public int BlowAir_Time { get; set; }
/// <summary>
/// PRO 两次吹气间隔(分钟) BlowAir_Interval 10
/// </summary>
[ConfigProAttribute("BlowAir_Interval", false)]
public int BlowAir_Interval { get; set; }
///// <summary>
///// PRO 两次吹气间隔(分钟) BlowAir_Interval 10
///// </summary>
//[ConfigProAttribute("BlowAir_Interval", false)]
//public int BlowAir_Interval { get; set; }
public int InoutAxis_PositionMax { get; set; }
/// <summary>
/// PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
/// </summary>
[ConfigProAttribute("Humiture_Port", true)]
public string Humiture_Port { get; set; }
public ushort GetDOLength(string ioIp)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!