AdvancedHMI Software
General Category => Support Questions => Topic started by: esturtz on April 19, 2018, 08:46:18 AM
-
Added a button and the EthernetIPforPLC5Com1 to the default MainForm AdvancedHMI project in VS2017. set the ip address for the EthernetIPforPLC5Com1 (PLC 5 80E) object to the correct value.
Added to the button click event
Private Sub MainMenuButton1_Click(sender As Object, e As EventArgs) Handles MainMenuButton1.Click
MsgBox(EthernetIPforPLC5Com1.Read("N16:255"))
End Sub
Below is the stack trace when run in debug mode
MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException occurred
HResult=0x80131500
Message=Read Failed - 240. Error code in EXT STS Byte
Source=MfgControl.AdvancedHMI.Drivers
StackTrace:
at MfgControl.AdvancedHMI.Drivers.AllenBradley.PCCC.PCCCforHMI.Read(String startAddress, Int32 numberOfElements)
at MfgControl.AdvancedHMI.Drivers.AllenBradley.PCCC.PCCCforHMI.Read(String startAddress)
at MfgControl.AdvancedHMI.MainForm.MainMenuButton1_Click(Object sender, EventArgs e) in C:\Projects\Mondelez\AdvancedHMIv399x\AdvancedHMI\MainForm.vb:line 32
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at MfgControl.AdvancedHMI.MainMenuButton.OnClick(EventArgs e) in C:\Projects\Mondelez\AdvancedHMIv399x\AdvancedHMI\FormChangeControls\MainMenuDriven\MainMenuButton.vb:line 208
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at MfgControl.AdvancedHMI.My.MyApplication.Main(String[] Args) in :line 81
the value in the PLC is 230. The weird thing is if I change the address to
MsgBox(EthernetIPforPLC5Com1.Read("N16:254"))
or
MsgBox(EthernetIPforPLC5Com1.Read("N16:256"))
it works without issue... Any ideas?
-
This could very well be a bug in the driver because it was fairly recent when the ability to go above 255 was added. I would try to read multiple elements to see if it can span over the value:
Dim v() as string=EthernetIPforPLC5Com1.Read("N16:254",3)
-
Yes, it allowed me to span across the value as you suggested.
-
Try the latest Beta version to see if it works correctly:
https://www.advancedhmi.com/forum/index.php?topic=2058.msg11756#msg11756
-
I downloaded the Beta and it has the same issue.
Thanks
-
Can you run a Wireshark and post the results?
I double checked the manual and it looks like the Beta 9 version should work , but I do not currently have access to a PLC5 to test.
-
These PLC5s are getting tricky to support. I had to dig one out of the storage closet and it had a dead battery so it lost all of its memory. Anyway, there is a new beta version 10 which fixes the problem:
https://www.advancedhmi.com/forum/index.php?topic=2058.msg11770#msg11770