EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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  <20222023  2024  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  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Eurotherm modbus support
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: William Kirstaedter <kirstaedter at fhi-berlin.mpg.de>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, "Wlodek, Jakub" <jwlodek at bnl.gov>
Date: Fri, 26 Aug 2022 16:45:34 +0000

Hi William,

 

I was able to make the following changes to https://github.com/jwlodek/eurotherm2k to get it to compile with no errors or warnings with Modbus R3-2.

 

corvette:eurotherm2k/eurotherm2kApp/src>git diff .

diff --git a/eurotherm2kApp/src/Makefile b/eurotherm2kApp/src/Makefile

index af28636..37aabe2 100644

--- a/eurotherm2kApp/src/Makefile

+++ b/eurotherm2kApp/src/Makefile

@@ -16,7 +16,7 @@ eurotherm2k_vdct_DBD += calc.dbd

eurotherm2k_vdct_DBD += stream.dbd

 

# The following are compiled and added to the support library

-eurothermModbus_SRCS += eurothermModbus.c

+eurothermModbus_SRCS += eurothermModbus.cpp

 

# We need to link against the EPICS Base libraries

eurothermModbus_LIBS += $(EPICS_BASE_IOC_LIBS)

diff --git a/eurotherm2kApp/src/eurothermModbus.cpp b/eurotherm2kApp/src/eurothermModbus.cpp

index 4d84cdb..7714747 100644

--- a/eurotherm2kApp/src/eurothermModbus.cpp

+++ b/eurotherm2kApp/src/eurothermModbus.cpp

@@ -50,13 +50,20 @@

/* Modbus address space definitions for controller parameters */

#define AUTOTUNE_ADDR  3072    /*Autotune parameters (6 locations)*/

 

+/* Function prototype until it is exported */

+asynStatus drvModbusAsynConfigure(const char *portName, const char *octetPortName,

+                                  int modbusSlave, int modbusFunction,

+                                  int modbusStartAddress, int modbusLength,

+                                  const char *dataTypeString,

+                                  int pollMsec,

+                                  const char *plcType);

 

/* Create modbus port name in the form:

        Eurotherm_ASYNPORT_ADDR_LOOPNO_Rd_VarName

        Eurotherm_ASYNPORT_ADDR_LOOPNO_Wr_VarName

        Controller variables use loop 0

*/

-int mkname(char *str, int max, char *asynPortName, int modbusAddress, int loopNumber, int Write, char *szVariable)

+int mkname(char *str, int max, char *asynPortName, int modbusAddress, int loopNumber, int Write, const char *szVariable)

{

        int ret;

 

@@ -91,7 +98,7 @@ static int eurothermModbusCtrlConfigure(char *asynPortName, int modbusAddress)

                //free(str);

                return -errno;

        }

-       str = malloc(strmaxlen);

+       str = (char *)malloc(strmaxlen);

        if(str == NULL) {

                LOG_ERROR("Could not allocate %d bytes of memory", strmaxlen);

                free(str);

@@ -162,7 +169,7 @@ static int eurothermModbusLoopConfigure(char *asynPortName, int modbusAddress, i

                //free(str);

                return -errno;

        }

-       str = malloc(strmaxlen);

+       str = (char *)malloc(strmaxlen);

        if(str == NULL) {

                LOG_ERROR("Could not allocate %d bytes of memory", strmaxlen);

                free(str);

 

Mark

 

From: Mark Rivers
Sent: Friday, August 26, 2022 11:25 AM
To: William Kirstaedter <kirstaedter at fhi-berlin.mpg.de>; tech-talk at aps.anl.gov; Wlodek, Jakub <jwlodek at bnl.gov>
Subject: RE: Eurotherm modbus support

 

I now realize that DLS repository is not the same as the one you are using.  However, this one does seem to be the same:

 

https://github.com/jwlodek/eurotherm2k

 

Jakub, is this repository a fork of a master somewhere else, or is this now the primary repository?

 

Mark

 

 

 

From: Mark Rivers
Sent: Friday, August 26, 2022 11:08 AM
To: William Kirstaedter <kirstaedter at fhi-berlin.mpg.de>; tech-talk at aps.anl.gov
Subject: RE: Eurotherm modbus support

 

Hi William,

 

It appears that the eurothemModbus source code is on Github here:

 

https://github.com/dls-controls/eurothermModbus

 

Does your gitlab dump differ from that?

 

Mark

 

 

From: William Kirstaedter <kirstaedter at fhi-berlin.mpg.de>
Sent: Friday, August 26, 2022 8:41 AM
To: Mark Rivers <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov
Subject: Re: Eurotherm modbus support

 

Hi Mark,

 

unfortunately, it doesnt work, various casts fail.

 

I've saved a dump here: https://gitlab.fhi.mpg.de/kw/eurotherm2k

(should be externally accessible)

 

William Kirstaedter
PP&B Computer Support Group
Fritz-Haber-Institut Berlin

Am 26.08.22 um 14:40 schrieb Mark Rivers:

Hi William,

 

You can probably just rename eurothermModbus.c to eurothermModbus.cpp.  See if that works.

 

How does eurothermModbus use drvModbusAsyn?

 

Mark

 

 


From: Tech-talk on behalf of William Kirstaedter via Tech-talk
Sent: Friday, August 26, 2022 7:20 AM
To: tech-talk at aps.anl.gov
Subject: Eurotherm modbus support

 

Hi,

unfortunately the DLS site for the eurotherm support module is not available anymore...
(http://controls.diamond.ac.uk/downloads/support/eurotherm2k/)

does anybody still maintain eurotherms?

I kinda converted the 1-22 release to work with my environment and am now running into a C / C++ error...
newer asyn versions reference vector.h which is C++ while my eurotherm support file is C, which is bad because the C compiler doesnt know about the C++ vector.h ...

In file included from /home/epics/EPICS/epics-support/modbus/include/drvModbusAsyn.h:15,
                 from ../eurothermModbus.c:25:
/home/epics/EPICS/epics-support/asyn/include/asynPortDriver.h:4:10: fatal error: vector: No such file or directory
 #include <vector>
          ^~~~~~~~
compilation terminated.

Im not sure how to get around this....

maybe someone with more experience in the EPICS build system can help me out.

thanks,

William

--

William Kirstaedter (PP&B)

Fritz-Haber-Institut der MPG

Faradayweg 4-6

14195 Berlin

Tel: 030 8413 5405

Mail: kirstaedter at fhi-berlin.mpg.de

 


References:
Re: Eurotherm modbus support Mark Rivers via Tech-talk
Re: Eurotherm modbus support William Kirstaedter via Tech-talk
RE: Eurotherm modbus support Mark Rivers via Tech-talk
RE: Eurotherm modbus support Mark Rivers via Tech-talk

Navigate by Date:
Prev: RE: Eurotherm modbus support Mark Rivers via Tech-talk
Next: Re: Eurotherm modbus support Wlodek, Jakub via Tech-talk
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  <20222023  2024 
Navigate by Thread:
Prev: RE: Eurotherm modbus support Mark Rivers via Tech-talk
Next: Re: Eurotherm modbus support Wlodek, Jakub via Tech-talk
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  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·