private static void EnsureNode(byte nodeAddr) { var childName = $"Node{nodeAddr}"; DictModbusItems.TryAdd(childName, new ModbusNode { Key = childName }); }
private static void EnsureModbusHR(byte nodeAddr, int addr) { EnsureNode(nodeAddr); var childName = $"Node{nodeAddr}.HR{addr}"; DictModbusItems.TryAdd(childName, new ModbusHoldingRegister { Key = childName }); }
private static void EnsureModbusAI(byte nodeAddr, int addr) { EnsureNode(nodeAddr); var childName = $"Node{nodeAddr}.AI{addr}"; DictModbusItems.TryAdd(childName, new ModbusAnalogInput { Key = childName }); }