Author Topic: Write signed(-) values over modbus TCP to holding registers  (Read 5409 times)

elirofu

  • Newbie
  • *
  • Posts: 19
    • View Profile

Hi to everybody,

I'm wondering if is possible to write some negative (-) values to the holding register bia Modbus TCP. I don't have any problem writing positive (+) values but I need to write negatives(-).


could you help me guys?
Thanks.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5280
    • View Profile
    • AdvancedHMI
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #1 on: May 18, 2015, 04:05:25 PM »
I just tried this out by adding a BasicLabel and setting PLCAddressValue and PLCAddressKeypad both to 40001. I run the app, click on the BasicLabel and enter a negative value. The value shows as negative on both my BasicLabel and my Modbus simulator. So it seems to be working as expected.

elirofu

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #2 on: May 18, 2015, 05:35:49 PM »
It worked awesome. Thanks.





elirofu

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #3 on: May 19, 2015, 01:40:35 PM »
Hi,

also I have another doubt:

why when I put this specific value L4000020 in a basic label all my another values becomes 0?

thanks you guys.


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5280
    • View Profile
    • AdvancedHMI
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #4 on: May 19, 2015, 01:42:45 PM »
Just a quick guess, but try couple less 0's,    L40020

elirofu

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #5 on: May 19, 2015, 02:00:50 PM »
It does not worked with less 0, also another values are blinking between zeros and the correct values


elirofu

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #6 on: May 19, 2015, 02:18:56 PM »
Attached a video of the behavior
Thanks.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5280
    • View Profile
    • AdvancedHMI
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #7 on: May 19, 2015, 03:15:46 PM »
Does this only happen when a L4xxxx address is added to the form?

elirofu

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #8 on: May 19, 2015, 04:32:39 PM »
Yea, but only with specific addresses, some address works like charm and others not.

it seems like when some addresses affect to other ones.


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5280
    • View Profile
    • AdvancedHMI
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #9 on: May 19, 2015, 07:04:48 PM »
What version are you using? I tried to replicate this with version 3.98j, but I cannot get the same problem to occur.

elirofu

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #10 on: May 20, 2015, 08:11:52 AM »
i'm using v3.98j.


I'm using L4000x registers.. and some registers works fine, but when I use this L4000020 address all previous registers used become 0 in their values.


which version could I try?

thanks.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5280
    • View Profile
    • AdvancedHMI
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #11 on: May 20, 2015, 09:00:57 AM »
Can you list all of the addresses you are using so I can duplicate it the same?

elirofu

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #12 on: May 20, 2015, 09:31:11 AM »
Sure!

L400002
L400004
L400006
L4000016
L4000018
L4000020
L4000030
L4000032
L4000034
L4000044
L4000046
L4000048
L4000058
L4000060
L4000062

also when I star up the program it display all correct values but immediately becomes "0s"

Thanks.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5280
    • View Profile
    • AdvancedHMI
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #13 on: May 20, 2015, 11:45:26 AM »
I still can't get this to reproduce using the exact same addresses. Can you do a Wireshark capture and post the results?

elirofu

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Write signed(-) values over modbus TCP to holding registers
« Reply #14 on: May 20, 2015, 04:06:14 PM »
sure! let me do it and I will post the results!


Thanks.