Author Topic: Lost all my Comms  (Read 5593 times)

Phrog30

  • Guest
Re: Lost all my Comms
« Reply #15 on: November 06, 2017, 04:11:57 PM »
So what I'm wondering now, is there anyway to pause all other driver instances on other forms?  Can't I tell them to stop somehow?

Yes, when you download the application, Archie has this code on the main form.  Basically, when not visible it stops the comms.

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #16 on: November 06, 2017, 04:58:48 PM »
i was looking at that code and I see the call he's making, but what I don't understand is how to Reinitialize the comms?

Does anyone see it as a problem to have a Communications driver which is active all the time on my MDIParent form and also a driver on each subsequent child form which 1 will show at a time.  Does this raise any alarms for anyone?  Because i'm just having loads of communication issues and timeouts. I can't see any other way to do it though... in my HMI design, the Parent is always monitoring over machine status bits that the rest of the forms use and also some controls like status banner utilize also.  Thoughts are really appreciated.

Also... whats the difference between the 2 of these?
Code: [Select]
Dim s As String = DataSubscriber21.PLCAddressValueItems(1).LastValue
Dim s As String = e.Values(1)
« Last Edit: November 06, 2017, 06:24:16 PM by timryder »
Still just trying to figure out this thing called Life.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #17 on: November 06, 2017, 06:42:54 PM »
Subscription communications cab be paused by setting the DisableSubscriptions property to true for each driver instance. The purpose of the driver instance for each form is to have the granularity of pausing groups of subscriptions, so when the form is hidden that group of communications are paused. If a single instance were to be used for everything, then everything would update including hidden forms, therefore making update rates much slower.

To pause communcations, it would be like this:

EthernetIPforMicro800Com1.DisableSubscriptions = True

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #18 on: November 06, 2017, 07:26:22 PM »
Thanks Archie.

What about my other questions in the previous post.
Still just trying to figure out this thing called Life.

Phrog30

  • Guest
Re: Lost all my Comms
« Reply #19 on: November 06, 2017, 07:46:04 PM »
I use mdiparent as well. I have no issues. I don't show all forms in the beginning though.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #20 on: November 06, 2017, 08:03:08 PM »
whats the difference between the 2 of these?
Code: [Select]
Dim s As String = DataSubscriber21.PLCAddressValueItems(1).LastValue
Dim s As String = e.Values(1)
The first line of code can be used anywhere. The second only works in the DataChanged or DataReturned event handler.

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #21 on: November 07, 2017, 07:19:20 AM »
So I'm working on a test today to see if this will help... I've added code to the "Leave" and "Enter" events of each child form I can

Code: [Select]
    Private Sub frmMain_Leave(sender As Object, e As EventArgs) Handles MyBase.Leave
        Me.EthernetIPforMicro800Com1.DisableSubscriptions = True
    End Sub
    Private Sub frmMain_Enter(sender As Object, e As EventArgs) Handles MyBase.Enter
        Me.EthernetIPforMicro800Com1.DisableSubscriptions = False
    End Sub

Since I am opening all of my forms in the beginning which for me is needed, otherwise the forms flash when you open and close them constantly and I don't want the border or the form controls to be visible so it's much cleaner result for me.  Anyway because of that I added these methods which I hope fully reduce the overall traffic on the network and improve my stability.
Still just trying to figure out this thing called Life.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #22 on: November 07, 2017, 07:35:23 AM »
You mentioned the PLC does support the writing a arrays in a single write. So was the original problem a result of the communication problems or is it the reading of arrays?

The "Object not set to an instance" error is not normal. This must be a bug in the driver. The Micro800 driver is actually the same driver as the CLX driver only with Multi-Read disabled and the route path removed. I haven't had any reports of this error with the CLX series, so it must be something unique to the 800.

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #23 on: November 07, 2017, 09:34:11 AM »
Archie,

Yes I have found that it absolutely DOES support Writing using the .BeginWrite(PLCTag,NumElements,Array)

I can also confirm that it does appear to be reading an array of values.  I have a DS2 on my form which is looking up a DINT array of 32 and it pulls all of that in just fine.  I'm doing a local compare of my array versus the PLC's to determine if my "Download" was successful or not.  Reading seems to be very consisting however while reading and when I try to Write is where I get the issues.  I'm remoting into a computer in CA from MI every morning for 3-4 hours so my debug time and abilities are limited because the remote computer doesn't have VS installed on it.  So today I'm going to try and set all of my Driver.DisableSubcriptions = true on every other form when I have my Download dialog open and foremost.  Perhaps the PLC just can't do both?

Is there anything you'd like me to try for troubleshooting that "Object not set to an instance" error?
Still just trying to figure out this thing called Life.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #24 on: November 07, 2017, 09:53:22 AM »
I have only done a little bit of work with the Micro800 series, so I never really tried to push the communication ability to the limit. I just need to get that opportunity to see if I can replicate the problem. My suspicion is that it is requesting array data and the PLC returns something not recognized as an error, then the driver tries to parse the values from the packet as if it were the array data

Unfortunately it may be a couple weeks before I am at the shop long enough to dig out the Micro820 and do some testing.

There is one other option you can try.. there is a patched version of 3.99x that corrects a problem in the CLX driver. I do not suspect this will do anything because the problem only occurs when all communications stop for about 15 seconds, then a new request is done.
« Last Edit: November 07, 2017, 10:06:17 AM by Archie »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #25 on: November 07, 2017, 09:56:14 AM »
If you wanted to try the patched version, you can get it form here:

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/

Phrog30

  • Guest
Re: Lost all my Comms
« Reply #26 on: November 07, 2017, 10:02:56 AM »
Also, in this thread I have a link to an app that shows how I change forms and stop comms:
http://advancedhmi.com/forum/index.php?topic=1896.0

James

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #27 on: November 07, 2017, 10:31:59 AM »
I keep getting lots of errors... all the time..
I have deleted all of the drivers from every other form excepting one which i'm working on.  I keep getting this when performing my Write or BeginWrite

"No response from PLC when getting Tag Information"  Also the writing is incredibly slow when writing 1 tag at a time and nearly always it breaks in the middle... the write array seems to be FAST but the PLC doesn't update the local data for quite sometime... minutes even.... i'll try multiple attempts of downloading but still... minutes....
« Last Edit: November 07, 2017, 10:34:39 AM by timryder »
Still just trying to figure out this thing called Life.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #28 on: November 07, 2017, 10:38:50 AM »
Just for a shot in the dark, download the V3.99xPatched version.

Make a copy of your current complete solution. Replace the complete AdvancedHMIDrivers folder from the patched version into the copy of your project. Open the project and Rebuild Solution.

See if that version makes any difference.

If there was only a way to Wireshark the communications, that would reveal exactly what is happening.

Does your original version still work without errors?

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #29 on: November 07, 2017, 10:41:20 AM »
FYI,

That IS with the update 3.99x patched.  All i did was copy over the Drivers folder in the project into my new project and it made it worse.   Now i can't even get 1 tag to write either way,  Can I wireshark from the computer itself?

If so i can do that

EDIT: ALso I don't mean to push my problems onto you but if you're interested I can have you remote into my computer using TeamViewer and see what im seeing... you can even drive the system in CA and try to capture the wireshark.   If you have time and or interest anytime this week give me a contact.  tryder@columbiamt.com  Tim Ryder.  I'll hook you up with the remote tool.

EDIT 2:  Sorry to forgot to answer your question.. Yes the absolute original version which shipped with the machine months ago works without issue.
« Last Edit: November 07, 2017, 10:50:43 AM by timryder »
Still just trying to figure out this thing called Life.