Commit 1de1acb1 LN

1

1 个父辈 4d18eddc
......@@ -39,10 +39,6 @@
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
<Reference Include="Asa.RFID, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\RFID\Asa.RFID.dll</HintPath>
</Reference>
<Reference Include="Client">
<HintPath>..\..\dll\Client.dll</HintPath>
</Reference>
......@@ -52,6 +48,10 @@
<Reference Include="halcondotnet">
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="HFReader9CSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\RFID\HFReader9CSharp.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\log4net.dll</HintPath>
......
......@@ -1040,7 +1040,7 @@ namespace OnlineStore.DeviceLibrary
}
if (NeedSaveParam&&LineManager.Line.runStatus>=LineRunStatus.HomeMoving&& LineManager.Line.CanProcessLine())
{
LogInfo(" 【" + info.ToStr() + "】不需要出入库" );
LogUtil.debug(" 【" + info.ToStr() + "】不需要出入库" );
}
}
catch (Exception ex)
......
......@@ -203,8 +203,11 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.TopCylinder_Down, IO_VALUE.LOW);
IOMove(IO_Type.BeforeAfterCylinder_Before, IO_VALUE.LOW);
IOMove(IO_Type.BeforeAfterCylinder_After, IO_VALUE.LOW);
IOMove(IO_Type.UpDownCylinder_Up, IO_VALUE.LOW);
IOMove(IO_Type.UpDownCylinder_Down, IO_VALUE.LOW);
if (UseAxis.Equals(false))
{
IOMove(IO_Type.UpDownCylinder_Up, IO_VALUE.LOW);
IOMove(IO_Type.UpDownCylinder_Down, IO_VALUE.LOW);
}
IOMove(IO_Type.ClampCylinder_Slack, IO_VALUE.LOW);
IOMove(IO_Type.ClampCylinder_Tighten, IO_VALUE.LOW);
runStatus = LineRunStatus.Wait;
......
......@@ -184,8 +184,11 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.TopCylinder_Down, IO_VALUE.LOW);
IOMove(IO_Type.BeforeAfterCylinder_Before, IO_VALUE.LOW);
IOMove(IO_Type.BeforeAfterCylinder_After, IO_VALUE.LOW);
IOMove(IO_Type.UpDownCylinder_Up, IO_VALUE.LOW);
IOMove(IO_Type.UpDownCylinder_Down, IO_VALUE.LOW);
if (UseAxis.Equals(false))
{
IOMove(IO_Type.UpDownCylinder_Up, IO_VALUE.LOW);
IOMove(IO_Type.UpDownCylinder_Down, IO_VALUE.LOW);
}
IOMove(IO_Type.ClampCylinder_Slack, IO_VALUE.LOW);
IOMove(IO_Type.ClampCylinder_Tighten, IO_VALUE.LOW);
runStatus = LineRunStatus.Wait;
......
......@@ -245,7 +245,14 @@ namespace OnlineStore.DeviceLibrary
}
else
{
MO_14_TopCylinder_Down();
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
CheckLog("放托盘(放开阻挡)" + MoveInfo.SLog + " 托盘 【" + currTrayNum + "】直接放行");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
if (Config.SidesWayNum <= 0)
{
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
}
//MO_14_TopCylinder_Down();
}
}
else
......
......@@ -13,19 +13,19 @@ namespace OnlineStore.DeviceLibrary
{
public class RFIDManager
{
public static Asa.RFID.ReaderAll RfidReader = new ReaderAll();
// public static Asa.RFID.RFIDReader RfidReader = new RFIDReader();
private static int DefaultTrayNum = ConfigAppSettings.GetIntValue(Setting_Init.DefaultTrayNum);
static RFIDManager()
{
RfidReader.GetValue += RfidReader_GetValue;
// RfidReader.GetValue += RfidReader_GetValue;
}
public static void Open(string[] iparray)
{
string path = Application.StartupPath + @"\logs\rfid\";
RFIDManager.RfidReader.LogPath = path;
// RFIDManager.RfidReader.LogPath = path;
// string[] rfidArray = rfidList.ToArray();
//连接rfip
RFIDManager.RfidReader.Open(iparray);
RFIDReader.Open(null, iparray);
}
private static void RfidReader_GetValue(string s)
......@@ -95,16 +95,25 @@ namespace OnlineStore.DeviceLibrary
{
if (String.IsNullOrEmpty(ip).Equals(false) && LineManager.Line.rfidList.Contains(ip))
{
byte[] bdata = RfidReader.Read(ip);
byte[] bdata = null;
if (isClear)
{
bdata = RFIDReader.ReadAndClear(ip);
}
else
{
bdata = RFIDReader.Read(ip);
}
if (bdata == null)
{
LogUtil.error("RFID [ " + ip + " ] 读到数据=null");
}
RFIDData data = new RFIDData(bdata);
if (isClear)
{
RfidReader.Clear(ip);
}
//if (isClear)
//{
// RFIDReader.Clear(ip);
//}
return data;
}
}
......@@ -134,7 +143,7 @@ namespace OnlineStore.DeviceLibrary
{
try
{
RfidReader.Close();
RFIDReader.CloseAll();
}catch(Exception ex)
{
LogUtil.error("关闭RFID出错:" + ex.ToString());
......
......@@ -9,7 +9,7 @@ namespace Asa.RFID
{
public class RFID
{
public static readonly ILog LOGGER = LogManager.GetLogger("TheRFID");
public static readonly ILog LOGGER = LogManager.GetLogger("RollingLogFileAppender");
private string IP = "";
private byte addr;
......@@ -35,10 +35,21 @@ namespace Asa.RFID
public int StopAutoScan()
{
LOGGER.Info("Close RFID ["+ IP +"]");
IsConnect = false;
byte scanMode = 0;
return SetAutoScanMode(addr, scanMode);
try
{
IsConnect = false;
byte scanMode = 0;
int ErrCode = SetAutoScanMode(addr, scanMode);
LOGGER.Info("Close RFID [" + IP + "] ScanMode:" + ErrCode);
ErrCode = ReaderA.StaticClassReaderA.CloseNetPort(portIndex);
LOGGER.Info("Close RFID [" + IP + "]:" + ErrCode);
return ErrCode;
}
catch (Exception e)
{
LOGGER.Error("Close RFID[" + IP + "] has error", e);
}
return -1;
}
......
......@@ -10,9 +10,9 @@ namespace Asa.RFID
{
public class RFIDReader
{
public static readonly ILog LOGGER = LogManager.GetLogger("TheRFID");
public static readonly ILog LOGGER = LogManager.GetLogger("RollingLogFileAppender");
private Dictionary<string, RFID> rfidMap = new Dictionary<string, RFID>();
private static Dictionary<string, RFID> rfidMap = new Dictionary<string, RFID>();
/// <summary>
/// 打开所有
......@@ -20,13 +20,13 @@ namespace Asa.RFID
/// <param name="ipArr"></param>
/// <param name="OnReceive"></param>
/// <param name="ip"></param>
public void Open(Received_Event OnReceive, params string[] ipArr)
public static void Open(Received_Event OnReceive, params string[] ipArr)
{
foreach(var ip in ipArr)
{
if (rfidMap.ContainsKey(ip))
{
rfidMap[ip].StopAutoScan(OnReceive);
rfidMap[ip].StartAutoScan(OnReceive);
}
else
{
......@@ -42,7 +42,7 @@ namespace Asa.RFID
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
public byte[] ReadAndClear(string ip)
public static byte[] ReadAndClear(string ip)
{
if (rfidMap.ContainsKey(ip))
{
......@@ -56,7 +56,7 @@ namespace Asa.RFID
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
public byte[] Read(string ip)
public static byte[] Read(string ip)
{
if (rfidMap.ContainsKey(ip))
{
......@@ -64,12 +64,12 @@ namespace Asa.RFID
}
return null;
}
/// <summary>
/// 关闭所有
/// </summary>
public void CloseAll()
public static void CloseAll()
{
foreach(var rfid in rfidMap.Values)
{
......
......@@ -39,7 +39,7 @@ namespace OnlineStore.DeviceLibrary
//return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") +"] ["+ type +
// "]二维码[" + WareCode + "]库位号[" + PosId + "] [" + PlateW + "X" + PlateH+ "] " + err + " "+ jinji + "" ;
return "托盘 [" + TrayCode + "] [" + FormUtil.GetSpanStr(DateTime.Now - LastUpdateTime) + "] [" + (IsFull ? "有料" : "空") + "] [" + type + "]";
return "托盘 [" + TrayCode + "] [" + LastUpdateTime.ToLongTimeString() + "] [" + (IsFull ? "有料" : "空") + "] [" + type + "]";
}
/// <summary>
/// 夹具编码值(1-32?)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!