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  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Modbus Device Support for Advantech ADAM6017, 6018
From: Jeremy Wykes <[email protected]>
To: [email protected]
Date: Fri, 18 Nov 2016 23:37:11 +1100
I have used an ADAM-4572 MODBUS gateway to talk to an ADAM-4019+ which combined should be sufficiently similar to an ADAM-6018 that you can use a similar setup.

Database template, followed by the startup commands:

# template record for reading a single 16 bit value from an ADAM4572
#
# Macros:
# P - Record prefix
# R - Record name
# PORT - asyn modbus support port name
# B - Bit number (offset from 0)
#
record(longin,$(P)$(R)){
field( SCAN, ".5 second")
field( DTYP, "asynInt32" )
field( INP, "@asyn($(PORT) $(B))UINT16" )
}

########################### ADAM config ###########################
 
# IP address 10.10.10.10 is a static (reserved) IP address linked to the MAC of the ADAM4572;
# 502 is Modbus TCP/IP port
 
drvAsynIPPortConfigure("ADAM4572_PORT", "10.10.10.10:502", 0, 0, 1)
 
#modbusInterposeConfig(const char *portName, modbusLinkType, int timeoutMsec, int writeDelayMsec)
modbusInterposeConfig("ADAM4572_PORT", 0, 2000, 0)
 
# Read the 8 channels of an ADAM4019+ module at slave address 1 via ADAM4572 MODBUS ethernet gateway
# There are 8 holding registers that correspond to the 8 channels (0-8), starting at modbus address=40001.
# EPICS seems to use offset addresses, so 40001 = 0, 04002 = 1, etc.
# Data type is UINT (dataType=0). Signal is 4-20 mA.
 
#drvModbusAsynConfigure(char *portName, char *octetPortName, int slaveAddress, int modbusFunction,
#                       int modbusStartAddress, int modbusLength, modbusDataType dataType,
#                       int pollMsec, char *plcType)
drvModbusAsynConfigure("ADAM4572_CHANNELS", "ADAM4572_PORT", 1, 3,  0, 8, 0, 1000, "ADAM")
 
# Read 8 holding registers from 40200. These correspond to the input types of the 8 channels.
drvModbusAsynConfigure("ADAM4572_INPUT_TYPES", "ADAM4572_PORT", 1, 3,  200, 8, 0, 1000, "ADAM")
 
# Use the template to publish bits as channel access variables
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_CHANNELS,R=ch1,B=0") #Voltage
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_CHANNELS,R=ch2,B=1") #Current
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_CHANNELS,R=ch3,B=2") #Upper diff ram
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_CHANNELS,R=ch4,B=3") #Lower diff ram
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_CHANNELS,R=ch5,B=4") #Main ram advance
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_CHANNELS,R=ch6,B=5") #Main ram retract
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_CHANNELS,R=ch7,B=6") #unused
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_CHANNELS,R=ch8,B=7") #unused
 
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_INPUT_TYPES,R=ch1_type,B=0")
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_INPUT_TYPES,R=ch2_type,B=1")
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_INPUT_TYPES,R=ch3_type,B=2")
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_INPUT_TYPES,R=ch4_type,B=3")
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_INPUT_TYPES,R=ch5_type,B=4")
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_INPUT_TYPES,R=ch6_type,B=5")
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_INPUT_TYPES,R=ch7_type,B=6")
dbLoadRecords("./adam4572.template", "P=adam:,PORT=ADAM4572_INPUT_TYPES,R=ch8_type,B=7")

​I found this tool http://www.chipkin.com/products/software/modbus-software/cas-modbus-scanner/ to be very useful making sure everything was working. Note that there is inconsistency with MODBUS addresses and ​the Chipkin offsets are 1 higher than the EPICS addresses.

On Sat, Nov 12, 2016 at 10:43 AM, David Vine <[email protected]> wrote:
Hi all,

does anyone have device support for the Advantech ADAM-6017 or 6018?

Thanks,
David



--
-- 
Jeremy Wykes
Australian Synchrotron Research Fellow
XAS
Australian Synchrotron
800 Blackburn Rd
Clayton, Victoria, 3168
AUSTRALIA

Seconded from:
Department of Earth & Planetary Sciences 
Macquarie University

References:
Modbus Device Support for Advantech ADAM6017, 6018 David Vine

Navigate by Date:
Prev: Re: MCA or LabCA on Linux-64bit Giovanna Campogiani
Next: Re: MCA or LabCA on Linux-64bit Hinxx
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Modbus Device Support for Advantech ADAM6017, 6018 Mazanec Tomáš
Next: an easy quesiton about optics l123173
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·