How to convert modbus reading

I see, but I am using vijeo citect 7.4 to read the value from modbus tcpip and since the data is in float, so it hold 2 input registers... Its either I used 40000,40002,40004.. or one more I used swapped floating point but I dont know how to set it in vijeo citect because when I write using address 40001, 40003, the values doesnt make sense.. If my question sounds stupid, im really sorry because Im really am huhuhu
 
You can install some Modbus client on your PC like Simply Modbus and compare

Maybe that problem you have with the floats is because that device uses a floating point format different from the IEC standard?
 
Last edited:
What is the make and model of the Modbus device from which you are reading these data? Can you provide a user manual for it?

Or perhaps your tech guy is writing code for a custom Modbus device?

but modbus dont have 40000 address register.
The Modbus Protocol does NOT have ANY starting addresses such as 40000 or 40001.

Cf. here:

The Modbus Data Model has four data tables (types): Discretes input (sic; 1-bit; read-only); Coils (1-bit outputs; read or write); Input Registers (16-bit; read-only); Holding Registers (16-bit; read or write).

Cf. here:

Modbus has two addressing models for each table (type) of data:

  • a Modbus data address model, where the addresses run from 1 to n (n <= 65536 decimal);
  • a PDU* address model, where addresses run from 0 to 65535 (decimal) = 0x0000 to 0xFFFF (hexadecimal).
If you want to figure this out, the best thing to do would be to get the first ten or so Holding Registers, starting at PDU address 0 (0x0000), through PDU address 9 (0x0009(=); this would probably be the same as asking the vijeo citect to read 10 registers starting at pseudo-"address" 40001. Then post here, preferably in hexadecimal, what those ten integer values are for one Modbus read, and also what you think the 32-bit floating-point value was (in decimal) at the time of that read.

We can help you work from there; in the end, it is all about bookkeeping.

* PDU => Protocol Data Unit.
 
Vijeo Citect cannot use Coils address

@lfe Got it bro, it turns out I need to go to Computer setup editor in vijeo citect then add new parameter which is MODNET and set a new section call, FloatType and set the value to 1 as to make the order of bytes 3 2 1 0 which is swapped. So, as a float is using 2 registers, for example 40004 and 40005, so I make it swapped so that the value in 40005 can be read

@drbitboy Yup you are correct bro, In this case I am using holding registers.. Unfortunately I dont have enough docs for u.. I dont even know what model of RHT sensor and modbus devices they are using.. The tech guy is actually my boss client.. So, Im quite loss as Im really new to this but I learnt a lot here with all of you guys help.. But I can share some pictures.. Now, I have problem to put address for coils and need your help.. The problem is when I used digital, it says bad raw data type and unknown error for address in vijeo citect 7.4... But when I use Integer it has no error except for the address.. Here are the pictures

WhatsApp Image 2023-06-28 at 13.04.45.jpg Screenshot (804).png Screenshot (805).png Screenshot (806).png
 

Similar Topics

Hello, First, please excuse my question I am new to Modbus. I have a CX-5140 control unit from Beckhoff and an instrumentation device that...
Replies
3
Views
3,124
Found an awesome point of sale for $500. It sends an ascii string when a product is sold. Need to convert this into a number between 0 and 255 or...
Replies
1
Views
2,274
I need a good idea to solve a small task. My customer bought a measuring device where the measurement is collected by a controller from a...
Replies
6
Views
3,244
Need a little help here, I need to poll a radio/modem over Allen-Bradley Ehernet/IP. The existing radio/modem is geared up Modbus. Anybody know...
Replies
3
Views
1,922
Hi All Using RSlogix 5k v.15 modbus master sample code. plc(master) is connected to modbus device(slave). If i use function code 1 to read...
Replies
2
Views
3,034
Back
Top Bottom