|
|
Experimental Physics and
| ||||||||||||||
|
|
From: Tech-talk <[email protected]> on behalf of Pearson, Matthew via Tech-talk <[email protected]>
Sent: Thursday, October 19, 2023 5:12:39 PM To: [email protected] <[email protected]> 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
| ||||||||||||||
| ANJ, 19 Mar 2026 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
· Distributions · Download · Documents · Links · Licensing · |