Commit 25df7720 几米阳光

调试功能修改

1 个父辈 0bc7c233
......@@ -36,7 +36,7 @@
<!--出库等待料盘拿走的时间,秒-->
<add key ="OutStoreWaitSeconds" value ="600"/>
<!--压紧轴对应1mm的脉冲-->
<add key="ComAxisChangeValue" value="800" />
<add key="ComAxisChangeValue" value="2400" />
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......@@ -67,6 +67,7 @@
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/AcStoreWCF/CWSMDBox/" />
......
......@@ -1343,6 +1343,7 @@ namespace OnlineStore.ACSingleStore
private void btnGetPosition_Click(object sender, EventArgs e)
{
int value = ShuoKeControls.GetABSPosition(store.Config.CompressAxis_Slv);
lblShuoKeMsg.Text = DateTime.Now.ToLongTimeString() + "实时位置:" + value;
}
private void btnStop_Click(object sender, EventArgs e)
......
......@@ -18,13 +18,16 @@ namespace OnlineStore.DeviceLibrary
/// 信号变化次数
/// </summary>
public static int SignalChangeCount=0;
public static int TragetChangeCount = 1;
public static int TragetChangeCount = 0;
public static IO_VALUE PreSignalValue = IO_VALUE.LOW;
private static System.Timers.Timer timer = null;
public static void StartCheck(int targetPositon,int currPosition)
public static void StartCheck(int targetPositon, int currPosition)
{
int count = Math.Abs(targetPositon - currPosition)/ComAxisChangeValue;
StartCheck(count);
int count = Math.Abs(targetPositon - currPosition) / ComAxisChangeValue;
if (count > 0)
{
StartCheck(count);
}
}
private static void StartCheck(int targetCount)
{
......@@ -45,6 +48,8 @@ namespace OnlineStore.DeviceLibrary
public static void StopCheck()
{
if(timer==null)
{ return; }
timer.Stop();
}
private static bool IsInProcess = false;
......
......@@ -290,7 +290,7 @@ namespace OnlineStore.DeviceLibrary
{
int position = GetABSPosition(slvAddr);
msg += "位置【" + position + "】";
if (Math.Abs(position - targetPosition) < 10)
if (Math.Abs(position - targetPosition) < 10 || targetPosition.Equals(-2000))
{
return true;
}
......@@ -305,7 +305,7 @@ namespace OnlineStore.DeviceLibrary
{
ShuoKeInfo shuokeInfo = GetStatus(slvAddr);
msg = " IsInMove【" + shuokeInfo.IsInMove + "】Org【" + shuokeInfo.Org + "】";
if (shuokeInfo.IsInMove == 0 && shuokeInfo.UpdateTime > time && shuokeInfo.Org == 0)
if (shuokeInfo.IsInMove .Equals(0) && shuokeInfo.Org.Equals(0)&&shuokeInfo.UpdateTime>time)
{
return true;
}
......@@ -557,12 +557,12 @@ namespace OnlineStore.DeviceLibrary
{
public ShuoKeInfo(int slv, int position)
{
this.IsInMove = 0;
this.IsInMove = -1;
this.SlvAddr = slv;
this.LLimit = 0;
this.RLimit = 0;
this.Org = 0;
this.En = 0;
this.LLimit = -1;
this.RLimit = -1;
this.Org = -1;
this.En = -1;
UpdateTime = DateTime.Now;
LastPosition = position;
}
......
......@@ -31,9 +31,9 @@ DO,相机照明开,CameraLight_Power,110,192.168.200.11,0,相机照明开,Y11,DO-11,0,
,,,113,192.168.200.11,0,,Y14,DO-14,0,
,,,114,192.168.200.11,0,,Y15,DO-15,0,
,,,115,192.168.200.11,0,,Y16,DO-16,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM4,0,,,,,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM6,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,1,COM5,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,1,COM6,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,1,COM4,0,,,,,
,温湿度传感器地址,Temperate_ServerAddress,192.168.200.14,,,,,,,
,扫码枪IP,Scanner_Ip,192.168.200.13,,,,,,,
,扫码枪端口号,Scanner_Port,51236,,,,,,,
......@@ -109,11 +109,11 @@ PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM3,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,15000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,50000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,30000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,15000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,15000,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,5000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,10000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,5000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,15000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,,
,,,,,,,,, ,
......
......@@ -456,10 +456,17 @@ namespace OnlineStore.DeviceLibrary
}
private void ComMoveToPosition(int targetPosition)
{
ComMoveToPosition(targetPosition, false);
}
private void ComMoveToPosition(int targetPosition, bool isNeedCheckSingle)
{
if (IsHasCompress_Axis)
{
LogUtil.debug("压紧轴绝对运动目标位置:"+targetPosition);
MeteringSignal.StartCheck(targetPosition, ShuoKeControls.GetABSPosition(Config.CompressAxis_Slv));
LogUtil.debug("压紧轴绝对运动目标位置:" + targetPosition);
if (isNeedCheckSingle)
{
MeteringSignal.StartCheck(targetPosition, ShuoKeControls.GetABSPosition(Config.CompressAxis_Slv));
}
StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, targetPosition, false));
ShuoKeControls.AbsMove(Config.CompressAxis_Slv, targetPosition);
Thread.Sleep(100);
......
......@@ -210,12 +210,12 @@ namespace OnlineStore.DeviceLibrary
private bool ShuoKeIsEnd(WaitResultInfo wait, out string msg)
{
bool result = false;
//bool result = false;
msg = "";
if (wait.IsHomeMove)
{
result = ShuoKeControls.IsHomeMoveEnd(wait.SlvAddr, StoreMove.LastSetpTime, out msg);
return ShuoKeControls.IsHomeMoveEnd(wait.SlvAddr, StoreMove.LastSetpTime, out msg);
}
else
{
......@@ -223,18 +223,19 @@ namespace OnlineStore.DeviceLibrary
if (isend)
{
bool isCheckOk = (MeteringSignal.TragetChangeCount <= MeteringSignal.SignalChangeCount);
if (isCheckOk)
if (isCheckOk || MeteringSignal.TragetChangeCount <= 0)
{
MeteringSignal.StopCheck();
return true;
}
else
{
msg = "压紧轴计量检测目标【" + MeteringSignal.SignalChangeCount + "】实际【" + MeteringSignal.TragetChangeCount + "】";
msg = "压紧轴计量检测目标【" + MeteringSignal.TragetChangeCount + "】实际【" + MeteringSignal.SignalChangeCount + "】";
LogUtil.error("压紧轴已经停止运动,但是 " + msg);
return true;
}
}
}
}
return false;
}
......@@ -346,7 +347,7 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("入库:SI_03 所有轴回到待机点,轴2、轴1 动作到P1,,轴4动作至P3");
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
ComMoveToPosition(moveP.ComPress_P3);
ComMoveToPosition(moveP.ComPress_P3,true);
//if (IsHasCompress_Axis)
//{
// ShuoKeControls.AbsMove(Config.CompressAxis_Slv, moveP.ComPress_P3);
......@@ -361,7 +362,7 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("入库:SI_04_CompressWare 压紧物品(有压紧轴的才需要此步骤),压紧轴至P3(压紧前点) 开始");
StoreMove.NextMoveStep(StoreMoveStep.SI_04_CompressWare);
ComMoveToPosition(moveP.ComPress_P3);
ComMoveToPosition(moveP.ComPress_P3,true);
//ShuoKeControls.AbsMove(Config.CompressAxis_Slv, moveP.ComPress_P3);
//StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, moveP.ComPress_P3, false));
}
......@@ -463,7 +464,7 @@ namespace OnlineStore.DeviceLibrary
//SendLineStatus(StoreID, posId, StoreStatus.InStoreEnd);
StoreMove.NextMoveStep(StoreMoveStep.SI_12_PutWareToBag);
ComMoveToPosition(moveP.ComPress_P3);
ComMoveToPosition(moveP.ComPress_P3,true);
//if (IsHasCompress_Axis)
//{
// ShuoKeControls.AbsMove(Config.CompressAxis_Slv, moveP.ComPress_P3);
......@@ -581,7 +582,7 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove.NextMoveStep(StoreMoveStep.SO_03_ToBagPosition);
OutStoreLog("出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)");
ComMoveToPosition(moveP.ComPress_P3);
ComMoveToPosition(moveP.ComPress_P3,true);
//if (IsHasCompress_Axis)
//{
// ShuoKeControls.AbsMove(Config.CompressAxis_Slv, moveP.ComPress_P3);
......
......@@ -225,7 +225,7 @@ namespace OnlineStore.DeviceLibrary
protected void ACAxisHomeMove(ConfigMoveAxis moveAxis)
{
moveAxis.TargetPosition = 0;
LogUtil.debug(LOGGER, moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
LogUtil.info(LOGGER, moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
AddAxisMoveTime(moveAxis);
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!