![]() Network.ListenAsync().GetAwaiter().GetResult() IModbusSlave slave2 = factory.CreateSlave(2) IModbusSlave slave1 = factory.CreateSlave(1) IModbusSlaveNetwork network = factory.CreateSlaveNetwork(slaveTcpListener) IModbusFactory factory = new ModbusFactory() TcpListener slaveTcpListener = new TcpListener(address, port) IModbusMaster master = factory.CreateMaster(client) īool inputs = master.ReadInputs(0, startAddress, numInputs) Ĭonsole.WriteLine($"Input ) I've attached both codes below, which are snippets from the NMODBUS sample program on github. I have them connected via an Ethernet cable, and have an instance of Visual studio running C# on each of them. ![]() In order to learn how to use Modbus, I've been trying to set up two computers I have to communicate between each other.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |