Author Topic: Modbus read to Double  (Read 1969 times)

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Modbus read to Double
« on: October 29, 2023, 01:02:53 PM »
Hey Archie, I have been away from AHMI for awhile but now I'm taking on another project and need to relearn some things.  I want to set the maximum value of a guage compact on a button click with a modbus register value but can't get the string from the modbus read to parse to the double of the meter.  i tried Double. tryparse method but this does not accept String() types.  Any help is appreciated, thanks

 

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Modbus read to Double
« Reply #1 on: October 30, 2023, 02:01:24 PM »
Maybe add

Code: [Select]
(0)
at the end and also check the following link:

  https://stackoverflow.com/questions/1172306/convert-string-to-double-vb
« Last Edit: October 30, 2023, 02:13:41 PM by Godra »

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: Modbus read to Double
« Reply #2 on: October 30, 2023, 10:21:43 PM »
Thanks Godra, I had already googled that link and was able to figure it out.  I had one too many arguments in my code.

Much appreciated.