44 lines
812 B
Plaintext
44 lines
812 B
Plaintext
/*@!Encoding:1252*/
|
|
|
|
includes
|
|
{
|
|
#include "UdpCommon.cin"
|
|
#include "ModbusClientCommon.cin"
|
|
}
|
|
|
|
void ModbusConnectTo(char Remote_IP[], word Remote_Port)
|
|
{
|
|
UdpConnectTo(Remote_IP, Remote_Port);
|
|
}
|
|
|
|
void ModbusConnectTo(dword Remote_IP, word Remote_Port)
|
|
{
|
|
UdpConnectTo(Remote_IP, Remote_Port);
|
|
}
|
|
|
|
void ModbusDisconnect()
|
|
{
|
|
UdpDisconnect();
|
|
}
|
|
|
|
byte ModbusSnd(byte buffer[], word length)
|
|
{
|
|
return UdpSnd(buffer, length);
|
|
}
|
|
|
|
void ModbusRecv()
|
|
{
|
|
UdpRecv();
|
|
}
|
|
|
|
long ModbusGetLastConnectionError(char string[])
|
|
{
|
|
return UdpGetLastConnectionError(string);
|
|
}
|
|
|
|
void OnUdpReceiveFrom(dword socket, long result, dword address, dword port, byte buffer[], dword size)
|
|
{
|
|
OnModbusReceive(socket, result, address, port, buffer, size);
|
|
if (result == 0 && size != 0)
|
|
UdpRecv();
|
|
} |