AdvancedHMI Software
General Category => Support Questions => Topic started by: AabeckControls on June 25, 2015, 12:04:16 PM
-
I can add a new page, put a FromChange button on the main screen & use it once. If I add another page & a FormChange for that I can go to that page, but if I try to go to the earlier accessable page I get a KeyNotFoundException error with the detail "The given key was not present in the dictionary".
If I add another page I can access the new page but both previous pages show the error. I do Build (&/or Rebuild tried too) after adding a new page, compared the properties of the working button with the non-working ones, insured that the FormToOpen is the correct page (& all 3 pages show up to select - so they're there)
Is there something I'm missing here or not doing right?
-
This must be related to something else because the FormChangeButton does not access any dictionaries using keys.
Try using regular buttons and code like this:
- Add a Button from the All Windows Forms group in the Toolbox
- Double Click the button to get back to the code
- Add this code:
Form2.Show
Me.Hide
Change Form2 to the name of the form you want to open with the button.
See if you still get the error.
-
Archie,
Tried that for pages 2 & 3 & constantly get same error for the pages that come up when I enter the code in the ViewCode.
BasicButton1_Click = Page2.Show
Me.hide
BasicButton2_Click = Page3.Show
Me.hide
-
What version of AdvancedHMI and what driver are you using?
-
AdvancedHMI Beta v398g
AB DF1Com1 driver (that all the PB's, pilot lights & meters work OK with)
-
Archie,
When the error appears, the following code shows up highlighted (consistently the same section highlighted) but otherwise the DF1 driver works OK.
-
I have been able to reproduce this with the DF1Com driver. I will work on this and get back to you with a fix.
-
It looks like the DF1Com.vb needs 3 modifications:
- Edit AdvancedHMIDrivers\AllenBradley\Df1Com.vb
- Go to line 217 and change to this:
If MyDLLInstance > 0 AndAlso (DLL IsNot Nothing) AndAlso (DLL.Count > MyDLLInstance) AndAlso DLL(MyDLLInstance) IsNot Nothing Then
- Go to line 242 and change to this:
If MyDLLInstance > 0 AndAlso DLL.Count > 0 AndAlso DLL(MyDLLInstance) IsNot Nothing Then 'AndAlso Not DLL(MyDLLInstance).IsPortOpen Then
- The all the way near the bottom to line 430:
If MyDLLInstance > 0 AndAlso DLL IsNot Nothing AndAlso DLL.Count >= MyDLLInstance AndAlso DLL(MyDLLInstance) IsNot Nothing Then
-
Pasted the 3 lines, but when I Build I get the following 3 errors about Line 243, tried adding parenthesis where i thought they might go, but then got Syntax Error.
-
On line 242, the last part of the expression was commented out. Did you possibly remove that ' for the comment? This is the code at line 242 without the commented part:
If MyDLLInstance > 0 AndAlso DLL.Count > 0 AndAlso DLL(MyDLLInstance) IsNot Nothing Then
-
The comment is still commented out (')
-
Some where it is picking up IsPortOpen, but the only place that appeared was in the commented out code. Do you see that any place else?
-
I posted a patch for the DF1Com:
https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/Patches/
- Download and extract the file
- With AdvancedHMI open in Visual Studio, In Solution Explorer right click the folder AdvancedHMIDriver\AllenBradley then select Add->Existing Item
- Browse to the file that was downloaded and extracted
- It will ask if you want to overwrite the file, select Yes
- Rebuild the Solution
-
Downloaded it to my flash drive, will try it tomorrow 1st thing when I get back to work.
Thanks.
-
Archie,
Been a hectic day here & I just got around to this project & the new driver works OK.
Also, I saw the thread going on now about the MfgControl.AdvancedHMI.Drivers so I downloaded & installed that too.
Thank you.
-
Sounds good. Thanks for the update and let me know if you find any other issues.
Less than 6 months ago the drivers for the SLC/Micro family was almost completely rewritten, so a new bug is still popping up here and there.