AdvancedHMI Software

General Category => Support Questions => Topic started by: Jesse on October 22, 2013, 10:23:35 AM

Title: IP Address change in code?
Post by: Jesse on October 22, 2013, 10:23:35 AM
Ok so I'm building a pretty large program and im almost done the only thing is in the future I may want to add more CLX to my program ( so it might be interacting with as many as 5 plcs at a time) I have a lot of code written to write to my ethernetdriver so i was wondering instead of adding more drivers and copying alot of the code, is there a piece of code that I could write to change my drivers ip address.  Like if I were to have a combo box or list box with the 5 plcs listed on it and depending on which was selected it wrote a certain IP address to that driver?
Title: Re: IP Address change in code?
Post by: Archie on October 22, 2013, 11:16:36 AM
You will want to close your connection before changing the IP address:

EthernetIPforCLXCom1.CloseConnection()
EthernetIPforCLXCom1.IPAddress="192.168.0.2"