Author Topic: EthernetIPforPLCSLCMicroCom1 - forcing and ip address in the driver  (Read 2282 times)

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
I want to use a HMI to monitor several different different machine that are all programed exactly the same but have different IP addresses and on different networks. All have Micrologix 1400 , i move my laptop around to different machines I don't want to have to build a new HMI with a different ip for each one. Is it possible to add a button and textbox to force a new IP into the driver from a form.


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: EthernetIPforPLCSLCMicroCom1 - forcing and ip address in the driver
« Reply #1 on: October 11, 2014, 12:14:34 AM »
You can add buttons to a form, double click the button to get to the code and enter:

EthernetIPforPLCSlcMicroCom1.IPAddress="192.168.1.10"

The ControlLogix driver has a feature that lets you put the name of an INI file in the IPAddress property. This feature will eventually be added to the SlcMicro driver.

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: EthernetIPforPLCSLCMicroCom1 - forcing and ip address in the driver
« Reply #2 on: October 13, 2014, 09:29:36 PM »
Iv e been programing plc's for over 30 years but vb is new to me and I'm not totally sure how to add this into the button code.

Private Sub BasicButton3_Click(sender As System.Object, e As System.EventArgs) Handles BasicButton3.Click

       EthernetIPforPLCSLCMicroCom1.IPAddress = "159.159.1.14"

    End Sub
----------------------------------------------------------------
what i would really like to have is a

textbox to enter a new ip

have a button to click and enter the new ip into the plc driver

and then display the new ip that I just entered and know what im connected to.

thanks
jazzman


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: EthernetIPforPLCSLCMicroCom1 - forcing and ip address in the driver
« Reply #3 on: October 13, 2014, 10:17:06 PM »
Add a TextBox to the form, then use this code in your button click event handler:

EthernetIPforPLCSLCMicroCom1.IPAddress = TextBox1.text

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: EthernetIPforPLCSLCMicroCom1 - forcing and ip address in the driver
« Reply #4 on: October 18, 2014, 09:51:51 PM »
I built my HMI for a machine to monitor values etc. , I have several identical machines on the same network , different ip's . The same HMI will be valid for any one of them . I want to easily switch between them.

 I tried this ,
a textbox and button to change the IP in the plc driver , it changes the ip i think but does not connect to the new ip



Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        EthernetIPforPLCSLCMicroCom1.CloseConnection()
        EthernetIPforPLCSLCMicroCom1.IPAddress = TextBox1.Text

Darrell

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: EthernetIPforPLCSLCMicroCom1 - forcing and ip address in the driver
« Reply #5 on: October 20, 2014, 06:02:23 AM »
Thanks for the response Archie , Tried it again and it does work ,

Love this program

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: EthernetIPforPLCSLCMicroCom1 - forcing and ip address in the driver
« Reply #6 on: November 25, 2014, 06:46:09 AM »
On my first form I have a button and textbox to force a new IP address into the plc driver , It will only change on the form that is open, When I open my 2nd form and  the 1st one hides , and I have to change it again on the form that is open or now showing . Is there a way  force it on the first form and have it change on all of them at the same time.

Darrell