Author Topic: Can't get basic label to put decimal in the right place.  (Read 2590 times)

MrOverCast

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Can't get basic label to put decimal in the right place.
« Reply #15 on: December 12, 2024, 10:44:45 PM »
Since you are getting weird results all together, I am thinking that there might be some corruption on your computer or in your program or with cabling.

I could be wrong as well.

I feel like this Is just an Advanced HMI problem, If I change the numeric format it kinda helps and changes the format to 27.8 but if I do 00.0 it displays 278 amps which is obviously wrong. I'm using modbus TCP so there isn't any problems with cabling there. Im sure If I delete the entire program and just leave the modbus RTU read command for the vfd ill get the same results. The only thing I could think of Is im using an Ethernet cable that I cut up for the modbus + and -, So maybe theres some interference there going on? either that or I am using a 16 bit integer, maybe I need to use a 32 bit? I have no clue

What numbers do you get if you don't use NumericFormat and change ValueScaleFactor to 0.1 and then 0.01?

400007 register should be integer value and I would expect BasicLabel to show 256 instead of 256.0 (I might be wrong about this).


If I leave numeric format empty and put scale factor to 0.1 It changes the decimal to 29.0, If i change scale factor to 0.01 it changes it to 290 or something like that. it either changes it to 290 or just 01.

Just a reminder the motor is 1 HP at 4.8 amps max at 240V so obviously 29.0 isnt correct. I do have the tag set to 16 bit integer so.
« Last Edit: December 12, 2024, 10:47:48 PM by MrOverCast »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5341
    • View Profile
    • AdvancedHMI
Re: Can't get basic label to put decimal in the right place.
« Reply #16 on: December 13, 2024, 08:52:34 AM »
To take the driver and communication out the equation, you can put values in the properties in the design view.

For example, set these properties values and see what displays while in design mode:

Value = 123
NumericFormat = 0.0
ValueScaleFactor = 0.1

With those set, you should see 12.3

Godra

  • Hero Member
  • *****
  • Posts: 1456
    • View Profile
Re: Can't get basic label to put decimal in the right place.
« Reply #17 on: December 13, 2024, 11:17:00 AM »
With this Archie's suggestion, if you don't get any weird results then it might be just the wrong PLC address.

One way to do a test could be to do the following:

- Download fresh copy of AHMI and start a new project
- Add Modbus TCP driver and point it to whatever IP address you are already using
- Add only 9 BasicLabels to the form and address them like this:
    400006    L400006    F400006
    400007    L400007    F400007
    400008    L400008    F400008

If any of these labels shows the expected value, with or without decimal point, then focus on that label and then try NumericFormat and ValueScaleFactor on it.

If all this sounds too complex then just ignore it.


MrOverCast

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Can't get basic label to put decimal in the right place.
« Reply #18 on: December 13, 2024, 02:47:38 PM »
To take the driver and communication out the equation, you can put values in the properties in the design view.

For example, set these properties values and see what displays while in design mode:

Value = 123
NumericFormat = 0.0
ValueScaleFactor = 0.1

With those set, you should see 12.3

by following what you said it worked. It displayed 12.3, But the problem is when PLC reads the data from the VFD, its read as 290. It doesn't add the decimal. you have to do it. The only thing I could think of is to maybe make a math function to add a decimal.

With this Archie's suggestion, if you don't get any weird results then it might be just the wrong PLC address.

One way to do a test could be to do the following:

- Download fresh copy of AHMI and start a new project
- Add Modbus TCP driver and point it to whatever IP address you are already using
- Add only 9 BasicLabels to the form and address them like this:
    400006    L400006    F400006
    400007    L400007    F400007
    400008    L400008    F400008

If any of these labels shows the expected value, with or without decimal point, then focus on that label and then try NumericFormat and ValueScaleFactor on it.

If all this sounds too complex then just ignore it.



Tried this and the ones with the letter in front of the address gave me -E853787 some random number.

Godra

  • Hero Member
  • *****
  • Posts: 1456
    • View Profile
Re: Can't get basic label to put decimal in the right place.
« Reply #19 on: December 13, 2024, 03:16:51 PM »
You should not limit yourself to testing only what Archie suggested but possibly expand it to other combinations, like 123-0.00-0.01 and others.

As for my test, what values did you get at 400006 and 400007 and 400008?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5341
    • View Profile
    • AdvancedHMI
Re: Can't get basic label to put decimal in the right place.
« Reply #20 on: December 13, 2024, 03:17:06 PM »
Something still isn't adding up. Using Godra's test, what values did you get on the addresses without the letter in front of them?

Back in the design view test, now set Value=290 to see if it shows 29.0
Next look in Productivity Suite to see what the current value is and place that in the Value property in design view.

MrOverCast

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Can't get basic label to put decimal in the right place.
« Reply #21 on: December 13, 2024, 04:24:41 PM »
Something still isn't adding up. Using Godra's test, what values did you get on the addresses without the letter in front of them?

Back in the design view test, now set Value=290 to see if it shows 29.0
Next look in Productivity Suite to see what the current value is and place that in the Value property in design view.

Ok I did scale factor 0.01 and numeric format 0.0 that worked. I got 2.5 amps now, Thanks, Sorry for the confusion, I didn't know if you type a number in the value it'll show how its displayed when running. Sorry about that

Im still learning This software and my PLC too.

Godra

  • Hero Member
  • *****
  • Posts: 1456
    • View Profile
Re: Can't get basic label to put decimal in the right place.
« Reply #22 on: December 13, 2024, 09:46:36 PM »
Does that mean that your issue is resolved or is it still weird when connected to the PLC?

MrOverCast

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Can't get basic label to put decimal in the right place.
« Reply #23 on: December 14, 2024, 09:50:10 PM »
Yes I was able to get it to display 2.9 amps instead of 29.0; so this issue is resolved. Thanks guys!