alielie
2026-03-02 12e606635c42ea20f4b7c2bdda5204237a4b4c96
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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);
    }
 
}