1
Support Questions / Re: Writing to PLC problem
« on: June 16, 2015, 01:30:21 PM »
It never made it to the break point. I did find the cause though. The timer was disabled... Thought I checked that before...
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
EthernetIPforPLCSLCMicroCom_CNC.Write("N7:16", PartCount)
Unhandled Exception: System.InvalidOperationException: WinForms_SeeInnerException ---> System.NullReferenceException: Object reference not set to an instance of an object at AdvancedHMIDrivers.EthernetIPforCLXCom.CreateDLLInstance () [0x00000] in <filename unknown>:0 at AdvancedHMIDrivers.EthernetIPforCLXCom.set_IPAddress (System.String value) [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) AdvancedHMIDrivers.EthernetIPforCLXCom:set_IPAddress (string) at MfgControl.AdvancedHMI.MainForm.InitializeComponent () [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) MfgControl.AdvancedHMI.MainForm:InitializeComponent () at MfgControl.AdvancedHMI.MainForm..ctor () [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at MfgControl.AdvancedHMI.My.MyProject+MyForms.Create__Instance__[MainForm] (MfgControl.AdvancedHMI.MainForm Instance) [0x00000] in <filename unknown>:0 at MfgControl.AdvancedHMI.My.MyProject+MyForms.get_MainForm () [0x00000] in <filename unknown>:0 at MfgControl.AdvancedHMI.My.MyApplication.OnCreateMainForm () [0x00000] in <filename unknown>:0 at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () [0x00000] in <filename unknown>:0 at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (System.String[] commandLine) [0x00000] in <filename unknown>:0 at MfgControl.AdvancedHMI.My.MyApplication.Main (System.String[] Args) [0x00000] in <filename unknown>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: WinForms_SeeInnerException ---> System.NullReferenceException: Object reference not set to an instance of an object at AdvancedHMIDrivers.EthernetIPforCLXCom.CreateDLLInstance () [0x00000] in <filename unknown>:0 at AdvancedHMIDrivers.EthernetIPforCLXCom.set_IPAddress (System.String value) [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) AdvancedHMIDrivers.EthernetIPforCLXCom:set_IPAddress (string) at MfgControl.AdvancedHMI.MainForm.InitializeComponent () [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) MfgControl.AdvancedHMI.MainForm:InitializeComponent () at MfgControl.AdvancedHMI.MainForm..ctor () [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at MfgControl.AdvancedHMI.My.MyProject+MyForms.Create__Instance__[MainForm] (MfgControl.AdvancedHMI.MainForm Instance) [0x00000] in <filename unknown>:0 at MfgControl.AdvancedHMI.My.MyProject+MyForms.get_MainForm () [0x00000] in <filename unknown>:0 at MfgControl.AdvancedHMI.My.MyApplication.OnCreateMainForm () [0x00000] in <filename unknown>:0 at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () [0x00000] in <filename unknown>:0 at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (System.String[] commandLine) [0x00000] in <filename unknown>:0 at MfgControl.AdvancedHMI.My.MyApplication.Main (System.String[] Args) [0x00000] in <filename unknown>:0 |
using AdvancedHMI v3.83
I have been trying to read and write many tags to a plc, but when done in a group such as shown below, an exception will be generated. I have set the poling rate as long as 5000, but still get the exception. Ultimately I have about 50 tags to read and write, somewhat infrequently. I am triggering the event to read and write the tags from a bit in the plc using the DataSubscriber component.
Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
g_PLCReadValues.PLCStageCounterValue = EthernetIPforCLXCom_MainForm.Read("StepNumber")
g_PLCReadValues.MCR = EthernetIPforCLXCom_MainForm.Read("DI_MCRStatus")
g_PLCReadValues.HipotPass = EthernetIPforCLXCom_MainForm.Read("DI_HiPotPass")
g_PLCReadValues.HipotFail = EthernetIPforCLXCom_MainForm.Read("DI_HiPotFail")
g_PLCReadValues.AirPressureSwitch = EthernetIPforCLXCom_MainForm.Read("DI_AirPressureSwitch")
g_PLCReadValues.RejectPB = EthernetIPforCLXCom_MainForm.Read("DI_RejectResetPB.InDbncd")
g_PLCReadValues.PLCStageCounterValue = EthernetIPforCLXCom_MainForm.Read("StepNumber")
g_PLCReadValues.MCR = EthernetIPforCLXCom_MainForm.Read("DI_MCRStatus")
g_PLCReadValues.HipotPass = EthernetIPforCLXCom_MainForm.Read("DI_HiPotPass")
g_PLCReadValues.HipotFail = EthernetIPforCLXCom_MainForm.Read("DI_HiPotFail")
If g_PLCReadValues.RejectPB Then
btnRejectPBInd.BackColor = System.Drawing.Color.LawnGreen
Else
btnRejectPBInd.BackColor = System.Drawing.Color.DarkGray
End If
End Sub
Thanks for any suggestions.