AdvancedHMI Software

General Category => Support Questions => Topic started by: mourazo on May 21, 2020, 07:50:14 AM

Title: System.ObjectDisposedException:
Post by: mourazo on May 21, 2020, 07:50:14 AM
Hello, I trying to change the IPAddress from the modbusTCPCom in execution time when I receive this exception

System.ObjectDisposedException: 'The discarded object cannot be accessed.
Name of the object "ModbusTCPDataLinkLayer'

What could be the problem?

Thanks.

(https://i.imgur.com/tlbtsfq.png)
Title: Re: System.ObjectDisposedException:
Post by: Archie on May 21, 2020, 09:07:11 AM
It looks like changing the IP address causes the DLL to be disposed. Before changing the address, try disabling subscriptions:

ModbusTCPCom1.DisableSubscriptions=True
ModbusTCPCom1.IPAddress= "192.160.1.1"
ModbusTCPCom1.DisableSubscriptions=False
Title: Re: System.ObjectDisposedException:
Post by: mourazo on May 22, 2020, 02:17:36 AM
it works Archie. Thanks!