SCLS/SSWCS_JXDL(2019)/BarcodeCheck/CSendDeviceOrder.cs
2025-05-19 09:45:29 +08:00

152 lines
4.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Threading;
using ICommLayer;
using DBFactory;
namespace BarcodeCheck
{
/// <summary>
/// 条码比对的通讯接口派生类
/// 发送设备命令类
/// 创建者Richard.Liu
/// </summary>
public class CSendDeviceOrder: ISendDeviceOrder
{
string _commLayerError;
public string CommLayerError
{
get { return _commLayerError; }
set { _commLayerError = value; }
}
DBOperator dbo = new DBOperator();
public CSendDeviceOrder()
{
dbo.Open();
}
//~CSendDeviceOrder()
//{
// dbo.Close();
//}
/// <summary>
/// 发送堆垛机命令
/// </summary>
/// <param name="MessageIndex">消息编号</param>
/// <param name="TaskIndex">任务编号</param>
/// <param name="Order">堆垛机命令字</param>
///单叉单进伸:
///1-复位
///2-将取
///3-将送
///4-取货
///5-放货
///6-取放货
///双叉单进伸:
///1-复位
///2-将取
///3-将送
///4-左叉取货
///5-左叉放货
///6-左叉取放货
///14-右叉取货
///15-右叉放货
///16-右叉取放货
///24-双叉取货
///25-双叉放货
///26-双叉取放货
///单叉双进伸:
///1-复位
///2-将取
///3-将送
///4-近位取货
///5-近位放货
///6-近位取放货
///14-远位取货
///15-远位放货
///16-远位取放货
/// <param name="DeviceIndex">设备编号</param>
/// <param name="StartX">起始x坐标排-沿轨道方向</param>
/// <param name="StartY">起始y坐标层-高度方向</param>
/// <param name="StartZ">起始z坐标列-面向堆垛机操作面板1-左侧2-右侧</param>
/// <param name="EndX">目标x坐标排-沿轨道方向</param>
/// <param name="EndY">目标y坐标层-高度方向</param>
/// <param name="EndZ">目标z坐标列-面向堆垛机操作面板1-左侧2-右侧</param>
/// <returns>发送堆垛机命令是否成功</returns>
public bool SendDeviceOrder(int MessageIndex, int TaskIndex, int Order, int DeviceIndex, int StartX, int StartY, int StartZ, int EndX, int EndY, int EndZ)
{
try
{
return true;
}
catch (Exception ex)
{
_commLayerError = "VirtualStation.CSendDeviceOrder" + ":SendDeviceOrder---" + ex.Message;
return false;
}
}
/// <summary>
/// 发送堆垛机以外的其它设备命令
/// </summary>
/// <param name="MessageIndex">消息编号</param>
/// <param name="TaskIndex">任务编号</param>
/// <param name="Order">命令字</param>
/// 穿梭车命令字:
///1-复位
///2-左接货
///3-左送货
///4-右接货
///5-右送货
///6-停止
///7-运动到1#位置
///8-运动到2#位置
/// …
///输送机、台车命令字:
///1-入库(朝向库)
/// 2-出库(背向库)
/// 3-送货
/// 4-停止
/// <param name="DeviceIndex">设备编号</param>
/// <returns>发送其它设备命令是否成功</returns>
public bool SendDeviceOrder(int MessageIndex, int TaskIndex, int Order, int DeviceIndex, int ArrowDeviceIndex)
{
try
{
return true;
}
catch (Exception ex)
{
_commLayerError = "VirtualStation.CSendDeviceOrder" + ":SendDeviceOrder---" + ex.Message;
return false;
}
}
public bool SendDeviceOrder(int DeviceIndex, string TobaccoCode, bool HaveFirstProjectCode, bool IfSmallTobacco,int Count)
{
try
{
return true;
}
catch (Exception ex)
{
_commLayerError = "VirtualStation.CSendDeviceOrder" + ":SendDeviceOrder---" + ex.Message;
return false;
}
}
/// <summary>
/// 向PLC的DB区写入数据
/// </summary>
/// <param name="ItemNames">标签变量名称数组</param>
/// <param name="ItemValues">标签值数组</param>
/// <returns></returns>
public bool WriteDBData(string[] ItemNames, string[] ItemValues)
{
return true;
}
}
}