I have a page with a DataSubscriber2 on it, and each time I open this page at runtime I get a VBA error, which points to this object. The error details are copied below. I have checked and double checked the setup of the object to make sure I've entered all my address details correctly, and written the VBA correctly, and I can't find a fault. Also - if I click Continue, the code continues to work. I know this, because the DataSubscriber is monitoring all of the date/time data from the PLC, and updating some text on the page to show the current PLC date/time. While the error is on the screen, and after I click continue, it continues to count up the seconds and minutes just fine.
I tried running the page from within the development environment, and I get the same error. If I click continue, it dumps out of the runtime with another error. While playing with this, I accidentally unchecked the "break when this type of error is encountered", and now it goes straight to dumping out of runtime as soon as I try and load this page.
So, a couple of things I'm trying to work out:
- How do I get that box re-checked, so it "breaks" on this type of error again?
- What's going on with the error in the first place, and how do I fix it?
Error data:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at MfgControl.AdvancedHMI.Display_SystemSettings.DataSubscriber21_DataChanged(Object sender, PlcComEventArgs e) in Z:\Alan\2205 Watering System\Programs\SCADA\AdvancedHMI\Display_SystemSettings.vb:line 18
at AdvancedHMIControls.DataSubscriber2.DataChangedSync(Object sender, PlcComEventArgs e) in Z:\Alan\2205 Watering System\Programs\SCADA\AdvancedHMIControls\Components\DataSubscriber2.vb:line 253
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
AdvancedHMI
Assembly Version: 3.9.9.18
Win32 Version: 3.9.9.18
CodeBase: file:///C:/Watering%20System/Programs/SCADA/AdvancedHMI/bin/Debug/AdvancedHMI.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
MfgControl.AdvancedHMI.Drivers
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Watering%20System/Programs/SCADA/AdvancedHMI/bin/Debug/MfgControl.AdvancedHMI.Drivers.DLL
----------------------------------------
AdvancedHMIControls
Assembly Version: 3.9.9.18
Win32 Version: 3.9.9.18
CodeBase: file:///C:/Watering%20System/Programs/SCADA/AdvancedHMI/bin/Debug/AdvancedHMIControls.DLL
----------------------------------------
MfgControl.AdvancedHMI.Controls
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Watering%20System/Programs/SCADA/AdvancedHMI/bin/Debug/MfgControl.AdvancedHMI.Controls.DLL
----------------------------------------
AdvancedHMIDrivers
Assembly Version: 3.9.9.18
Win32 Version: 3.9.9.18
CodeBase: file:///C:/Watering%20System/Programs/SCADA/AdvancedHMI/bin/Debug/AdvancedHMIDrivers.DLL
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.