diff --git a/Modbus/ModbusTcpCommon.cin b/Modbus/ModbusTcpCommon.cin index 05629c2..7c902b9 100644 --- a/Modbus/ModbusTcpCommon.cin +++ b/Modbus/ModbusTcpCommon.cin @@ -58,7 +58,7 @@ void ModbusReadBits(word address, word count) ModbusMakeHeader(mbr.Header, length); // Payload - mbr.Header.FuncCode = 0x01; // [1] Function Code; 1: Read Coils (DI), 2: Read Discret Inputs (DIO), seems to be the same for WAGO 750-881 + mbr.Header.FuncCode = 0x01; // [1] Function Code; 1: Read Coils (DI), 2: Read Discret Inputs (DIO), seems to be the same for WAGO 750-881 mbr.Address = address; // [2] Start address mbr.Count = count; // [2] Number of items; 1:max 2000=0x7D0 diff --git a/Modbus/socket.can b/Modbus/socket.can index 682f63b..f97b8b1 100644 --- a/Modbus/socket.can +++ b/Modbus/socket.can @@ -2,7 +2,7 @@ includes { - #include "ModbusCommon.cin" + #include "ModbusTcpCommon.cin" } variables @@ -26,6 +26,11 @@ on start ModbusInit("192.168.1.3", 502); } +on key 'r' +{ + ModbusReadBits(0, 512); +} + on key 'a' { byte x[16] = {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0};