From df03213660361b1c771f0a3f21b6ddaeaef7763a Mon Sep 17 00:00:00 2001 From: QuakeGod <quakegod@sina.com> Date: 星期二, 05 九月 2023 11:44:52 +0800 Subject: [PATCH] add ladder to prog 1 --- KLink1/KLink.cpp | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/KLink1/KLink.cpp b/KLink1/KLink.cpp index cb0eed8..b921e64 100644 --- a/KLink1/KLink.cpp +++ b/KLink1/KLink.cpp @@ -136,6 +136,13 @@ // dlg.DoModal(); */ CDialogCommSet1 dialog1; + if (m_bCommParamSet) + { + dialog1.m_nComNum = m_nPort; + dialog1.m_nBaudRate = m_nBaudRate; + dialog1.m_Settings = m_Settings; + dialog1.m_bOpened = m_bOpened; + } INT_PTR r = dialog1.DoModal(); //方法2的状态还原 @@ -1187,7 +1194,7 @@ return res; } -int KLink1::GetMode(UCHAR nDst, UCHAR nType) +int KLink1::GetMode(UCHAR nDst, UCHAR nType, UCHAR * value) { int res = KL_OK; // res = ReadDataByte(nDst, 4, KLDataTypeSDT, 36, (UCHAR *)pValue); @@ -1201,6 +1208,7 @@ unsigned char nCmd; unsigned short nnCount = 0; res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf); + if (nnCount > 0) { *value = m_DataBuf[0]; } return res; } -- Gitblit v1.9.1