2014-05-08 16:44:01 +02:00
|
|
|
/*@!Encoding:1252*/
|
|
|
|
|
|
|
|
includes
|
|
|
|
{
|
|
|
|
#include "TcpCommon.cin"
|
2014-05-09 15:39:16 +02:00
|
|
|
#include "ModbusClientCommon.cin"
|
2014-05-08 16:44:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void ModbusConnectTo(char Remote_IP[], word Remote_Port)
|
|
|
|
{
|
2014-05-21 13:26:45 +02:00
|
|
|
TcpConnectTo(Remote_IP, Remote_Port);
|
2014-05-08 16:44:01 +02:00
|
|
|
}
|
|
|
|
|
2014-05-21 13:38:59 +02:00
|
|
|
void ModbusConnectTo(dword Remote_IP, word Remote_Port)
|
|
|
|
{
|
|
|
|
TcpConnectTo(Remote_IP, Remote_Port);
|
|
|
|
}
|
|
|
|
|
2014-05-21 13:26:45 +02:00
|
|
|
void ModbusSnd(byte buffer[], word length)
|
2014-05-12 10:46:53 +02:00
|
|
|
{
|
|
|
|
TcpSnd(buffer, length);
|
2014-05-08 16:44:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void ModbusRecv()
|
|
|
|
{
|
|
|
|
TcpRecv();
|
|
|
|
}
|
|
|
|
|
|
|
|
void OnTcpReceive(dword socket, long result, dword address, dword port, byte buffer[], dword size)
|
|
|
|
{
|
2014-05-12 10:46:53 +02:00
|
|
|
OnModbusReceive(socket, result, address, port, buffer, size);
|
|
|
|
if (result == 0 && size != 0)
|
|
|
|
TcpRecv();
|
2014-05-08 16:44:01 +02:00
|
|
|
}
|