You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.5 KiB
60 lines
1.5 KiB
4 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Text;
|
||
|
using System.Threading;
|
||
|
using QMFrameWork.Common.Serialization;
|
||
|
using QMAPP.FJC.Entity.Basic;
|
||
|
|
||
|
namespace OpcServerHost
|
||
|
{
|
||
|
|
||
|
public class Class1
|
||
|
{
|
||
|
|
||
|
public delegate void DelegateName();
|
||
|
|
||
|
public void Test()
|
||
|
{
|
||
|
|
||
|
int index = 0;
|
||
|
|
||
|
while (true)
|
||
|
{
|
||
|
Thread.Sleep(5000);
|
||
|
|
||
|
|
||
|
int sum = ChatEventHelper.chatters.Count;
|
||
|
|
||
|
List<ParameterConfig> getParaList = new List<ParameterConfig>();
|
||
|
getParaList.Add(new ParameterConfig() { PARAVALUE = "B9A15112319455551127" });
|
||
|
|
||
|
if (sum > 0 && index == 0)
|
||
|
{
|
||
|
index++;
|
||
|
//定义参数信息
|
||
|
ChatEventArgs e = new ChatEventArgs();
|
||
|
//设备编号
|
||
|
e.MachineCode = "1A-CD0004";
|
||
|
//传输参数的类别
|
||
|
e.MessageType = "0";// OpcEnumGeter.MESSAGETYPE.PRODUCTCODE.GetHashCode().ToString();
|
||
|
//传输参数的内容
|
||
|
e.MessageContent = JsonConvertHelper.GetSerializes(getParaList);
|
||
|
|
||
|
OpcService opcService = new OpcService();
|
||
|
opcService.ReturnProductCodeToMachine(e);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
public void CallBackMethod(IAsyncResult ar)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|