using DoWhatPlc; using DtWebApi; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DtWebApi { public class OpcDemo { public static HashtableList GetHashtableList() { try { string api = ""; string type = "GET"; string controlStr = "PLC1"; string actionStr = "GetHashtableList"; Dictionary dic = new Dictionary(); var rc = new CallWebApi().InvokeWebapiHashtableList(controlStr, actionStr, api, type, dic); return rc; } catch (Exception err) { return new HashtableList(); } } public static List ReadPLC_GroupMonitor(string opName) { string api = ""; string type = "GET"; string controlStr = "PLC1"; string actionStr = "ReadPLC_GroupMonitor"; Dictionary dic = new Dictionary(); dic.Add("opName", opName); var rc = new CallWebApi().InvokeWebapiListTagFormat(controlStr, actionStr, api, type, dic); return rc; } public static List ReadPLC_GroupData_Qd(string opName) { string api = ""; string type = "GET"; string controlStr = "PLC1"; string actionStr = "ReadPLC_GroupData_Qd"; Dictionary dic = new Dictionary(); dic.Add("opName", opName); var rc = new CallWebApi().InvokeWebapiListTagFormat(controlStr, actionStr, api, type, dic); return rc; } public static List ReadPLC_GroupData(string opName) { string api = ""; string type = "GET"; string controlStr = "PLC1"; string actionStr = "ReadPLC_GroupData"; Dictionary dic = new Dictionary(); dic.Add("opName", opName); var rc = new CallWebApi().InvokeWebapiListTagFormat(controlStr, actionStr, api, type, dic); return rc; } public static List Get_opNameList() { string api = ""; string type = "GET"; string controlStr = "PLC1"; string actionStr = "Get_opNameList"; Dictionary dic = new Dictionary(); var rc = new CallWebApi().InvokeWebapiListString(controlStr, actionStr, api, type, dic); return rc; } public static List Get_ipList() { string api = ""; string type = "GET"; string controlStr = "PLC1"; string actionStr = "Get_ipList"; Dictionary dic = new Dictionary(); var rc = new CallWebApi().InvokeWebapiListString(controlStr, actionStr, api, type, dic); return rc; } public static ConcurrentDictionary Get_TagAdrListTagFormat(string ip, string group) { string api = ""; string type = "GET"; string controlStr = "PLC1"; string actionStr = "Get_TagAdrListTagFormat"; Dictionary dic = new Dictionary(); dic.Add("ip", ip); dic.Add("group", group); var rc = new CallWebApi().InvokeWebapiConcurrentDictionaryTagFormat(controlStr, actionStr, api, type, dic); return rc; } public static ConcurrentDictionary ReadTagValue_tagAdrListTagFormat(string readWhat, string opOrIp) { string api = ""; string type = "GET"; string controlStr = "PLC1"; string actionStr = "ReadTagValue_tagAdrListTagFormat"; Dictionary dic = new Dictionary(); dic.Add("readWhat", readWhat); dic.Add("opOrIp", opOrIp); var rc = new CallWebApi().InvokeWebapiConcurrentDictionaryTagFormat(controlStr, actionStr, api, type, dic); return rc; } } }