This commit is contained in:
Jonny007-MKD 2014-05-08 14:07:38 +00:00
parent 4484ed15fb
commit 71c556b75c
2 changed files with 7 additions and 2 deletions

View file

@ -58,7 +58,7 @@ void ModbusReadBits(word address, word count)
ModbusMakeHeader(mbr.Header, length); ModbusMakeHeader(mbr.Header, length);
// Payload // 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.Address = address; // [2] Start address
mbr.Count = count; // [2] Number of items; 1:max 2000=0x7D0 mbr.Count = count; // [2] Number of items; 1:max 2000=0x7D0

View file

@ -2,7 +2,7 @@
includes includes
{ {
#include "ModbusCommon.cin" #include "ModbusTcpCommon.cin"
} }
variables variables
@ -26,6 +26,11 @@ on start
ModbusInit("192.168.1.3", 502); ModbusInit("192.168.1.3", 502);
} }
on key 'r'
{
ModbusReadBits(0, 512);
}
on key 'a' on key 'a'
{ {
byte x[16] = {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}; byte x[16] = {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0};