Author Topic: ModbusTCP write  (Read 899 times)

lsnyd0ga

  • Newbie
  • *
  • Posts: 4
    • View Profile
ModbusTCP write
« on: July 22, 2020, 10:03:48 AM »
I built my first screen using the Tools such as digital panel meter and keyboard input and they both are reading and writing to "42074" location.  In a push button code I tried writing data to the same register using:
ModbusTCPCom1.Write("42074", "123") but it never puts any thing in the register.
I must be missing something... Also is there a document on the ModbusTCPCom?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: ModbusTCP write
« Reply #1 on: July 22, 2020, 10:20:41 AM »
Try it this way:

- Add a BasicButton to the form
- Set PLCAddressClick to 42074
- Set OutputType to WriteValue
- Set ValueToWrite to 123

Then see of that works

lsnyd0ga

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: ModbusTCP write
« Reply #2 on: July 22, 2020, 12:38:49 PM »
Ah!  that worked and in checking that I realized I was writing to 43074 and monitoring 42074.....my bad and thanks

lsnyd0ga

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: ModbusTCP write
« Reply #3 on: July 22, 2020, 02:50:30 PM »
One Follow-up. Does the Modbus driver or the Controls have an option to convert to BCD or do I do that in code?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: ModbusTCP write
« Reply #4 on: July 22, 2020, 03:14:49 PM »
The latest beta version allows address modifiers for BCD

42074@B

lsnyd0ga

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: ModbusTCP write
« Reply #5 on: July 22, 2020, 05:47:17 PM »
My code gives me an error when I use that format.  I just installed this software Monday. Do I need to download the Beta?  If so, where is the beta download?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: ModbusTCP write
« Reply #6 on: July 22, 2020, 06:20:35 PM »
That only works in version 3.99y Beta