From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点
---
Plugin.DODriverControl/Api/PCIController.cs | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/Plugin.DODriverControl/Api/PCIController.cs b/Plugin.DODriverControl/Api/PCIController.cs
new file mode 100644
index 0000000..76f26b3
--- /dev/null
+++ b/Plugin.DODriverControl/Api/PCIController.cs
@@ -0,0 +1,54 @@
+锘縩amespace Plugin.DODriverControl.Api
+{
+ public class PCIController : IDIOController
+ {
+ public string Name { get; set; }
+
+ private short id;
+
+ public bool Start(out string msg)
+ {
+ msg = string.Empty;
+ id = DASK.Register_Card(DaskHelper.CardType(Name), 0);
+ return id >= 0;
+ }
+
+ public bool ReadDIBool(string address, out bool res, out string msg)
+ {
+ msg = string.Empty;
+ DASK.DI_ReadLine((ushort)id, 0, ushort.Parse(address), out ushort value);
+ res = Convert.ToBoolean(value);
+ return true;
+ }
+
+ public bool ReadDOBool(string address, out bool res, out string msg)
+ {
+ msg = string.Empty;
+ DASK.DO_ReadLine((ushort)id, 0, ushort.Parse(address), out ushort value);
+ res = Convert.ToBoolean(value);
+ return true;
+ }
+
+ public bool WriteBool(string address, bool value, out string msg)
+ {
+ msg = string.Empty;
+ var res = DASK.DO_WriteLine((ushort)id, 0, ushort.Parse(address), Convert.ToUInt16(value));
+ return res == 0;
+ }
+
+ public bool Close()
+ {
+ return DASK.Release_Card((ushort)id) == 0;
+ }
+
+ public void Dispose()
+ {
+ this.Close();
+ }
+
+ public bool ReadDIDouble(string address, out double? res, out string msg)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
--
Gitblit v1.9.1