|
|
|
@ -1414,7 +1414,7 @@ void Buban104SendCmdFormPollCmdBuf(int commid)
|
|
|
|
|
if (isUdpSocketExist() == TRUE)
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
if (buf[4] & 0x01)
|
|
|
|
|
/*if (buf[4] & 0x01)
|
|
|
|
|
{
|
|
|
|
|
// format_s
|
|
|
|
|
if ((buf[4] & 0x02) == 0)
|
|
|
|
@ -1436,8 +1436,8 @@ void Buban104SendCmdFormPollCmdBuf(int commid)
|
|
|
|
|
//发送数据后应当立即将发送序号+1,而不应当在清除命令时+1
|
|
|
|
|
pPortParam->wSendSequence++;
|
|
|
|
|
pPortParam->wSendSequence %= MAX_SEQUENCE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
pPortParam->bSendFormatI = TRUE;
|
|
|
|
|
SendDataToPort(commid, (char *)&buf[2], len - 2);
|
|
|
|
|
|
|
|
|
|
pPortParam->m_psBaoHu->SendCmdFlag = 1;
|
|
|
|
@ -2998,7 +2998,7 @@ void ProvBuban104FormatI(int commid, RTUMSG *rtumsg)
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
iSequenceInc = pPortParam->wSendSequence - pPortParam->wAckSequence;
|
|
|
|
|
if (iSequenceInc < 0)
|
|
|
|
|
/*if (iSequenceInc < 0)
|
|
|
|
|
{
|
|
|
|
|
iSequenceInc += MAX_SEQUENCE;
|
|
|
|
|
}
|
|
|
|
@ -3012,11 +3012,11 @@ void ProvBuban104FormatI(int commid, RTUMSG *rtumsg)
|
|
|
|
|
{
|
|
|
|
|
pPortParam->bCloseSocket = FALSE;
|
|
|
|
|
pPortParam->bAckRight = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
|
|
|
|
|
|
|
|
|
|
pPortParam->wRecvSequence = ((rtumsg->MsgData[2] + (rtumsg->MsgData[3] << 8)) >> 1) + 1;
|
|
|
|
|
pPortParam->wRecvSequence %= MAX_SEQUENCE;
|
|
|
|
|
//pPortParam->wRecvSequence = ((rtumsg->MsgData[2] + (rtumsg->MsgData[3] << 8)) >> 1) + 1;
|
|
|
|
|
//pPortParam->wRecvSequence %= MAX_SEQUENCE;
|
|
|
|
|
|
|
|
|
|
switch (rtumsg->MsgData[6])
|
|
|
|
|
{
|
|
|
|
@ -4705,7 +4705,7 @@ void ProvBuban104SendAIwithFloat(int commid, RTUMSG *rtumsg, int iGroupNo)
|
|
|
|
|
commandbuf[iLenth++] = 1; // 描述类别KOD(实际值)
|
|
|
|
|
commandbuf[iLenth++] = 7; // 数据类型
|
|
|
|
|
commandbuf[iLenth++] = 4; // 数据宽度
|
|
|
|
|
commandbuf[iLenth++] = 4; // 数据数目
|
|
|
|
|
commandbuf[iLenth++] = 0x83; // 数据数目
|
|
|
|
|
commandbuf[iLenth++] = sCurTime.mSec % 256;
|
|
|
|
|
commandbuf[iLenth++] = sCurTime.mSec / 256;
|
|
|
|
|
commandbuf[iLenth++] = (u_char)sCurTime.Min;
|
|
|
|
@ -4731,13 +4731,13 @@ void ProvBuban104SendAIwithFloat(int commid, RTUMSG *rtumsg, int iGroupNo)
|
|
|
|
|
printf("get total %d item!\n", i);
|
|
|
|
|
i = iAllDataCount;
|
|
|
|
|
}
|
|
|
|
|
if (i >= iAllDataCount)
|
|
|
|
|
/*if (i >= iAllDataCount)
|
|
|
|
|
{
|
|
|
|
|
commandbuf[14] = j; // 通用分类数据集数目NGD
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
commandbuf[14] = (j | 0x80); // 通用分类数据集数目NGD
|
|
|
|
|
|
|
|
|
|
commandbuf[14] = (j | 0x80);*/ // 通用分类数据集数目NGD
|
|
|
|
|
commandbuf[14] = j; // 通用分类数据集数目NGD
|
|
|
|
|
commandbuf[1] = (char)(iLenth - 2);
|
|
|
|
|
|
|
|
|
|
PutPollCmdToBuf(commid, iCmdType, 0, (char *)commandbuf, iLenth);
|
|
|
|
@ -4848,14 +4848,14 @@ void ProvBuban104Send103DI(int commid, RTUMSG *rtumsg, int iGroupNo)
|
|
|
|
|
commandbuf[11] = 254; // 功能类型FUN
|
|
|
|
|
commandbuf[12] = 241; // 信息序号INF
|
|
|
|
|
commandbuf[13] = 0; // 返回信息标识码RII
|
|
|
|
|
commandbuf[14] = 0x81; // 通用分类数据集数目NGD
|
|
|
|
|
commandbuf[14] = 0x01; // 通用分类数据集数目NGD
|
|
|
|
|
iLenth = 15;
|
|
|
|
|
commandbuf[iLenth++] = igno0;
|
|
|
|
|
commandbuf[iLenth++] = iItemNo0;
|
|
|
|
|
commandbuf[iLenth++] = 1; // 描述类别KOD(实际值)
|
|
|
|
|
commandbuf[iLenth++] = 7; // 数据类型
|
|
|
|
|
commandbuf[iLenth++] = 4; // 数据宽度
|
|
|
|
|
commandbuf[iLenth++] = 4; // 数据数目
|
|
|
|
|
commandbuf[iLenth++] = 0x83; // 数据数目
|
|
|
|
|
commandbuf[iLenth++] = sCurTime.mSec % 256;
|
|
|
|
|
commandbuf[iLenth++] = sCurTime.mSec / 256;
|
|
|
|
|
commandbuf[iLenth++] = (u_char)sCurTime.Min;
|
|
|
|
|