g.mccormick
Lifetime Supporting Member
I am using Modbus to read 36 registers from a ML1200. 2 of those registers are suppose to be L11 data and 2 of the registers are F8 data.
Long story short, my master will issue 3 seperate queries to get the data since I've told it s, L, and F for the different register values. (I understand it is all 16data just interpreted differently).
So in order to get to 1 query command to read all data, I have so far broken the floating point up to integer and decimal*10000 portions before storeing in two consecutive N registers. I then recombine in the Master software.
Example:
F8:1, value 1234.67890
N7:23 = 1234
N7:24 =6789
Once read via modbus, on my master system side:
Value = N7_23 + ( N7_24 / 10000)
Now I need to do something similar to a L11 long int value.
I'm coming up short on what to do here though? The long int is values from a counter, so up to 2147483647 (Actually in PLC I reset value if above 2147480000).
How should I best manipulate this?
Long story short, my master will issue 3 seperate queries to get the data since I've told it s, L, and F for the different register values. (I understand it is all 16data just interpreted differently).
So in order to get to 1 query command to read all data, I have so far broken the floating point up to integer and decimal*10000 portions before storeing in two consecutive N registers. I then recombine in the Master software.
Example:
F8:1, value 1234.67890
N7:23 = 1234
N7:24 =6789
Once read via modbus, on my master system side:
Value = N7_23 + ( N7_24 / 10000)
Now I need to do something similar to a L11 long int value.
I'm coming up short on what to do here though? The long int is values from a counter, so up to 2147483647 (Actually in PLC I reset value if above 2147480000).
How should I best manipulate this?