AdvancedHMI Software

General Category => Support Questions => Topic started by: drumsticksplinter on July 19, 2016, 05:28:37 PM

Title: Overflow error when writing large numbers to click plc
Post by: drumsticksplinter 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
Title: Re: Overflow error when writing large numbers to click plc
Post by: Archie on July 19, 2016, 06:11:03 PM
Try it this way:

ModbusRTUCom1.Write("L449153", Total_Counts)
Title: Re: Overflow error when writing large numbers to click plc
Post by: drumsticksplinter on July 19, 2016, 07:29:09 PM
Thanks Archie, will try tomorrow  :)
Title: Re: Overflow error when writing large numbers to click plc
Post by: Wizzy 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
Title: Re: Overflow error when writing large numbers to click plc
Post by: Archie 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.