Author Topic: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw  (Read 2467 times)

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
I have a machine with a version W AdvancedHMI using SerialDF1forSLCMicroCom1 to a SLC5/03

On a screen of value entries/display most of the time it shows the correct value and can enter and change them to a new value - however I frequently get values displaying the error "Object Reference Not Set To An Instance Of An Object" I have searched the forum and the results that show are either for a very old version, or an Ethernet driver, and seem to put the fault on the driver.

This happens on 3 screens that I display and change between 2 recipes. All the other pages don't show this message on any of the values they have, and the driver is copied and pasted from MainForm with all the same settings.


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #1 on: June 06, 2018, 03:05:14 PM »
Can you update your application to version 3.99x to see if it corrects the issue?

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #2 on: June 06, 2018, 03:38:15 PM »
Archie,

I will try to update it - but I have tried to update projects before to a newer version and either I'm not doing it right or missing something because it has never worked.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #3 on: June 06, 2018, 03:41:54 PM »
The method of updating:

- Download and extract the latest version
- Open the latest version in VS
- In Solution Explorer, right click the AdvancedHMI project and select Add->Existing Item
- Browse to the old solution and select 1 form's *.vb file (perform these steps once for each form because they will not import if multiple are selected)

After importing all of the forms, you may get some errors. Post those errors and I will advise how to correct.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #4 on: June 06, 2018, 06:23:25 PM »
Archie,

I opened v399x, Built it, added all forms, graphics and a .TXT file

When I rebuilt it I got a few errors that PLCAddressHighlight is not a member of BasicButton on 2 pages. See screenshot.

When I tried to open those 2 pages I got the error screen and then it went to blank 300x300 screens for both (9 PLC and MainForm)

When I opened all the other pages I got an error screen with an error for every FormChangeButton on it, then the screens all opened with everything except all the FormChangeButtons. Adding these back won't be a problem.

I uploaded a zipped copy to We Transfer     https://we.tl/bcAJSq9yTU

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #5 on: June 06, 2018, 06:35:13 PM »
try changing each to PLCAddressHighlightX.

Back to the original problem, since it is intermittent problem, I also assume that you use USB to serial adapter? If so, do you have a really good adapter?
« Last Edit: June 06, 2018, 06:43:49 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #6 on: June 06, 2018, 06:50:09 PM »
There is also a modified version of BasicButton here:

https://www.advancedhmi.com/forum/index.php?topic=1916.msg10739

It should be sufficient to add it to the Controls folder as existing item and replace the stock control.

You can always restore the stock control if this modified version doesn't help.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #7 on: June 06, 2018, 07:26:44 PM »
I just tried your solution and it shows properly and switches between forms.

The only thing I did was to replace the BasicButton control.

The driver on Recipe1 form has its baud set to AUTO - maybe change it to 19200 like all other forms.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #8 on: June 06, 2018, 08:07:20 PM »
backphi,

No adapter, this computer has a serial port on the motherboard.

Godra,

I downloaded that BasicButton and will try it tomorrow. When you opened the project did all the formchange buttons show properly? No errors shown?

The AUTO baud rate was missed, I will change that tomorrow also.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #9 on: June 06, 2018, 08:48:15 PM »
Everything shows properly.

Attached is a screenshot.

« Last Edit: June 06, 2018, 08:58:19 PM by Godra »

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #10 on: June 07, 2018, 07:25:39 AM »
I added the new BasicButton and there were no errors during rebuild.

Then when I opened a screen I got the error page with all the FormChangeButton errors, so I added the FormChangeButton from Ver W and rebuilt, now all the pages open correctly.

I am on my way to the machine with the new build, I will let you know if everything works right or there is any problems.

Thank loads.

EDIT: I did change the baud on Recipe 1 to 19200 also.
« Last Edit: June 07, 2018, 07:27:57 AM by AabeckControls »

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #11 on: June 07, 2018, 10:46:48 AM »
I put the v399X project on the machine and still get various, random "Object Reference.." errors - only on the 3 recipe screens.

I did change the baud on Recipe 1 to 19200 like all the others.

Now, for displaying the Steps1.txt I get an error on MainForm - and I added it to the project, and copied it into the Debug folder, before I rebuilt it.

Everything else is working as it should so far, but still testing all operations.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #12 on: June 07, 2018, 10:51:26 AM »
Now, for displaying the Steps1.txt I get an error on MainForm - and I added it to the project, and copied it into the Debug folder, before I rebuilt it.
After you add a file to the AdvancedHMI project, if you select it in Solution Explorer, then in the Properties Window set the CopyToOutputFolder, it will place it in the Debug folder automatically on each Build.


Do you get any more details on the error? In particular I'm looking for a stack trace that will give a line number.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #13 on: June 07, 2018, 12:40:36 PM »
Archie,

I didn't get an error in VS - it was only when I ran it on the machine I got that message.

I will follow your instructions then rebuild it again, last time I just added it then rebuilt.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Object Reference Nor Set o An Inistance.." Using AB DF1 & 399Vw
« Reply #14 on: June 07, 2018, 05:50:55 PM »
One of my thoughts is a brief loss of communication during a write may be causing this. I don't have a way to test this right now, but it should be able to be tested by unplugging the serial cable just before writing a value to see if it gives the same error.