public PLC(ModbusCommunicator modbusCommunicator, int id) { this.Id = id; this.Ip = modbusCommunicator.IP_Address; this.Port = modbusCommunicator.IP_Port; this.CommType = modbusCommunicator.Type; this.modbusCommunicator = modbusCommunicator; }
/// <summary> /// Initializes the necessary objects /// </summary> public void Init() { modbusCommunicator = new ModbusCommunicator() { IP_Address = Ip, IP_Port = Port, SerialPort_PortName = SerialPort, SerialPort_BaudRate = BaudRate, SerialPort_DataBits = DataBits, SerialPort_Parity = Parity, SerialPort_StopBits = StopBits, Type = CommType, ResponceTimeout = 1000 }; }
public void Init(ModbusCommunicator modbusCommunicator) { this.modbusCommunicator = modbusCommunicator; }