FATEK MODBUS DATA READING

другие контроллеры
KonstantinKolev
Posts: 5
Joined: Sat Jul 03, 2021 1:07 pm

FATEK MODBUS DATA READING

Post by KonstantinKolev »

Hi,

I have been struggling for a week with FATEK FBs-24-MAR-AC PLC.

My goal is to read voltage and current from a powermeter Elnet Pico 5.

The data should be read as floating point i.e. 230.5 Volts or 4.9 Amperes, one digits precision after the decimal point.

I managed to read data as integer so far, the digits after the decimal point are not visible.

This is the powermeter communication manual: Communication Manual Elnet Pico 5

MODBUS TABLE ADDRESS READING

According to the manual I have to read MODBUS Registers 1 and 2 to get the Voltage of Line 1 as a floating point number.

This is the MODBUS instruction to initiate communication.

MODBUS Initiate Instruction

Then I get some integers in the register D1200 and D1201 (16 bit registers).

FATEK uses IEEE 754 standard for floating point numbers representation.

I tried following some guides for converting this raw number to float but with no success.

It would be great if you can give some hint about how to achieve the goal.

Best Regards
kukuris
Posts: 9
Joined: Tue Jul 24, 2018 5:53 am

Re: FATEK MODBUS DATA READING

Post by kukuris »

# General check point
@ Modbus Slave Device (Elnet Pico 5)
- what is the value of the 300001 and 300002 register with modbus test program (ex. modbus poll)?
- do u check the whether LSB(Least significant bit) or MSB(Most significant bit) of register

@ FATEK PLC
- what is the value of the D1200 and D1201 register with ladder logic or test program
- do u check the whether LSB(Least significant bit) or MSB(Most significant bit) of register
- 16bit word(or integer) D1200, D1201 to 32bit Floating point (IEEE 754) in ladder logic (CONVERSION OF INTEGER TO FLOATING POINT NUMBER)
KonstantinKolev
Posts: 5
Joined: Sat Jul 03, 2021 1:07 pm

Re: FATEK MODBUS DATA READING

Post by KonstantinKolev »

Hi,

I solved the problem today and now everything works flawlessly.

The problem was that the MODBUS addresses were off by 2 and the High Order Word and the Low Order Word were swapped.

I had to read 20 registers at once in order to figure out which registers are changing and I found out that MODBUS registers 1 and 2 in the Elnet PICO 5 just hold the same integer numbers and never change. As per the manual it says that registers 1 and 2 hold the floating point value for the Voltage of L1.

Well, in the end turned out that registers 3 and 4 hold the floating point value for the Voltage of L1. And as I said above the order of the High Order Word and Low Order Word are swapped.

Therefore, I saved the two words from the Elnet PICO 5 to a 32 bit register and then swapped the High Order Word and Low Order Word. After the swapping of the words I was able to read the floating point value of the voltage and the current in L1.

Best Regards