From a9e6702525218c473b9d2c890561b2e62cd87117 Mon Sep 17 00:00:00 2001 From: Prony Date: Tue, 2 May 2023 13:20:23 +0500 Subject: [PATCH] Add additional check of fully reading (line 926) --- soem/ethercatcoe.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/soem/ethercatcoe.c b/soem/ethercatcoe.c index 3f29e1f1..43e55987 100644 --- a/soem/ethercatcoe.c +++ b/soem/ethercatcoe.c @@ -923,6 +923,11 @@ int ecx_readPDOmapCA(ecx_contextt *context, uint16 Slave, int Thread_n, uint32 * /* read SyncManager Communication Type object count Complete Access*/ wkc = ecx_SDOread(context, Slave, ECT_SDO_SMCOMMTYPE, 0x00, TRUE, &rdl, &(context->SMcommtype[Thread_n]), EC_TIMEOUTRXM); + + /* check of fully reading */ + if ((wkc > 0) && (rdl!=sizeof(ec_SMcommtypet))) + wkc = 0; + /* positive result from slave ? */ if ((wkc > 0) && (context->SMcommtype[Thread_n].n > 2)) {