Author Topic: EthernetIPforCLXCom control disappeared from Mainform  (Read 1911 times)

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
EthernetIPforCLXCom control disappeared from Mainform
« on: January 21, 2015, 06:58:49 PM »
AdvancedHMI v3.97 , Visual Studio 2013

Hopefully someone can help me on this one.

I had a one and only instance of control EthernetIPforCLXCom on my MainForm named "EthernetIPforCLXCom_MainForm"  and it disappeared.

I had just started a debug run and the PLC tags were not updating. I closed down my application and Visual studio, backed up my AdvancedHMI and then opened it back up in visual studio.  I noticed there were now two instances of EthernetIPforCLXCom on my MainForm, named "EthernetIPforCLXCom1"  and "EthernetIPforCLXCom2", both with the default IP address.  My original "EthernetIPforCLXCom_MainForm"  is missing.  So I deleted the "EthernetIPforCLXCom2" and tried to rename the "EthernetIPforCLXCom1" my original name of  "EthernetIPforCLXCom_MainForm". 

I received the message:  " Property value is not valid"  There is already a component named 'EthernetIPforCLXCom_MainForm'.  Components must have unique names, and names must be case-insensitive.  A name also cannot conflict with the name of any component in an inherited class.

So apparently is still exists, but doesn't work anymore and doesn't show up on the MainForm.vb[design]

How can I fix this?

Thanks!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: EthernetIPforCLXCom control disappeared from Mainform
« Reply #1 on: January 21, 2015, 07:05:05 PM »
With you form selected in Solution Explorer, click the icon for "Show All Files" at the top of the Solution Explorer.

Now expand down your form in Solution Explorer

You should see a file with the extension designer.vb

Open that file and you should find your declaration of the driver. Somewhere in that file, something became corrupt.

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: EthernetIPforCLXCom control disappeared from Mainform
« Reply #2 on: January 22, 2015, 12:17:55 PM »
Suggestions on identifying and fixing it?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: EthernetIPforCLXCom control disappeared from Mainform
« Reply #3 on: January 22, 2015, 01:50:59 PM »
No real good suggestion. Just compare it to another driver that is working correctly. You should see the variable declaration near the bottom, then a section that creates the instance, a section that sets the properties, and finally a line that adds it to the component collection.

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: EthernetIPforCLXCom control disappeared from Mainform
« Reply #4 on: January 22, 2015, 06:21:18 PM »
I have compared the Mainform.designer.vb with other projects, looking at the EthernetIPforCLX drivers and cannot find anything different, other than the name I gave my driver, in this case "EthernetIPforCLXCom_MainForm".  The code will run fine. 

I have not had any more instances of losing my "EthernetIPforCLXCom_MainForm" control.  However I am experiencing Visual studio 2013 crashes, enough times that I have found a series of events that can cause it to stop working(crash). Usually when it stops working, Visual studio will automatically restart.

I have 10 forms in my application, two of which are using a EthernetIPforCLX control.   It is only with these two forms that I can cause a crash.

On those two particular forms, if I double click on on object on the form, as usual, it will open up a sub click event in the vb code.  On other forms, I do this and decide not to use the sub click event, I would delete the sub from the vb code.  but if I do that with these two forms, when I go back to the form[design]. the window goes blank.  I then close the form and when I re-open, visual studio will stop working and restart.  I can then re open the solution and then re-open the form.  At that point is when a new "EthernetIPforCLX1" shows up.  When I delete it, I get two error messages.

"An error occurred while processing this command.  Object reference not set to an instance of an object"

followed by another pop up error "Object reference not set to an instance of an object"

After this application will run again.

What would cause it to create the new "EthernetIPforCLX1"?

If I am shooting myself in the foot somewhere, please tell me.

Thanks!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: EthernetIPforCLXCom control disappeared from Mainform
« Reply #5 on: January 22, 2015, 07:29:08 PM »
At some point there was a problem with the CLX driver that would throw an exception if you tried to delete it from your form. This could be related to that same problem. Try version 3.97d to see if it helps.

The reason you get another instance added is because the controls were originally designed to add a driver to the form if one did not exist. Since version 3.80, this functionality no longer works, but the code has not yet been removed, so it once in a while will add a new driver instance.