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.
45 lines
1.2 KiB
45 lines
1.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace QM.Exchange.Adapters.OPC
|
|
{
|
|
/// <summary>
|
|
/// OPCSERVER适配器客户端
|
|
/// </summary>
|
|
public class OPCAdapter
|
|
{
|
|
#region 通过opcserver获取plc数据
|
|
|
|
/// <summary>
|
|
/// 通过opcserver获取plc数据
|
|
/// </summary>
|
|
/// <param name="odData">请求</param>
|
|
/// <returns>返回结果</returns>
|
|
public OPCService.OPCResult ReadData(OPCService.OpcDeviceData odData)
|
|
{
|
|
OPCService.MainServiceClient client = new OPCService.MainServiceClient();
|
|
|
|
return client.ReadData(odData);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 通过opcserver写入plc数据
|
|
|
|
/// <summary>
|
|
/// 通过opcserver写入plc数据
|
|
/// </summary>
|
|
/// <param name="odData">请求</param>
|
|
/// <returns>返回结果</returns>
|
|
public OPCService.OPCResult WriteData(OPCService.OpcDeviceData odData)
|
|
{
|
|
OPCService.MainServiceClient client = new OPCService.MainServiceClient();
|
|
|
|
return client.WriteData(odData);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|
|
|