Author Topic: error changing driver IP address  (Read 1516 times)

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
error changing driver IP address
« on: December 29, 2014, 08:29:00 PM »
I have a button on my forms to change the PLC driver ip address ,

 Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        EthernetIPforPLCSLCMicroCom1.IPAddress = TextBox1.Text
    End Sub

in ver 390 it worked in 395 I get this error

Darrell

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5270
    • View Profile
    • AdvancedHMI
Re: error changing driver IP address
« Reply #1 on: December 29, 2014, 08:38:36 PM »
Are you using this with a SLC/Micro or a Control/CompactLogix? The reason I ask is your code snippet shows one driver, but the screen shot shows another. I want to make sure I am testing on the right driver.

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: error changing driver IP address
« Reply #2 on: December 29, 2014, 08:59:37 PM »
I have one of each on the same form , when i try to change the the slc/micro I get this error

Darrell

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: error changing driver IP address
« Reply #3 on: December 31, 2014, 10:38:16 PM »
maybe this will help

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: error changing driver IP address
« Reply #4 on: January 14, 2015, 09:31:57 PM »
Is this something that would be an easy fix , I have several HMI's built in v3.90 that monitor both control logix and micrologix  at same time . I've imported all into all into v3.97c , all the buttons seem to work now , but when I try to force a new IP into the micrologix driver I get the above error. I have several HMI's that monitor 3 or 4 identical machines and all I would have to do is change the IP rather than build new forms for each one. Plus If I need to make a change I wouldn't need to make it on several forms. I will normally put button with different ip for each different machine.

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        EthernetIPforPLCSLCMicroCom1.IPAddress = "157.157.1.12"
    End Sub

Darrell

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5270
    • View Profile
    • AdvancedHMI
Re: error changing driver IP address
« Reply #5 on: January 14, 2015, 09:57:21 PM »
Further up in the CreateDLLInstance, try making this change:

    Friend Overrides Sub CreateDLLInstance()
        If Not Me.DesignMode Then
            If DLL.Count > 0 Then
                '* At least one DLL instance already exists,
                '* so check to see if it has the same IP address
                '* if so, reuse the instance, otherwise create a new one
                MyDLLInstance = 0
                While MyDLLInstance < DLL.Count AndAlso (DLL(MyDLLInstance) Is Nothing OrElse _
                           (DLL(MyDLLInstance).EIPEncap.IPAddress <> m_IPAddress Or DLL(MyDLLInstance).EIPEncap.Port <> m_Port))
                    MyDLLInstance += 1
                End While
            End If

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: error changing driver IP address
« Reply #6 on: January 25, 2015, 09:04:33 PM »
Seems to work ok in V397D
thanks Darrell