1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 <2025> | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 <2025> |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: Beckhoff ADS to EPICS IOC |
From: | GAGET Alexis via Tech-talk <tech-talk at aps.anl.gov> |
To: | Lesley <lesley_0506 at 163.com> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Fri, 6 Jun 2025 07:05:01 +0000 |
Hi Lesley, Already at least 2 solutions for ADS EPICS drivers exist in the community: https://github.com/epics-modules/twincat-ads/ https://epics.cosylab.com/documentation/adsDriver/ Why not using those ones ? At minimum it can maybe be used as an example if you want to keep going on your solution
J Cheers Alexis CEA/Irfu/DIS De : Tech-talk <tech-talk-bounces at aps.anl.gov>
De la part de Lesley via Tech-talk Hello! I developed a Beckhoff ADS IOC application using this ADS driver (https://github.com/Beckhoff/ADS).
After the IOC runs for some time, the following issue occurs: "WARNING dbEvent possible queue stall". Concurrently, the PVs in the OPI will disconnect and then automatically reconnect after a short period. Here's a code snippet for reading data from the PLC using the ADS driver: extern "C" { struct WaterStatusStruct adsReadWaterStatusValue(){ WaterStatusStruct CWStatusVar; const std::string handleName = "GVL_RFQ.water_status"; //Use mutex locks to protect access std::lock_guard<std::mutex> lock(plcMutex); const long handleStatus = AdsSyncReadWriteReqEx2(port, &plcAddress, ADSIGRP_SYM_HNDBYNAME, 0, sizeof(handle), &handle, handleName.size(), handleName.c_str(), nullptr); if (handleStatus) { printf("adsReadWaterStatusValue Create handle failed with: %8lX\n", handleStatus); //out << "Create handle for '" << handleName << "' failed with: 0x" << std::hex << handleStatus << '\n'; return CWStatusVar; } const long status2 = AdsSyncReadReqEx2(port, &plcAddress, ADSIGRP_SYM_VALBYHND, handle, sizeof(CWStatusVar), &CWStatusVar, &bytesRead); if (status2) { printf("adsReadWaterStatusValue ADS read failed with: %8lX\n", status2); //out << "ADS read failed with: " << std::dec << status << '\n'; } const long releaseHandle = AdsSyncWriteReqEx(port, &plcAddress, ADSIGRP_SYM_RELEASEHND, 0, sizeof(handle), &handle); if (releaseHandle) { //out << "Release handle 0x" << std::hex << handle << "' failed with: 0x" << releaseHandle << '\n'; printf("adsReadWaterStatusValue Release handle failed\n"); } return CWStatusVar; } } What can I do to fix this?Thank you for your time. |