Author Topic: Float value incorrect format  (Read 1411 times)

mourazo

  • Newbie
  • *
  • Posts: 31
    • View Profile
Float value incorrect format
« on: June 11, 2020, 10:26:00 AM »
Hello, I have the following problem when I try to read the 3000 addresses in floating format. in Modbus Poll I can read correctly with this format Float AB CD


But when I try to read a basic label with advancedHMI I can't read the correct value, I try with prefix address value F, D, B with no results, what's the correct way to read this format?

Thanks
« Last Edit: June 11, 2020, 10:32:27 AM by mourazo »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Float value incorrect format
« Reply #1 on: June 11, 2020, 01:48:34 PM »
Have you tried SwapWords and SwapByte combinations?

mourazo

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Float value incorrect format
« Reply #2 on: June 12, 2020, 11:36:12 AM »
Hi Archi thanks for response, I solved read this equipment in format float, it was a problem for choosing the correct modbus address. Now I can read 2 registers for the equipment that i´m tried but the problem now it´s this, I can read the registers that apear in modbus poll picture number 3 and 5 register, but in advancedHMI i can read in the register 30004 and 30002, the problem is that with this logic the register of number 1 in modbus poll should be read in register number 30000 in advancedHMI but it generates an exception, how can i read the register number one in advancedHMI?




Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Float value incorrect format
« Reply #3 on: June 13, 2020, 12:05:19 AM »
Can you do a test with 9 BasicLabels and Modbus addresses as in the attached picture?

If you can then post a picture of the results you get.

« Last Edit: June 13, 2020, 12:09:57 AM by Godra »

mourazo

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Float value incorrect format
« Reply #4 on: June 16, 2020, 04:25:48 AM »
Yes for sure. This is the test result

« Last Edit: June 16, 2020, 04:28:03 AM by mourazo »

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Float value incorrect format
« Reply #5 on: June 16, 2020, 06:22:55 AM »
Which is exactly what Modbus Poll shows for the first float value (see the attached picture).
This is with byte swap set to True (which is standard for Modbus).

So your addresses in AHMI should be F30002, F30004 and F30006.

From your first picture, Float AB CD should indicate that byte swap is set to False.
If you do the same in AHMI then the addresses F30001, F30003 and F30005 might work.

You are the one making mistakes and not these programs.
Try all the different combinations and you might eventually find one that works.

« Last Edit: June 17, 2020, 12:57:17 AM by Godra »

mourazo

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Float value incorrect format
« Reply #6 on: June 18, 2020, 05:40:55 AM »
With the byte swap set to true I receive two for the three correct values in the F30002 and F30004 registers but i can´t receive the correct value of the Modbus Poll register number one



But If the byte swap is set to false I can´t receive the corrects values in no registers.




I´m sure it´s my error but i can´t find, thanks for the support and understanding

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Float value incorrect format
« Reply #7 on: June 18, 2020, 03:15:07 PM »
Take a look at the attached picture.

If I input your values into the simulator and then use TCP connection to poll it with both AHMI and Modbus Poll simultaneously, then I get the same values displayed. This is how it should be normally.

Even if I use RTU connection to poll it with both AHMI and Modbus Poll one at the time, then I still get the same values displayed.

It is now up to you to find what mistake you are making to get different results.

« Last Edit: June 18, 2020, 04:15:48 PM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Float value incorrect format
« Reply #8 on: June 24, 2020, 12:08:28 AM »
You should try setting both SwapBytes and SwapWords to True in AHMI.

That version of ModbusPoll which you are using, seems to assume both options set to True (for the display selection of Float AB CD as it was tested with 2 different Modbus simulators).

« Last Edit: June 25, 2020, 11:59:57 PM by Godra »

mourazo

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Float value incorrect format
« Reply #9 on: June 30, 2020, 05:56:20 PM »
First of all thanks for the support received. At the moment I don't have the gas analyzer equipment to do the tests. When I'll have a equipment with the same characteristics, I will write you if I have the same problem to connect. Thanks for all Godra.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Float value incorrect format
« Reply #10 on: June 30, 2020, 09:34:26 PM »
You just need to understand that the latest version of ModbusPoll seems to have these options set correctly (unlike the one you are using).

There are other testing apps you can use, besides for AHMI:

  https://www.advancedhmi.com/forum/index.php?topic=2567.0