Author Topic: Float Addressing - Unitronics PLC  (Read 3251 times)

jweav2223

  • Newbie
  • *
  • Posts: 4
    • View Profile
Float Addressing - Unitronics PLC
« on: February 03, 2017, 12:12:16 AM »
Attempting to display values of a couple of Floats from a Unitronics PLC. Address is MF0 in the PLC so attempted F4001 without any success. According to their Help Files Memory Floats start at 4000h. Memory Integers (16 bit unsigned) I was able to get to work correctly starting with 40001 with their Help Files indicating they start at 00000h, 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Float Addressing - Unitronics PLC
« Reply #1 on: February 03, 2017, 06:51:29 AM »
4000h is probably the register offset. Convert that to decimal and you get 16384. Add 1 to it because the Modicon style addressing start at 1. Then you add a "4" at the beginning to indicate the register memory space. And finally prefix it with an "F" to tell AdvancedHMI to read 2 registers and convert to float. The resulting address would then be:

F416385

jweav2223

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Float Addressing - Unitronics PLC
« Reply #2 on: February 05, 2017, 12:02:49 AM »
Showing to be a valid address and when I change the value via the Controller it changes the value on AdvancedHMI. The values are different, however. For example in the Controller I have the value as 12.35 and the AdvancedHMI is displaying -1.594959E-23.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Float Addressing - Unitronics PLC
« Reply #3 on: February 05, 2017, 07:31:08 AM »
Try different combinations of WordSwap and ByteSwap settings in the driver properties.

You may also have to apply the latest driver patch as described here:

http://advancedhmi.com/forum/index.php?topic=1612.msg8801#msg8801

DougLyons

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Float Addressing - Unitronics PLC
« Reply #4 on: February 05, 2017, 11:40:15 AM »
This result would be what happens with a WordSwap, so using WordSwap should be all that is required. The patch may also be needed.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Float Addressing - Unitronics PLC
« Reply #5 on: February 05, 2017, 11:44:37 AM »
I made a mistake with the property names... The correct names are SwapBytes and SwapWords. I got my words swapped (no pun intended).

jweav2223

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Float Addressing - Unitronics PLC
« Reply #6 on: February 05, 2017, 10:43:52 PM »
Winner! Changed SwapWords to True for the Driver and it is now reading correctly. Appreciate all the help.