Author Topic: The Scaling Thing Again  (Read 1009 times)

sebraun

  • Newbie
  • *
  • Posts: 1
    • View Profile
The Scaling Thing Again
« on: November 16, 2014, 02:46:56 PM »
I have just discovered this software.  Although I am recently retired from over 40 years as a HMI/PLC engineer (and programmer), I may just take this opportunity to learn something new.  I have a former client that needs to check a single reservoir tank level from their office.  I have created a simple project with a value display on a DigitalPanelMeter1 object that successfully communicates with some Modbus/TCP I/O.  The display reads the raw analog value from address 40002.  Is there a simple way to scale this value?  I need to multiply the raw value by 206.026416 and then subtract it from 25.1 to give me the tank level feet accurate to a single decimal place.

Steven.....


   

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: The Scaling Thing Again
« Reply #1 on: November 16, 2014, 05:28:12 PM »
The scaling in the controls only has a multiplier set by the ValueScaleFactor property, but no accommodation for an offset. This has been recently added and will show up in the next release (v.3.83) within a couple weeks.

There is a round about work around:

1) Add a DigitalPanelMeter, but do not put anything the PLCAddressValue property
2) Add a DataSubscriber and put your address of 40002 in the PLCAddressValue property
3) Double click the DataSubscriber and it will take you back to the code
4) Enter this piece of code:
Code: [Select]
        DigitalPanelMeter1.Value = (CInt(e.Values(0)) * 206.026416 - 25.1)