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  <20112012  2013  2014  2015  2016  2017  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  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Modbus data to float32 ?
From: Olivier Zimmermann <[email protected]>
To: [email protected]
Date: Wed, 21 Sep 2011 16:37:33 +0200


Hello,


I'm starting with EPICS and trying to have a PV read a SGL/Float32 value exposed by a modbus device (the value is stored on two 16bits-wide holding registers).

To achieve this I'm using "Driver Support for Modbus Protocol under EPICS".
http://cars9.uchicago.edu/software/epics/modbusDoc.html

Modbus data is retrieved as follows (i.e. using modbus function 4 to retrieve two 16bit words at address 9) :

drvAsynIPPortConfigure("INSTR","192.168.##.##:502",0,1,1)
modbusInterposeConfig("INSTR",0,5000)
drvModbusAsynConfigure("INSTR:ReadFloat32","INSTR",1,4,9,2,0,50, "InstrInterface")

What I just can't figure out is :

- How do I typecast this 32bit modbus data into a Float32 ?

- What "EPICS device support" should I use (asynFloat64, asynInt32...) ?

- Should my PV be an "ai" and where can I cast the right data type within ?


Thanks for any help,
oz




Replies:
RE: Modbus data to float32 ? Mark Rivers

Navigate by Date:
Prev: Re: BOY Data Browser Issues Kasemir, Kay
Next: Epics C# Library problems Perrier Pierre
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Newport ESP300 Chen Xue
Next: RE: Modbus data to float32 ? Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·