Author Topic: IP Address change in code?  (Read 1935 times)

Jesse

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
IP Address change in code?
« 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?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: IP Address change in code?
« Reply #1 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"