not if Modbus TCP works, because the data transferred are the same.Maybe I need to use serial
I am getting data. And I am getting the correct number as far as the pairs of 16 bits are concerned. For the decimal 25.5 as 32 bit I’m getting 16844. For the first word. You build the register mapping yourself so I make it whatever I want and just assign the points I want. I really think the issue is there’s nowhere to put it that will read 32 bits.not if Modbus TCP works, because the data transferred are the same.
1) Are you getting data, even if they are 16-bit Words, from the Modbus Slave device (Totalflow XFC)?
2) If yes,
2.1) What are the values of the 16-bit Words you are receiving on the Micro820?
2.2) What are the values of the 32-bit integers (or REALs) that you expect to reconstruct from each pair of 16-bit words?
3) Do you have a link to the manual for the Totalflow XFC that lists the addresses of the Input or Holding Registers?
It does support tcp and I’ve done it. That looks like it’s just the simplified manual possibly. I didn’t think about it but the serial wouldn’t work either because the instruction block uses the same array as the tcp one.Cool! Old skool!
It apparently does not support Modbus TCP, and you do have to use serial (I'm referencing the "XFC/XRC Series Start-Up Guide" from: https://library.e.abb.com/public/fc72a9ad432393ef852574f8006b8217/2100902AWAD.pdf Please correct me if I went to the wrong source).
In the guide there is precious little said about Modbus, and it only uses either ASCII or RTU, so you are going to have to use serial, at least to a gateway.
With that said, I would recommend either ASCII or RTU, using RS485, buying a nice USB to RS485 converter that has blinky lights, and using a free or for pay Master/Slave program (aka "Modbus Poll") to get the conversation working at both ends (get XFC to program working to the Modbus Poll first, then the Modbus Poll to the PLC).
I just downloaded: Rilheva Modbus Poll FREE Modbus RTU | Rilheva IIoT Platform It's free for the price of your email address. Looks pretty snazzy too. No idea if it actually works...
As for your data, this is another thing that will getcha is that formatting could done in any number of ways including swapping nibbles on the byte level (which I think is the Modbus standard anyway).
And speaking of standards, there really is no such thing as a Modbus "standard" Just a lot of one bedroom trailers, incest, and kissing cousins.
On the PLC side of things, I would suggest dumping your data into a structure set up to provide the 32 bit data types that you are after.
One of the interesting things that I saw was that your XFC speaks the ASCII version of Modbus, pretty cool!
I am getting data. And I am getting the correct number as far as the pairs of 16 bits are concerned. For the decimal 25.5 as 32 bit I’m getting 16844. For the first word. You build the register mapping yourself so I make it whatever I want and just assign the points I want. I really think the issue is there’s nowhere to put it that will read 32 bits.
>>> struct.unpack('f',struct.pack('HH',0,16844))
(25.5,)