Commit 83a913a0 authored by Claes Sjofors's avatar Claes Sjofors

Remote remnode QCom fix

parent 5c7e21f8
......@@ -127,14 +127,14 @@ unsigned int qcom_receive()
search_remtrans = false;
sts = RemTrans_Receive(remtrans, (char *) get.data, get.size);
if (sts != STATUS_OK && sts != STATUS_BUFF)
errh_Error("Error from RemTrans_Receive, queue %d, status %d", rn_qcom->MyQueue, sts, 0);
errh_Error("Error from RemTrans_Receive, queue %d, status %d", rn_qcom->ReceiveQueue, sts, 0);
break;
}
remtrans = (remtrans_item *) remtrans->next;
}
if (search_remtrans) {
rn_qcom->ErrCount++;
errh_Info("No remtrans for received message, queue %d, class ", rn_qcom->MyQueue, get.type.s, 0);
errh_Info("No remtrans for received message, queue %d, class ", rn_qcom->ReceiveQueue, get.type.s, 0);
}
if ( get.data)
......@@ -180,10 +180,13 @@ unsigned int qcom_send(remnode_item *remnode,
put.reply.qix = 0;
put.reply.nid = 0;
if ( remtrans->ReplacePrev)
put.msg_id = remtrans->Address[0] + 1;
qcom_Put(&sts, &target_qid, &put);
if ( EVEN(sts)) {
remtrans->ErrCount++;
errh_Error("Send failed, queue %d, QCom status %d", rn_qcom->MyQueue, sts, 0);
errh_Error("Send failed, queue %d, QCom status %d", rn_qcom->ReceiveQueue, sts, 0);
if (debug) printf("Send failed sts:%d\n", (int) sts);
}
......@@ -257,7 +260,7 @@ int main(int argc, char *argv[])
exit(sts);
}
if ( !rn_qcom->MyQueue && !rn_qcom->TargetQueue) {
if ( !rn_qcom->ReceiveQueue && !rn_qcom->TargetQueue) {
errh_Fatal("Process terminated, neither send or receive queue configured, %s", id);
errh_SetStatus(PWR__SRVTERM);
exit(sts);
......@@ -289,14 +292,14 @@ int main(int argc, char *argv[])
}
/* Create queue */
if ( rn_qcom->MyQueue) {
if ( rn_qcom->ReceiveQueue) {
qattr.type = qcom_eQtype_private;
qattr.quota = 100;
local_qid.nid = 0;
local_qid.qix = rn_qcom->MyQueue;
local_qid.qix = rn_qcom->ReceiveQueue;
sprintf( queue_name, "RemQue%d", rn_qcom->MyQueue);
sprintf( queue_name, "RemQue%d", rn_qcom->ReceiveQueue);
qcom_CreateQ(&sts, &local_qid, &qattr, queue_name);
if ( sts == QCOM__QALLREXIST) {
......@@ -354,7 +357,7 @@ int main(int argc, char *argv[])
}
aproc_TimeStamp(TIME_INCR, 5);
if ( rn_qcom->MyQueue)
if ( rn_qcom->ReceiveQueue)
sts = qcom_receive();
else
RemoteSleep(TIME_INCR);
......
......@@ -86,7 +86,7 @@ SObject Remote:Class
! Number for queue used to receive messages on the current node.
! Can be set to 0 if no receive transactions exist.
!*/
Object MyQueue $Attribute 3
Object ReceiveQueue $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Int32"
EndBody
......@@ -199,10 +199,6 @@ SObject Remote:Class
Object Template RemnodeQCom
Body RtBody
Attr Prio = 15
Attr MyQueue = 0
Attr TargetQueue = 0
Attr Disable = 0
Attr RestartCount = 0
Attr RestartLimit = 100
Attr ScanTime = 0.1
Attr Id = "QCom"
......
......@@ -131,13 +131,13 @@ SObject Remote:Class
! The WF_DQF delivery mode delivers the message to the remote
! recovery journal and blocks for verification or timeout.
! The NN_MEM delivery mode delivers the message to the
! destination queue and doesn\u2019t wait for any verification at all.
! destination queue and doesn't wait for any verification at all.
! The SAF function puts the message in the local recovery journal
! if the link is down. When using SAF, DMQ handles the
! retransmission meaning that we (Proview) can forget the
! message and treat it as sent. This works on DMQ 3.2 but is not
! supported in the earlier version 3.0.
! The DISC function tells DMQ to discard the message if it isn\u2019t
! The DISC function tells DMQ to discard the message if it isn't
! deliverable. Can be used with WF_DQF along with the remote
! buffering mechanism.
! For a deeper description of delivery modes, consult the DMQ
......@@ -233,6 +233,17 @@ SObject Remote:Class
EndBody
EndObject
!/**
! When set, old messages in the outgoing buffer are replace by new ones.
! This can be used for cyclic transactions and ensures that the outgoing buffer
! is not filled with obsolete messages in times of bad network.
! Only implemented for QCom.
!*/
Object ReplacePrev $Attribute 19
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Current number or stored messages.
! For incoming messages this indicates the number of messages waiting
! to be taken by the PLC-process. For outgoing messages it tells the
......
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