Author Topic: Overflow error when writing large numbers to click plc  (Read 1506 times)

drumsticksplinter

  • Newbie
  • *
  • Posts: 2
    • View Profile
Overflow error when writing large numbers to click plc
« on: July 19, 2016, 05:28:37 PM »
Hi

Hopefully someone will be able to offer some advice please?

I'm communicating to a Click plc using Modbus RTU. I have my vb project reading and writing to the registers in the plc just fine. However, I need to be able to write a int32 value to the plc and I get an overflow error when trying to do so. I'm sending the value of a numeric up down box to what Click plc's call an "I2" register (2 word integer):

Code: [Select]
Dim Total_Counts As Int32 = TotalCounts.Value
Mainform.ModbusRTUCom1.Write(449153, Total_Counts)

I presume that the overflow error is because I'm trying to write to a Int16 with a Int32? Is it possible to write long numbers at all?

Thanks,

Adam

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Overflow error when writing large numbers to click plc
« Reply #1 on: July 19, 2016, 06:11:03 PM »
Try it this way:

ModbusRTUCom1.Write("L449153", Total_Counts)

drumsticksplinter

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Overflow error when writing large numbers to click plc
« Reply #2 on: July 19, 2016, 07:29:09 PM »
Thanks Archie, will try tomorrow  :)

Wizzy

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Overflow error when writing large numbers to click plc
« Reply #3 on: September 01, 2016, 10:17:31 AM »
When connecting the Click PLC to HMI, do I have to create a "send and receive instructions" in the PLV

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Overflow error when writing large numbers to click plc
« Reply #4 on: September 01, 2016, 12:34:29 PM »
When connecting the Click PLC to HMI, do I have to create a "send and receive instructions" in the PLV
The Click automatically responds to Modbus requests, so you do not have to do anything in the program to get the HMI to show data.