Commit dfaf7cc6 authored by Claes Sjofors's avatar Claes Sjofors

UDP IO bugfix and template values for error limits set

parent b213361d
...@@ -116,7 +116,7 @@ pwr_tStatus udp_recv_data( io_sLocalUDP_IO *local, io_sCard *cp, ...@@ -116,7 +116,7 @@ pwr_tStatus udp_recv_data( io_sLocalUDP_IO *local, io_sCard *cp,
sts = 1; sts = 1;
/* while (sts > 0) */ while (sts > 0)
{ {
FD_ZERO(&fdr); FD_ZERO(&fdr);
FD_ZERO(&fdw); FD_ZERO(&fdw);
...@@ -134,14 +134,20 @@ pwr_tStatus udp_recv_data( io_sLocalUDP_IO *local, io_sCard *cp, ...@@ -134,14 +134,20 @@ pwr_tStatus udp_recv_data( io_sLocalUDP_IO *local, io_sCard *cp,
op->Status = IOM__UDP_DOWN; op->Status = IOM__UDP_DOWN;
// close(local->socket); // close(local->socket);
errh_Error( "Connection lost to modbus slave, %s", cp->Name); errh_Error( "Connection lost to modbus slave, %s", cp->Name);
return IO__SUCCESS; if ( received)
return IO__SUCCESS;
else
return 0;
} }
if (!(FD_ISSET(local->socket, &fdw))) { if (!(FD_ISSET(local->socket, &fdw))) {
op->Status = IOM__UDP_DOWN; op->Status = IOM__UDP_DOWN;
// close(local->socket); // close(local->socket);
errh_Error( "Connection down to modbus slave, %s", cp->Name); errh_Error( "Connection down to modbus slave, %s", cp->Name);
return IO__SUCCESS; if ( received)
return IO__SUCCESS;
else
return 0;
} }
tv.tv_sec = 0; tv.tv_sec = 0;
...@@ -158,7 +164,10 @@ pwr_tStatus udp_recv_data( io_sLocalUDP_IO *local, io_sCard *cp, ...@@ -158,7 +164,10 @@ pwr_tStatus udp_recv_data( io_sLocalUDP_IO *local, io_sCard *cp,
op->Status = IOM__UDP_DOWN; op->Status = IOM__UDP_DOWN;
// close(local->socket); // close(local->socket);
errh_Error( "Connection lost to modbus slave, %s", cp->Name); errh_Error( "Connection lost to modbus slave, %s", cp->Name);
return IO__SUCCESS; if ( received)
return IO__SUCCESS;
else
return 0;
} }
if (sts == 0) { if (sts == 0) {
...@@ -175,14 +184,20 @@ pwr_tStatus udp_recv_data( io_sLocalUDP_IO *local, io_sCard *cp, ...@@ -175,14 +184,20 @@ pwr_tStatus udp_recv_data( io_sLocalUDP_IO *local, io_sCard *cp,
op->Status = IOM__UDP_DOWN; op->Status = IOM__UDP_DOWN;
// close(local->socket); // close(local->socket);
errh_Error( "UDP IO Connection lost, %s", cp->Name); errh_Error( "UDP IO Connection lost, %s", cp->Name);
return IO__SUCCESS; if ( received)
return IO__SUCCESS;
else
return 0;
} }
if (data_size == 0) { if (data_size == 0) {
op->Status = IOM__UDP_DOWN; op->Status = IOM__UDP_DOWN;
// close(local->socket); // close(local->socket);
errh_Error( "UDP IO Connection down, %s", cp->Name); errh_Error( "UDP IO Connection down, %s", cp->Name);
return IO__SUCCESS; if ( received)
return IO__SUCCESS;
else
return 0;
} }
if ( data_size < buf_size) { if ( data_size < buf_size) {
......
...@@ -4575,12 +4575,14 @@ Volume OtherIO $ClassVolume 0.0.250.10 ...@@ -4575,12 +4575,14 @@ Volume OtherIO $ClassVolume 0.0.250.10
EndBody EndBody
EndObject EndObject
Object Template UDP_IO 2153742336 01-JAN-1970 01:00:00.00 Object Template UDP_IO 2153742336 01-JAN-1970 01:00:00.00
Body RtBody 20-MAY-2011 14:29:46.64 Body RtBody 07-JUL-2011 16:16:10.56
Attr Process = 1 Attr Process = 1
Attr Device = "eth0" Attr Device = "eth0"
Attr LinkTimeout = 3.000000e+00 Attr LinkTimeout = 3.000000e+00
Attr ReconnectTime = 2.000000e+00 Attr ReconnectTime = 2.000000e+00
Attr KeepAliveTime = 1.000000e+00 Attr KeepAliveTime = 1.000000e+00
Attr ErrorSoftLimit = 50
Attr ErrorHardLimit = 100
EndBody EndBody
EndObject EndObject
EndObject EndObject
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment