using LT.Utils.Json;
|
using System.Collections.Generic;
|
|
namespace OPCConnection
|
{
|
internal class Commond
|
{
|
private const string Cmd_STX = "02h";
|
private const string Cmd_End = "\r\n";
|
|
|
/// <summary>
|
/// 创建请求命令
|
/// </summary>
|
/// <param name="Code"></param>
|
/// <param name="Parameters"></param>
|
/// <returns></returns>
|
public static string BuildCmd(string Code, List<string> Parameters)
|
{
|
string str = "02h;" + Code + ";";
|
foreach (string str2 in Parameters)
|
{
|
str = str + str2 + ";";
|
}
|
return (str + "\r\n");
|
}
|
|
/// <summary>
|
/// 创建请求命令
|
/// </summary>
|
/// <param name="_object"></param>
|
/// <returns></returns>
|
public static string BuildCmdScada(object _object) =>
|
JsonExtensions.ToJson(_object, false, false, false);
|
}
|
|
}
|