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  2022  <20232024  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  <20232024 
<== Date ==> <== Thread ==>

Subject: RE: modbus reading arrays of floats
From: "Pearson, Matthew via Tech-talk" <tech-talk at aps.anl.gov>
To: "Jemian, Pete R." <jemian at anl.gov>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Fri, 20 Oct 2023 14:01:56 +0000

Hi Pete,

 

Do you mean why do I have FTVL=ULONG when I want FLOAT data?

 

It’s because if I use FLOAT or DOUBLE I get this device support error:

 

devAsynInt32Array::initCommon, BL100:SE:GenIO:E1262:TCA field type must be SIGNED_TYPE or UNSIGNED_TYPE

 

and I can’t use the Asyn Float32Array interface because then I get:

 

devAsynFloat32Array::initCommon, BL100:SE:GenIO:E1262:TCA find asynFloat32Array interface failed

 

because the Modbus driver doesn’t implement Float32/64 array interfaces.

 

Cheers,

Matt

 

From: Jemian, Pete R. <jemian at anl.gov>
Sent: Thursday, October 19, 2023 7:53 PM
To: Pearson, Matthew <pearsonmr at ornl.gov>; tech-talk at aps.anl.gov
Subject: [EXTERNAL] Re: modbus reading arrays of floats

 

ULONG?

 


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Pearson, Matthew via Tech-talk <tech-talk at aps.anl.gov>
Sent: Thursday, October 19, 2023 5:12:39 PM
To:
tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: modbus reading arrays of floats

 

Hi,

 

I have a device which supports reading arrays of floats (IEEE Float32) over Modbus/TCP.

 

Am I right in thinking that currently this isn’t supported by the Asyn modbus support? It seems to support arrays of ints, but not floats.

 

Interestingly, this almost works:

 

record(waveform, "$(P)$(R)TCA") {

  field(FTVL,  "ULONG")

  field(DTYP,  "asynInt32ArrayIn")

  field(INP,   "@asyn($(PORT)8w4,2064,1)FLOAT32_LE")

  ….

}

 

By specifying the datatype to be FLOAT32_LE, the modbus driver correctly converts the byte data to floats, but the waveform only gives me the integer part of the number.

 

So as a work-around I’ve implement multiple reads, one per Float32. This works fine, and I’ll likely stick with it.  

 

However, is there a smarter workaround? For example, can I read the data as a block of Ints, then convert to IEEE Float32 in the database (without writing a subroutine)?

 

Cheers,

Matt

 

 


References:
modbus reading arrays of floats Pearson, Matthew via Tech-talk
Re: modbus reading arrays of floats Jemian, Pete R. via Tech-talk

Navigate by Date:
Prev: Re: Axis Photonics AreaDetector Interface Wang Xiaoqiang via Tech-talk
Next: Is areaDetector documentation down? Marco A. Barra Montevechi Filho 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  2022  <20232024 
Navigate by Thread:
Prev: Re: modbus reading arrays of floats Jemian, Pete R. via Tech-talk
Next: Axis Photonics AreaDetector Interface Smith, William 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  2022  <20232024 
ANJ, 23 Oct 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·