This commit is contained in:
parent
4484ed15fb
commit
71c556b75c
2 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
|
Loading…
Reference in a new issue