Commit 6522a61a 几米阳光

上料部分代码

1 个父辈 d35479f7
......@@ -30,9 +30,9 @@
<!--<add key="CodeType" value="Data Matrix ECC 200"/>-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" />
<add key ="AI_ConvertPosition" value ="55"/>
<add key ="InOutDefaultPosition" value ="3000"/>
<add key ="Config_Pwd" value ="123456"/>
<add key ="AxisChangeValue" value ="100"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -51,7 +51,7 @@ namespace OnlineStore.AutoInOutStore
txtInOutSpeed.Text = inout.TargetSpeed.ToString();
txtUpDownSpeed.Text = updown.TargetSpeed.ToString();
txtAutoSpeed.Text = auto.TargetSpeed.ToString();
txtComSpeed.Text = AutoStoreManager.Config.CompressAxis_EndSpeed.ToString();
txtComSpeed.Text = StoreManager.Config.CompressAxis_EndSpeed.ToString();
timer1.Start();
}
/// <summary>
......@@ -135,7 +135,7 @@ namespace OnlineStore.AutoInOutStore
{
if (this.btnInOutMove.BackColor .Equals(System.Drawing.SystemColors.Control))
{
if (AutoStoreManager.Store.InOutAxisCanMove().Equals(false))
if (StoreManager.Store.InOutAxisCanMove().Equals(false))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
......@@ -222,7 +222,7 @@ namespace OnlineStore.AutoInOutStore
{
if (btnInOutMovej.BackColor.Equals(System.Drawing.SystemColors.Control))
{
if (AutoStoreManager.Store.InOutAxisCanMove().Equals(false))
if (StoreManager.Store.InOutAxisCanMove().Equals(false))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
......
......@@ -234,25 +234,25 @@ namespace OnlineStore.AutoInOutStore
}
private void btnOpenDoor_Click(object sender, EventArgs e)
{
boxBean.KNDIOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
boxBean.KNDIOMove(IO_Type.Door_Down, IO_VALUE.LOW);
KND.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
KND.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
}
private void btnCloseDoor_Click(object sender, EventArgs e)
{
boxBean.KNDIOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
boxBean.KNDIOMove(IO_Type.Door_Up, IO_VALUE.LOW);
KND.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
KND.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
}
private void btnLocationUp_Click(object sender, EventArgs e)
{
boxBean.KNDIOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
boxBean.KNDIOMove(IO_Type.LocationCylinder_Up, IO_VALUE.HIGH);
KND.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
KND.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.HIGH);
}
private void btnLocationDown_Click(object sender, EventArgs e)
{
boxBean.KNDIOMove(IO_Type.LocationCylinder_Down, IO_VALUE.HIGH);
boxBean.KNDIOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
KND.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.HIGH);
KND.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
}
private void FrmIOStatus_Shown(object sender, EventArgs e)
......@@ -262,12 +262,12 @@ namespace OnlineStore.AutoInOutStore
private void btnOpenAxisBreak_Click(object sender, EventArgs e)
{
boxBean.KNDIOMove(IO_Type.Axis_Brake, IO_VALUE.HIGH);
KND.IOMove(IO_Type.Axis_Brake, IO_VALUE.HIGH);
}
private void btnCloseAxisBreak_Click(object sender, EventArgs e)
{
boxBean.KNDIOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
KND.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
}
private void button1_Click(object sender, EventArgs e)
......@@ -277,12 +277,46 @@ namespace OnlineStore.AutoInOutStore
private void btnOpenLed_Click(object sender, EventArgs e)
{
boxBean.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
}
private void btnCloseLed_Click(object sender, EventArgs e)
{
boxBean.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
}
private void btnSuckingDiscUp_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.SuckingDisc_Down, IO_VALUE.LOW);
KND.IOMove(IO_Type.SuckingDisc_Up, IO_VALUE.HIGH);
}
private void btnSuckingDiscDown_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.SuckingDisc_Up, IO_VALUE.LOW);
KND.IOMove(IO_Type.SuckingDisc_Down, IO_VALUE.HIGH);
}
private void btnDOpen_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.AutoDoor_Close, IO_VALUE.LOW);
KND.IOMove(IO_Type.AutoDoor_Open, IO_VALUE.HIGH);
}
private void btnDClose_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.AutoDoor_Open, IO_VALUE.LOW);
KND.IOMove(IO_Type.AutoDoor_Close, IO_VALUE.HIGH);
}
private void btnSXi_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.HIGH);
}
private void btnSXil_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
}
}
}
......@@ -40,7 +40,7 @@ namespace OnlineStore.AutoInOutStore
}
private void InitStoreValue()
{
this.store = AutoStoreManager.InitStore();
this.store = StoreManager.InitStore();
if (store == null)
{
LogUtil.error(LOGGER, "找不到对应的料仓");
......@@ -190,13 +190,19 @@ namespace OnlineStore.AutoInOutStore
//ReadPosistion();
if (store.storeRunStatus > StoreRunStatus.Wait)
{
if (AutomaticBaiting.AutoDoorSatus.Equals(1))
{
lblDoorStatus.Text = "仓门状态:关闭";
}else
{
lblDoorStatus.Text = "仓门状态:打开";
}
if (启动ToolStripMenuItem.Enabled.Equals(true))
{
StoreOpenStatus(true);
}
lblThisSta.Text = store.GetRunStr();
//复位按钮状态显示
if (复位ToolStripMenuItem.Enabled == false)
{
......@@ -229,13 +235,13 @@ namespace OnlineStore.AutoInOutStore
if (store.Config.IsHasDoorLimit.Equals(1))
{
if (store.KNDIOValue(IO_Type.DoorColse_Single).Equals(IO_VALUE.LOW))
if (KND.IOValue(IO_Type.DoorColse_Single).Equals(IO_VALUE.LOW))
{
lblWarnMsg.Text = lblWarnMsg.Text + " 前门未关";
}
}
//如果不在出入库中,且叉子上有信号,需要提示检查叉子
if (store.storeRunStatus.Equals(StoreRunStatus.Runing) && store.KNDIOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
if (store.storeRunStatus.Equals(StoreRunStatus.Runing) && KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
lblWarnMsg.Text = lblWarnMsg.Text + " 叉子料盘检测有料,请检查";
}
......@@ -273,6 +279,7 @@ namespace OnlineStore.AutoInOutStore
lblThisSta.Text = "等待启动";
lblWarnMsg.Text = "";
btnStartAuTo.Text = "开始自动出入库";
lblDoorStatus.Text = "仓门状态未知";
}
}
......@@ -504,8 +511,8 @@ namespace OnlineStore.AutoInOutStore
return;
}
}
LogUtil.info("点击【绝对运动】,端口号【"+ portName + "】地址【" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
ACServerManager.AbsMove(portName, SlvAddr, position, speed );
LogUtil.info("点击【绝对运动】,端口号【" + portName + "】地址【" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
ACServerManager.AbsMove(portName, SlvAddr, position, speed);
}
private void btnAxisVMove_Click(object sender, EventArgs e)
{
......@@ -674,7 +681,7 @@ namespace OnlineStore.AutoInOutStore
if (needUpdate)
{
//更新缓存
AutoStoreManager.UpdateBoxConfig(store.Config);
StoreManager.UpdateBoxConfig(store.Config);
}
}
......@@ -971,14 +978,14 @@ namespace OnlineStore.AutoInOutStore
private void 料仓运转ONToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Enabled = false;
store.RunAxis(false );
store.RunAxis(false);
this.Enabled = true;
LogUtil.info("料仓运转ON完成");
}
private void 扫码测试ToolStripMenuItem_Click(object sender, EventArgs e)
{
store.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
string message = "";
string outMsg = "";
//List<string> codeList = HDevelopExport.CameraScan(out outMsg);
......@@ -992,14 +999,14 @@ namespace OnlineStore.AutoInOutStore
{
message = message + str + "##";
}
LogUtil.info("扫码测试收到二维码【"+outMsg+"】:" + message);
store.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
LogUtil.info("扫码测试收到二维码【" + outMsg + "】:" + message);
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
}
private void 打开舱门ToolStripMenuItem_Click(object sender, EventArgs e)
{
store.KNDIOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
store.KNDIOMove(IO_Type.Door_Down, IO_VALUE.LOW);
KND.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
KND.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
}
private void 料仓运转OFFToolStripMenuItem_Click(object sender, EventArgs e)
......@@ -1010,8 +1017,8 @@ namespace OnlineStore.AutoInOutStore
private void 关闭仓门ToolStripMenuItem_Click(object sender, EventArgs e)
{
store.KNDIOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
store.KNDIOMove(IO_Type.Door_Up, IO_VALUE.LOW);
KND.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
KND.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
}
private void 回待机点ToolStripMenuItem_Click(object sender, EventArgs e)
......@@ -1265,7 +1272,7 @@ namespace OnlineStore.AutoInOutStore
}
private void toolStripMenuItem1_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("是否确定退出?", "提示", MessageBoxButtons.YesNo,MessageBoxIcon.Question);
DialogResult result = MessageBox.Show("是否确定退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result.Equals(DialogResult.Yes))
{
ExitApp();
......@@ -1287,7 +1294,7 @@ namespace OnlineStore.AutoInOutStore
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("是否确定退出?", "提示", MessageBoxButtons.YesNo,MessageBoxIcon.Question);
DialogResult result = MessageBox.Show("是否确定退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result.Equals(DialogResult.Yes))
{
ExitApp();
......@@ -1296,21 +1303,21 @@ namespace OnlineStore.AutoInOutStore
private void 摄像机调试ToolStripMenuItem_Click(object sender, EventArgs e)
{
store.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
CodeLibrary.FrmCodeDecode frm = new FrmCodeDecode( );
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
CodeLibrary.FrmCodeDecode frm = new FrmCodeDecode();
frm.ShowDialog();
store.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
}
private void 学习二维码ToolStripMenuItem_Click(object sender, EventArgs e)
{
store.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName);
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
HDCodeLearnHelper.LoadConfig(nameStr, codeStr);
FrmCodeLearn learn = new FrmCodeLearn();
learn.ShowDialog();
store.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
}
private void btnReadHomeSingle_Click(object sender, EventArgs e)
......@@ -1320,9 +1327,9 @@ namespace OnlineStore.AutoInOutStore
}
private void btnOpen_Click(object sender, EventArgs e)
{
if (AutoStoreManager.OpenShuoKe(store))
if (StoreManager.OpenShuoKe(store))
{
store.SetShuokeSpeed();
ShuoKeControls.SetConfigSpeed(StoreManager.Config);
FormComStatus(true);
}
}
......@@ -1379,15 +1386,5 @@ namespace OnlineStore.AutoInOutStore
btnStatusSearch.Enabled = isOpen;
// Bt_ClearCounter.Enabled = isOpen;
}
private void groupBox2_Enter(object sender, EventArgs e)
{
}
private void lblWarnMsg_Click(object sender, EventArgs e)
{
}
}
}
......@@ -61,15 +61,16 @@ namespace OnlineStore.Common
/// 配置文件路径 Data Matrix ECC 200.dcm
/// </summary>
public static string CodeParamPath = "CodeParamPath";
/// <summary>
/// 高度传感器转换系数
/// </summary>
public static string AI_ConvertPosition = "AI_ConvertPosition";
/// <summary>
/// 进出轴最大待机点,需要小于3000
/// </summary>
public static string InOutDefaultPosition = "InOutDefaultPosition";
public static string Config_Pwd = "Config_Pwd";
/// <summary>
/// 上料轴转换系数,plus/mm
/// </summary>
public static string AxisChangeValue = "AxisChangeValue";
}
}
......@@ -58,7 +58,9 @@
<ItemGroup>
<Compile Include="acSingleStore\AC_SA_BoxBean.cs" />
<Compile Include="acSingleStore\AC_SA_BoxBean_Partial.cs" />
<Compile Include="acSingleStore\ACStoreManager.cs" />
<Compile Include="acSingleStore\AutomaticBaiting_Partial.cs" />
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="acSingleStore\AutomaticBaiting.cs" />
<Compile Include="halcon\CodeManager.cs" />
<Compile Include="KangNaiDe\KNDManager.cs" />
<Compile Include="KangNaiDe\MasterTcpClient.cs" />
......@@ -76,7 +78,7 @@
<Compile Include="ShuoKe\ShuoKeControls.cs" />
<Compile Include="store\model\AxisAlarmInfo.cs" />
<Compile Include="store\model\FixtureCodeInfo.cs" />
<Compile Include="store\KTK_DeviceBase.cs" />
<Compile Include="store\AC_DeviceBase.cs" />
<Compile Include="store\InOrOutStoreParam.cs">
<SubType>Code</SubType>
</Compile>
......@@ -84,7 +86,7 @@
<Compile Include="store\model\StoreMoveInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="store\KTK_Store.cs" />
<Compile Include="store\AC_Store.cs" />
<Compile Include="store\StoreMoveStep.cs">
<SubType>Code</SubType>
</Compile>
......
......@@ -12,6 +12,49 @@ using System.Threading;
namespace OnlineStore.DeviceLibrary
{
public class KND
{
#region KNDIO
public static void IOMove(string ioType, IO_VALUE ioValue)
{
if (StoreManager.Config.StoreDOList.ContainsKey(ioType))
{
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
KNDManager.WriteSingleDO(configIo.DeviceName, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
Thread.Sleep(60);
}
else
{
LogUtil.error( "没有DO=" + ioType);
}
}
public static IO_VALUE IOValue(string ioType)
{
IO_VALUE ioValue = IO_VALUE.LOW;
if (StoreManager.Config.StoreDIList.ContainsKey(ioType))
{
ConfigIO configIo = StoreManager.Config.StoreDIList[ioType];
ioValue = KNDManager.GetDIValue(configIo.DeviceName, configIo.SlaveID, configIo.GetIOAddr());
//UpdateDoValue(ioType, ioValue);
}
else if (StoreManager.Config.StoreDOList.ContainsKey(ioType))
{
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
ioValue = KNDManager.GetDOValue(configIo.DeviceName, configIo.SlaveID, configIo.GetIOAddr());
}
else
{
LogUtil.error( "没有DO=" + ioType);
}
return ioValue;
}
#endregion
}
/// <summary>
/// 康奈德IO控制模块
/// </summary>
......@@ -30,6 +73,8 @@ namespace OnlineStore.DeviceLibrary
private static object DOMapLock = "";
public static System.Timers.Timer timer = null;
private static ushort port = 502;
public static void ConnectionIP(string ioIp)
{
if (timer == null)
......@@ -80,7 +125,7 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(10);
//读取所有的DO
ReadMultipleDO(ioIp, DefualtSlaveID, DoStartAddress, AutoStoreManager.Config.GetDOLength(ioIp));
ReadMultipleDO(ioIp, DefualtSlaveID, DoStartAddress, StoreManager.Config.GetDOLength(ioIp));
}
catch (Exception error)
......@@ -192,7 +237,7 @@ namespace OnlineStore.DeviceLibrary
foreach (string key in mastMap.Keys)
{
byte[] data = new byte[] { 0, 0 };
WriteMultipleDO(key, DefualtSlaveID, DoStartAddress, AutoStoreManager.Config.GetDOLength(key), data);
WriteMultipleDO(key, DefualtSlaveID, DoStartAddress, StoreManager.Config.GetDOLength(key), data);
}
}
......@@ -209,7 +254,7 @@ namespace OnlineStore.DeviceLibrary
}
public static void CloseAllDO(string ioIp, byte slaveId)
{
ushort length = AutoStoreManager.Config.GetDOLength(ioIp);
ushort length = StoreManager.Config.GetDOLength(ioIp);
byte[] bytes = new byte[length];
for (int i = 0; i < length; i++)
{
......@@ -394,7 +439,7 @@ namespace OnlineStore.DeviceLibrary
{
try
{
ushort DILength = AutoStoreManager.Config.GetDILength(ioIp);
ushort DILength = StoreManager.Config.GetDILength(ioIp);
string finalData = "";
if (values.Length == 2 && DILength.Equals(16))
{
......@@ -444,7 +489,7 @@ namespace OnlineStore.DeviceLibrary
private static void SaveDOData(string ioIp, ushort ID, byte[] values)
{
ushort DoLength = AutoStoreManager.Config.GetDOLength(ioIp);
ushort DoLength = StoreManager.Config.GetDOLength(ioIp);
string finalData = "";
if (values.Length == 2 && DoLength.Equals(16))
{
......
......@@ -11,8 +11,18 @@ namespace OnlineStore.DeviceLibrary
/// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// </summary>
public static string Home_Single = "0132";
//
//
/// <summary>
/// 0022h 负方向驱动禁止输入(NOT) ReadOnly 0: 输入 OFF、 1: 输入 ON
/// </summary>
public static string Limit_Negative_Single = "0022";
/// <summary>
/// 0023h 正方向驱动禁止输入(POT) ReadOnly 0: 输入 OFF、 1: 输入 ON
/// </summary>
public static string Limit_Positive_Single = "0023";
/// <summary>
///速度 4601
/// </summary>
public static string Speed_Addr = "4601";
......
......@@ -496,6 +496,21 @@ namespace OnlineStore.DeviceLibrary
return GetCoilData(portName, reviceData, ACCMDManager.Home_Single);
}
public static int GetLimitNegativeSingle(string portName, int slvAddr)
{
PreReadCoilAddr = ACCMDManager.Home_Single;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.Limit_Negative_Single, "0000", 1);
byte[] reviceData = SendCommand(portName, dataArray, 100, 6);
return GetCoilData(portName, reviceData, ACCMDManager.Home_Single);
}
public static int GetLimitPositiveSingle(string portName, int slvAddr)
{
PreReadCoilAddr = ACCMDManager.Home_Single;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadCoil, ACCMDManager.Limit_Positive_Single, "0000", 1);
byte[] reviceData = SendCommand(portName, dataArray, 100, 6);
return GetCoilData(portName, reviceData, ACCMDManager.Home_Single);
}
}
/// <summary>
/// 记录最后一次获得的寄存器的值
......
using log4net;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.IO.Ports;
......@@ -241,6 +242,23 @@ namespace OnlineStore.DeviceLibrary
byte[] sendData = WriteData(slvAddr, ShuoKeCMD.HomeMove, 0x01, homeType);
Thread.Sleep(100);
}
public static void SetConfigSpeed(AUTO_SA_Config Config)
{
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetAddSpeed, Config.CompressAxis_AddSpeed);
Thread.Sleep(60);
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetDelSpeed, Config.CompressAxis_DelSpeed);
Thread.Sleep(60);
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetEndSpeed, Config.CompressAxis_EndSpeed);
Thread.Sleep(60);
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetHomeSpeed, Config.CompressAxis_HomeSpeed);
Thread.Sleep(60);
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetMaxSpeed, Config.CompressAxis_MaxSpeed);
Thread.Sleep(60);
ShuoKeControls.SetSpeed(Config.CompressAxis_Slv, ShuoKeCMD.SetStartSpeed, Config.CompressAxis_StartSpeed);
}
public static void VolMove(int slvAddr, int speed)
{
byte[] sendData = WriteData(slvAddr, ShuoKeCMD.VolMove, 0x04, speed);
......
......@@ -11,8 +11,8 @@ DI,料盘宽度检测1,WidthCheck1,208,192.168.200.10,0,料盘宽度检测1,X09,DI-09,0,
DI,料盘宽度检测2,WidthCheck2,209,192.168.200.10,0,料盘宽度检测2,X10,DI-10,0,
DI,料盘检测1(上料机构),TrayCheck_LoadMaterial ,210,192.168.200.10,0,料盘检测1(上料机构),X11,DI-11,0,
DI,上料机构出料检测,OutCheck,211,192.168.200.10,0,上料机构出料检测,X12,DI-12,0,
DI,门锁气缸打开端,Door_Open,212,192.168.200.10,0,门锁气缸打开端,X13,DI-13,0,
DI,门锁气缸关闭端,Door_Close,213,192.168.200.10,0,门锁气缸关闭端,X14,DI-14,0,
DI,门锁气缸打开端,AutoDoor_Open,212,192.168.200.10,0,门锁气缸打开端,X13,DI-13,0,
DI,门锁气缸关闭端,AutoDoor_Close,213,192.168.200.10,0,门锁气缸关闭端,X14,DI-14,0,
DI,料盘检测2(料叉机构),TrayCheck_Fixture,214,192.168.200.10,0,料盘检测2(料叉机构),X15,DI-15,0,
DI,压紧机构计量检测,CompressAxis_Check,215,192.168.200.10,0,压紧机构计量检测,X16,DI-16,0,
DO,自动指示灯,AutoRun_HddLed,100,192.168.200.10,0,自动指示灯,Y01,DO-01,0,
......@@ -27,8 +27,8 @@ DO,进料口门上升SOL,Door_Up,108,192.168.200.10,0,进料口门上升SOL,Y09,DO-09,0,
DO,进料口门下降SOL,Door_Down,109,192.168.200.10,0,进料口门下降SOL,Y10,DO-10,0,
DO,吸盘气缸上升SOL,SuckingDisc_Up,110,192.168.200.10,0,吸盘气缸上升SOL,Y11,DO-11,0,
DO,吸盘气缸下降SOL,SuckingDisc_Down,111,192.168.200.10,0,吸盘气缸下降SOL,Y12,DO-12,0,
DO,门锁气缸打开SOL,Door_Open,112,192.168.200.10,0,门锁气缸打开SOL,Y13,DO-13,0,
DO,门锁气缸关闭SOL,Door_Close,113,192.168.200.10,0,门锁气缸关闭SOL,Y14,DO-14,0,
DO,门锁气缸打开SOL,AutoDoor_Open,112,192.168.200.10,0,门锁气缸打开SOL,Y13,DO-13,0,
DO,门锁气缸关闭SOL,AutoDoor_Close,113,192.168.200.10,0,门锁气缸关闭SOL,Y14,DO-14,0,
,,,114,192.168.200.10,0,,Y15,DO-15,0,
,,,115,192.168.200.10,0,,Y16,DO-16,0,
DI,上料机构门关闭,DoorClose_LoadMaterial,200,192.168.200.11,0,上料机构门关闭,X17,DI-21,0,
......@@ -125,11 +125,7 @@ PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,15000,,,,,,,
PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,15000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,, ,
,,,,,,,,,,
PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.12,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2500,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2500,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2500,,,,,,,
PRO,(轴五)自动轴目标速度,AutoAxis_TargetSpeed,1000,,,,,,,
PRO,(轴五)自动轴目标速度,AutoAxis_TargetSpeed,50,,,,,,,
PRO,(轴五)自动轴加速度,AutoAxis_AddSpeed,300,,,,,,,
PRO,(轴五)自动轴减速度,AutoAxis_DelSpeed,300,,,,,,,
PRO,(轴五)自动轴原点低速,AutoAxis_HomeLowSpeed,20,,,,,,,
......
......@@ -144,7 +144,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (wait.WaitType == 2)
{
wait.IsEnd = KNDIOValue(wait.IoType).Equals(wait.IoValue);
wait.IsEnd = KND.IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = Config.IOSingle_TimerOut;
if (StoreMove.MoveStep == StoreMoveStep.SO_14_WaitTake)
{
......@@ -165,11 +165,7 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}else if (wait.WaitType == 7)
{
wait.IsEnd = (wait.HeightValue.Equals(GetHeight()));
if (wait.IsEnd)
{
LogUtil.info("等待height="+ wait.HeightValue+"完成");
}
//wait.IsEnd = (wait.HeightValue.Equals(GetHeight()));
}
else if (wait.WaitType == 5)
{
......@@ -256,7 +252,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, StoreName + " 启动入库【" + posId + "】出错,找不到库位信息");
return;
}
if (KNDIOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
if (KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
LogUtil.error(LOGGER, StoreName + " 启动入库【" + posId + "】出错,叉子料盘检测有料");
return;
......@@ -407,8 +403,8 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
//关闭舱门
KNDIOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
KNDIOMove(IO_Type.Door_Up, IO_VALUE.LOW);
KND.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
KND.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
}
else
{
......@@ -424,8 +420,8 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
//关闭舱门
KNDIOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
KNDIOMove(IO_Type.Door_Up, IO_VALUE.LOW);
KND.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
KND.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_09_MoveToBag)
{
......@@ -444,7 +440,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_10_LocationCylinder_Down)
{
//KNDIOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
//KND.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
InStoreLog("入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_11_DeviceToBag);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
......@@ -528,7 +524,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】出错,找不到库位信息");
return;
}
if (KNDIOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
if (KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】出错,叉子料盘检测有料");
return;
......@@ -646,7 +642,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
//此处需要等待box门口没有盘
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
//StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
//打开舱门
OpenDoorAndWait();
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_2, IO_VALUE.LOW));
......@@ -705,7 +701,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.SO_14_WaitTake);
OutStoreLog("出库:SO_14_WaitTake 等待拿走物品,最多等待10000");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(10000));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
//StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
StoreMove.OneWaitCanEndStep = true;
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_14_WaitTake)
......@@ -735,15 +731,15 @@ namespace OnlineStore.DeviceLibrary
}
public bool InOutAxisCanMove()
{
if (AutoStoreManager.Store.Config.IsHasLocationCylinder.Equals(0))
if (StoreManager.Store.Config.IsHasLocationCylinder.Equals(0))
{
return true;
}
if (KNDIOValue(IO_Type.LocationCylinder_Down).Equals(IO_VALUE.HIGH)
&& KNDIOValue(IO_Type.LocationCylinder_Up).Equals(IO_VALUE.LOW)
&& KNDIOValue(IO_Type.LocationCylinder2_Down).Equals(IO_VALUE.HIGH)
&& KNDIOValue(IO_Type.LocationCylinder2_Up).Equals(IO_VALUE.LOW))
if (KND.IOValue(IO_Type.LocationCylinder_Down).Equals(IO_VALUE.HIGH)
&& KND.IOValue(IO_Type.LocationCylinder_Up).Equals(IO_VALUE.LOW)
&& KND.IOValue(IO_Type.LocationCylinder2_Down).Equals(IO_VALUE.HIGH)
&& KND.IOValue(IO_Type.LocationCylinder2_Up).Equals(IO_VALUE.LOW))
{
return true;
}
......@@ -753,8 +749,8 @@ namespace OnlineStore.DeviceLibrary
{
if (Config.IsHasLocationCylinder>=1)
{
KNDIOMove(IO_Type.LocationCylinder_Up, IO_VALUE.HIGH);
KNDIOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
KND.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.HIGH);
KND.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder_Up, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder_Down, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder2_Up, IO_VALUE.HIGH));
......@@ -765,8 +761,8 @@ namespace OnlineStore.DeviceLibrary
{
if (Config.IsHasLocationCylinder>=1)
{
KNDIOMove(IO_Type.LocationCylinder_Down, IO_VALUE.HIGH);
KNDIOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
KND.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.HIGH);
KND.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder_Down, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder_Up, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder2_Down, IO_VALUE.HIGH));
......
......@@ -11,8 +11,15 @@ using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary
{
public class AutoStoreManager
public class StoreManager
{
/// <summary>
/// 当前出入库的模式
/// </summary>
public static int CurrInOutType = 0;
private static string api_communication = "service/store/communication"; //流水线状态通信接口
private static string api_nextFeeder = "service/store/nextFeeder"; // 出库站位列表切换接口
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
......@@ -20,7 +27,7 @@ namespace OnlineStore.DeviceLibrary
public static AUTO_SA_Config Config = null;
private static bool isInit = false;
public static bool IsConnectServer=!ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
public AutoStoreManager()
public StoreManager()
{
}
public static bool OpenShuoKe(AC_SA_BoxBean box)
......@@ -95,10 +102,9 @@ namespace OnlineStore.DeviceLibrary
CSVPositionReader<AutoStorePosition>.ReloadCSVFile(positionConfigFile);
}
Config = (AUTO_SA_Config)storeConfig;
AC_SA_BoxBean storeBean = new AC_SA_BoxBean(Config);
storeBean.CID = CID;
Store = new AC_SA_BoxBean(Config);
Store.CID = CID;
LogUtil.info(LOGGER, "加载料仓完成!");
Store = storeBean;
return Store;
}
}
......
......@@ -10,7 +10,7 @@ using System.Text;
namespace OnlineStore.DeviceLibrary
{
public abstract class KTK_DeviceBase
public abstract class AC_DeviceBase
{
/// <summary>
/// 料仓单个调试状态(默认不是调试状态)
......@@ -53,13 +53,15 @@ namespace OnlineStore.DeviceLibrary
{
if (!isInit)
{
StoreMove = new StoreMoveInfo(StoreID);
StoreMove = new StoreMoveInfo(StoreName);
mainTimer = new System.Timers.Timer();
mainTimer.Enabled = false;
mainTimer.Interval = 300;
mainTimer.Elapsed += timersTimer_Elapsed;
mainTimer.AutoReset = true;
isInit = true;
}
}
......
......@@ -3,6 +3,7 @@ using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
......@@ -14,23 +15,13 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 康泰克单台自动料仓
/// </summary>
public abstract class KTK_Store : KTK_DeviceBase
public abstract class AC_Store : AC_DeviceBase
{
public KTK_Store()
public AC_Store()
{
}
/// <summary>
/// 开始运行的时间
/// </summary>
public DateTime StartTime { get; set; }
public DateTime statusTime = DateTime.Now;
/// <summary>
/// 伺服运行时间列表,key=轴,key=开始时间,value=结束时间
/// </summary>
//public Dictionary<int, Dictionary<DateTime, DateTime>> AxisRunTimeMap = new Dictionary<int, Dictionary<DateTime, DateTime>>();
//public Dictionary<int, DateTime> AxisLastStartTime = new Dictionary<int, DateTime>();
public Stopwatch runTimeWatch = new Stopwatch();
/// <summary>
/// 最后一次气压检测变为0的时间
......@@ -61,7 +52,6 @@ namespace OnlineStore.DeviceLibrary
public object lastDiListLock = "";
public void addLastDI(string type, IO_VALUE value)
{
try
{
lock (lastDiListLock)
......@@ -81,42 +71,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 获取料仓运行的时间
/// </summary>
/// <returns></returns>
public TimeSpan GetStoreRunTime()
{
if (StartTime != null)
{
return DateTime.Now - StartTime;
}
else
{
return new TimeSpan(0);
}
}
protected void AddAxisMoveTime(ConfigMoveAxis axis)
{
//int axisNo = axis.GetAxisValue();
//if (AxisLastStartTime.ContainsKey(axisNo))
//{
// AxisLastStartTime.Remove(axisNo);
//}
//AxisLastStartTime.Add(axisNo, DateTime.Now);
}
/// <summary>
/// 运动处理
/// </summary>
protected bool isInPro = false;
protected virtual void BusyMoveProcess()
{
//if (isInPro)
//{
// return;
//}
isInPro = true;
try
{
......@@ -227,7 +186,6 @@ namespace OnlineStore.DeviceLibrary
moveAxis.TargetPosition = 0;
LogUtil.debug(LOGGER, moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
AddAxisMoveTime(moveAxis);
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
}
......@@ -238,7 +196,6 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, targetPosition, targetSpeed));
moveAxis.TargetPosition = targetPosition;
AddAxisMoveTime(moveAxis);
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition,targetSpeed);
}
......@@ -309,21 +266,22 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
protected bool ACHomeMoveIsEnd(ConfigMoveAxis moveAxis,out string msg)
protected bool ACHomeMoveIsEnd(ConfigMoveAxis moveAxis, out string msg)
{
msg = "";
if (ACServerManager.IsHomeMoveEnd(moveAxis.DeviceName, moveAxis.GetAxisValue()) )
if (ACServerManager.IsHomeMoveEnd(moveAxis.DeviceName, moveAxis.GetAxisValue()))
{
//原点完成并且位置=0
int outCount = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
int errorCount = Math.Abs(outCount );
if (errorCount > moveAxis.CanErrorCountMax)
int errorCount = Math.Abs(outCount);
if (errorCount <= moveAxis.CanErrorCountMax)
{
return true;
}
//判断是否需要重新运动
if (StoreMove.CanWhileCount > 0)
{
LogUtil.error(LOGGER, moveAxis.DisplayStr + "收到原点完成信号,当前位置["+outCount+ "],重新回原点,剩余[" + StoreMove.CanWhileCount + "]次");
//LogUtil.error(LOGGER, StoreName + moveAxis.DisplayStr + "重新回原点");
LogUtil.error(LOGGER, moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + StoreMove.CanWhileCount + "]次");
ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
StoreMove.CanWhileCount--;
}
......@@ -331,22 +289,10 @@ namespace OnlineStore.DeviceLibrary
{
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error(LOGGER, msg);
return false;
}
}
else
{
return true;
}
return true;
}
return false;
}
protected bool AxisCountClear(ConfigMoveAxis moveAxis)
{
return true;
}
}
......
......@@ -37,6 +37,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public static int CompressAxisAlarm = 14;
/// <summary>
/// 轴五(自动轴)报警
/// </summary>
public static int AutoAxisAlarm = 20;
/// <summary>
/// 轴异常停止(没有走到对应的位置就停止)
/// </summary>
public static int AxisErrorStop = 15;
......
......@@ -309,8 +309,100 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 自动上下料机构复位
/// <summary>
/// 关闭门锁
/// </summary>
AUTO_R01_CloseDoor =1101,
/// <summary>
/// 自动轴原点返回
/// </summary>
AUTO_R02_AutoAxisHome = 1102,
/// <summary>
/// 检测机构内是否有料盘
/// </summary>
AUTO_R03_AutoAxisHome = 1103,
/// <summary>
/// 上料轴返回0点
/// </summary>
AUTO_R04_AutoBack=1104,
#endregion
#region 自动上下料上料功能
/// <summary>
/// 先上升到料盘检测1(上料机构)信号亮
/// </summary>
AUTO_I01_MoveToUp,
/// <summary>
/// 吸盘下降
/// </summary>
AUTO_I02_SuckingDisc_Down,
/// <summary>
/// 吸盘吸料盘
/// </summary>
AUTO_I03_SuckingDisc_Work,
/// <summary>
/// 吸盘上升 ,同时上料轴也要上升
/// </summary>
AUTO_I04_SuckingDisc_Up,
/// <summary>
/// 扫码
/// </summary>
AUTO_I05_ScanCode,
/// <summary>
/// 等待料盘被叉子拿走
/// </summary>
AUTO_I06_WaitTrayLeave,
/// <summary>
/// 打开仓门
/// </summary>
AUTO_I07_OpenDoor,
/// <summary>
/// 等待拿走料盘
/// </summary>
AUTO_I08_WaitTakeTray,
/// <summary>
/// 料盘已手动拿走,需要等一秒钟后关闭仓门
/// </summary>
AUTO_I09_TrayLeaveWaitTime,
/// <summary>
/// 关闭仓门
/// </summary>
AUTO_I10_CloseDoor,
#endregion
#region 自动上下料出料功能
/// <summary>
/// 吸盘吸走料盘,同时上料轴开始上升
/// </summary>
AUTO_O01_SuckingDisc_Work,
/// <summary>
/// 等待1秒后吸盘下降
/// </summary>
AUTO_O02_WaitTimeDown,
/// <summary>
/// 吸盘下降
/// </summary>
AUTO_O03_SuckingDisc_Down,
/// <summary>
/// 放下料盘
/// </summary>
AUTO_O04_PutTrayDown,
#endregion
}
public enum StoreAlarmType
......
......@@ -18,12 +18,12 @@ namespace OnlineStore.DeviceLibrary
/// 超时时间
/// </summary>
public int TimeOutSeconds = 60;
public StoreMoveInfo(int storeId)
public StoreMoveInfo(string deviceName)
{
moveType = StoreMoveType.None;
MoveParam = new InOutStoreParam();
this.storeId = storeId;
this.DeviceName = deviceName;
this.moveStep = StoreMoveStep.Wait;
IsInWait = false;
MoveNum = 0;
......@@ -54,7 +54,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 当前运动是哪个料仓
/// </summary>
public int storeId { get; set; }
public string DeviceName { get; set; }
/// <summary>
/// 是否再当前步骤等待中
......@@ -144,6 +144,7 @@ namespace OnlineStore.DeviceLibrary
{
private WaitResultInfo()
{
IsEnd = false;
}
public static WaitResultInfo WaitIO(string ioType, IO_VALUE ioValue)
......@@ -233,14 +234,65 @@ namespace OnlineStore.DeviceLibrary
return wait;
}
public static WaitResultInfo WaitHeight(int height)
//public static WaitResultInfo WaitHeight(int height)
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.WaitType = 7;
// wait.HeightValue = height;
// wait.IsEnd = false;
// return wait;
//}
/// <summary>
/// 等待轴的反限位为指定值
/// </summary>
public static WaitResultInfo WaitAxistNegativeLimit(ConfigMoveAxis moveAxis ,IO_VALUE ioValue)
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 8;
wait.AxisInfo = moveAxis;
wait.IsHomeMove = true;
wait.IoValue = ioValue;
wait.IsEnd = false;
return wait;
}
/// <summary>
/// 等待轴的正限位为指定值
/// </summary>
public static WaitResultInfo WaitAxistPositiveLimit(ConfigMoveAxis moveAxis, IO_VALUE ioValue)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 7;
wait.HeightValue = height;
wait.CanWhileMoveCount = 0;
wait.WaitType = 9;
wait.AxisInfo = moveAxis;
wait.IsHomeMove = true;
wait.IoValue = ioValue;
wait.IsEnd = false;
return wait;
}
/// <summary>
/// 等待上料轴运动 停止
/// </summary>
/// <returns></returns>
public static WaitResultInfo WaitAutoAxisStop(ConfigMoveAxis moveAxis)
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.AxisInfo = moveAxis;
wait.WaitType = 10;
wait.IsHomeMove = true;
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitCodeOK()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 11;
return wait;
}
public string ToStr()
{
if (WaitType == 1)
......@@ -273,10 +325,26 @@ namespace OnlineStore.DeviceLibrary
else if (WaitType == 6)
{
return "轴【" + AxisInfo.DisplayStr + "】ORG信号:【" + IoValue + "】 ";
}else if (WaitType == 7)
}
else if (WaitType == 7)
{
return "料盘高度【" + HeightValue + "】 ";
}
else if (WaitType == 8)
{
return "轴【" + AxisInfo.DisplayStr + "】负限位:【" + IoValue + "】 ";
}
else if (WaitType == 9)
{
return "轴【" + AxisInfo.DisplayStr + "】正限位:【" + IoValue + "】 ";
}
else if (WaitType == 10)
{
return "上料轴运动停止 ";
}else if (WaitType == 11)
{
return "等待扫码结束";
}
else
{
return "Wait位置类型:WaitType=【" + WaitType + "】";
......@@ -288,6 +356,8 @@ namespace OnlineStore.DeviceLibrary
public int CanWhileMoveCount { get; set; }
/// <summary>
/// 等待结果,1=轴运动,2=IO运动,3=时间,4=电钢,5=硕科电机,6=等待轴原点信号
/// 7=等待高度为0,8=等待轴的负限位,9=等待轴的正限位。10=上料轴运动停止
/// 11=扫码结束。
/// </summary>
public int WaitType { get; set; }
/// <summary>
......
......@@ -471,27 +471,27 @@ namespace OnlineStore.LoadCSVLibrary
public string Humiture_Port { get; set; }
/// <summary>
/// PRO 模拟量IO模块的IP地址 AIDevice_IP 192.168.200.11
/// </summary>
[ConfigProAttribute("AIDevice_IP", true)]
public string AIDevice_IP { get; set; }
///// <summary>
///// PRO 模拟量IO模块的IP地址 AIDevice_IP 192.168.200.11
///// </summary>
//[ConfigProAttribute("AIDevice_IP", true)]
//public string AIDevice_IP { get; set; }
/// <summary>
/// PRO,模拟信号1默认高度,AIDI1_DefaultPosition,1,,,,,,,
/// </summary>
[ConfigProAttribute("AIDI1_DefaultPosition", true)]
public double AIDI1_DefaultPosition { get; set; }
/// <summary>
/// PRO,模拟信号2默认高度,AIDI2_DefaultPosition,1,,,,,,,
/// </summary>
[ConfigProAttribute("AIDI2_DefaultPosition", true)]
public double AIDI2_DefaultPosition { get; set; }
/// <summary>
/// PRO,模拟信号3默认高度,AIDI3_DefaultPosition,1,,,,,,,
/// </summary>
[ConfigProAttribute("AIDI3_DefaultPosition", true)]
public double AIDI3_DefaultPosition { get; set; }
///// <summary>
///// PRO,模拟信号1默认高度,AIDI1_DefaultPosition,1,,,,,,,
///// </summary>
//[ConfigProAttribute("AIDI1_DefaultPosition", true)]
//public double AIDI1_DefaultPosition { get; set; }
///// <summary>
///// PRO,模拟信号2默认高度,AIDI2_DefaultPosition,1,,,,,,,
///// </summary>
//[ConfigProAttribute("AIDI2_DefaultPosition", true)]
//public double AIDI2_DefaultPosition { get; set; }
///// <summary>
///// PRO,模拟信号3默认高度,AIDI3_DefaultPosition,1,,,,,,,
///// </summary>
//[ConfigProAttribute("AIDI3_DefaultPosition", true)]
//public double AIDI3_DefaultPosition { get; set; }
/// <summary>
......@@ -647,8 +647,8 @@ namespace OnlineStore.LoadCSVLibrary
MustHaveDIList.Add(IO_Type.WidthCheck2);
MustHaveDIList.Add(IO_Type.TrayCheck_LoadMaterial);
MustHaveDIList.Add(IO_Type.OutCheck);
MustHaveDIList.Add(IO_Type.Door_Open);
MustHaveDIList.Add(IO_Type.Door_Close);
MustHaveDIList.Add(IO_Type.AutoDoor_Open);
MustHaveDIList.Add(IO_Type.AutoDoor_Close);
MustHaveDIList.Add(IO_Type.TrayCheck_Fixture);
MustHaveDIList.Add(IO_Type.CompressAxis_Check);
......@@ -671,8 +671,8 @@ namespace OnlineStore.LoadCSVLibrary
MustHaveDOList.Add(IO_Type.Door_Down);
MustHaveDOList.Add(IO_Type.SuckingDisc_Up);
MustHaveDOList.Add(IO_Type.SuckingDisc_Down);
MustHaveDOList.Add(IO_Type.Door_Open);
MustHaveDOList.Add(IO_Type.Door_Close);
MustHaveDOList.Add(IO_Type.AutoDoor_Open);
MustHaveDOList.Add(IO_Type.AutoDoor_Close);
}
public static void ConfigAxis(AUTO_SA_Config Config)
{
......
......@@ -138,11 +138,11 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// 门锁气缸打开端 Door_Open X13 DI-13
/// </summary>
public static string Door_Open = "Door_Open";
public static string AutoDoor_Open = "Door_Open";
/// <summary>
/// 门锁气缸关闭端 Door_Close X14 DI-14
/// </summary>
public static string Door_Close = "Door_Close";
public static string AutoDoor_Close = "Door_Close";
/// <summary>
/// 料盘检测2(料叉机构) TrayCheck_Fixture X15 DI-15
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!