From db25c9f050a690bbec032ef3f93e244c7ec2dbee Mon Sep 17 00:00:00 2001 From: QuakeGod <quakegod@sina.com> Date: 星期五, 26 五月 2023 09:30:59 +0800 Subject: [PATCH] PLCFunction fix2 --- Src/KLink.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Src/KLink.c b/Src/KLink.c index 623fba0..c2ad037 100644 --- a/Src/KLink.c +++ b/Src/KLink.c @@ -194,7 +194,7 @@ PacketLen=KLMakeRplyPacket(p2,nDstHost,nKLStatus.StatByte,p1->nCMD,0,0); SendPacket(nChn, p2, PacketLen); break; - + case KLCmdRead: case KLCmdReadDataWord: case KLCmdReadDataByte: @@ -292,7 +292,10 @@ case KLCmdWriteBits: break; case KLCmdChgMode: - + if (nDataType ==0) {StopPLC();} + if (nDataType == 1) {StartPLC();} + PacketLen=KLMakeRplyPacket(p2,nDstHost,nKLStatus.StatByte,p1->nCMD,0,0); + SendPacket(nChn, p2, PacketLen); break; case KLCmdReadProgram: nWordAddr=p1->Params[0]+ (p1->Params[1]<<8); -- Gitblit v1.9.1