Commit d070f186 authored by Claes Sjofors's avatar Claes Sjofors

IO Modbus TCP ScanInterval bugfix

parent 10bbaaf9
...@@ -400,6 +400,7 @@ pwr_tStatus mb_send_data(io_sRackLocal *local, ...@@ -400,6 +400,7 @@ pwr_tStatus mb_send_data(io_sRackLocal *local,
pwr_tCid cid; pwr_tCid cid;
int modules; int modules;
int i; int i;
int next_card;
/* Send messages to slave */ /* Send messages to slave */
...@@ -429,6 +430,7 @@ pwr_tStatus mb_send_data(io_sRackLocal *local, ...@@ -429,6 +430,7 @@ pwr_tStatus mb_send_data(io_sRackLocal *local,
continue; continue;
} }
next_card = 0;
for ( i = 0; i < modules; i++) { for ( i = 0; i < modules; i++) {
sts = 1; sts = 1;
...@@ -438,8 +440,8 @@ pwr_tStatus mb_send_data(io_sRackLocal *local, ...@@ -438,8 +440,8 @@ pwr_tStatus mb_send_data(io_sRackLocal *local,
local_card = &((io_sCardLocal *)cardp->Local)->msg[i]; local_card = &((io_sCardLocal *)cardp->Local)->msg[i];
if ( mp->ScanInterval > 1 && local_card->interval_cnt != 0) { if ( mp->ScanInterval > 1 && local_card->interval_cnt != 0) {
cardp = cardp->next; next_card = 1;
continue; break;
} }
if (mask & mb_mSendMask_ReadReq) { if (mask & mb_mSendMask_ReadReq) {
...@@ -645,6 +647,11 @@ pwr_tStatus mb_send_data(io_sRackLocal *local, ...@@ -645,6 +647,11 @@ pwr_tStatus mb_send_data(io_sRackLocal *local,
mp++; mp++;
} }
if ( next_card) {
cardp = cardp->next;
continue;
}
if (sts < 0) { if (sts < 0) {
sp->Status = MB__CONNDOWN; sp->Status = MB__CONNDOWN;
close(local->s); close(local->s);
......
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