Jonny007-MKD
dde6cef26f
Removed the 9 seperate times Introduced pending, sent and ack stacks to allow concurrent requests Introduced timer gtRobin that monitors the stacks, sends the packets and checks for timeouts Modbus/include/ModbusCommonStructs.cin added enum ModbusFuncCode Modbus/include/ModbusFunctions.cin fixed analog modules Modbus/include/TcpCommon.cin don't use local ip anymore Modbus/ModbusClientUDP.can no state machine for reading configuration :)
29 lines
No EOL
542 B
Text
29 lines
No EOL
542 B
Text
/*@!Encoding:1252*/
|
|
|
|
includes
|
|
{
|
|
#include "TcpCommon.cin"
|
|
#include "ModbusClientCommon.cin"
|
|
}
|
|
|
|
void ModbusConnectTo(char Remote_IP[], word Remote_Port)
|
|
{
|
|
TcpConnectTo(Remote_IP, Remote_Port);
|
|
}
|
|
|
|
void ModbusSnd(byte buffer[], word length)
|
|
{
|
|
TcpSnd(buffer, length);
|
|
}
|
|
|
|
void ModbusRecv()
|
|
{
|
|
TcpRecv();
|
|
}
|
|
|
|
void OnTcpReceive(dword socket, long result, dword address, dword port, byte buffer[], dword size)
|
|
{
|
|
OnModbusReceive(socket, result, address, port, buffer, size);
|
|
if (result == 0 && size != 0)
|
|
TcpRecv();
|
|
} |