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

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Lost all my Comms
« on: November 03, 2017, 11:26:55 AM »
Ok so I'm doing this remote update and something I did to my project caused me to loose all my communication from the HMI to the PLC.  When I test an older .exe which i used this ones source code to start from it works... but my new one doesn't.  All of the controls say No Response From PLC.  I made one button larger and it tells me this (See attachment). What did I do wrong?  Can anyone help me figure it out please.   All the IP and Port and Timeout settings match and I tried to do a code comparison of all the files in the projects except the AdvancedHMI project and they all appear to be identical.

Micro850 PLC
Still just trying to figure out this thing called Life.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #1 on: November 03, 2017, 11:52:53 AM »
I'm going to take a bit of a guess and say that maybe you changed something in the program that is not supported by the Micro800 series. There are a number of things the 800 will not support, such as program scope tag reading. I don't remember all of the limitations and I do not have access to a Midro800 right now to test anyhting. I seem to remember some limitation with timers and maybe reading arrays. The definite way to know is through a wireshark capture to see if the PLC rejects any requests.

I will also assume you are using version 3.99x?

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #2 on: November 03, 2017, 11:57:28 AM »
Yes I am reading arrays... I am also writing arrays... those 2 things are new.  3.99 is correct.
So thats interesting.  I could comment out the array sections and find out if thats it. Is there some comprehensive list of tasks/features that the Micro800 won't do so I can look through the code and find it?

Can't wireshark it, I'm in Michigan and this machine is in California in a clean room.
Still just trying to figure out this thing called Life.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #3 on: November 03, 2017, 12:31:52 PM »
I am not aware of any consolidated list of the limitations. I stumbled across a few while experimenting with a Micro820. The program scope limitation I since found buried in one of the manuals.

Strings in a Micro800 are handled differently that in the ControlLogix, but the driver was modified to make that work. Program scope tags are just completely blocked. I looked at a work-around to attempt to get those to work, but have not had success yet. I also found multi-read requests were not supported, which makes the updates tremendously slower when compared a ControlLogix.

Maybe the reading and writing of multiple array elements is not supported. It may require using a separate read or write for each element.

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #4 on: November 03, 2017, 12:52:15 PM »
Quote
Program scope tags are just completely blocked.

What is this? I don't know about it, perhaps I'm doing it?
Still just trying to figure out this thing called Life.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #5 on: November 03, 2017, 01:08:11 PM »
Quote
Program scope tags are just completely blocked.

What is this? I don't know about it, perhaps I'm doing it?
Those are the tags only accessible to an individual program. The non-global tags/variables. If you try to read those you will get an error saying the tag does not exist.

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #6 on: November 03, 2017, 02:32:03 PM »
Thanks that clears it up for me.
Still just trying to figure out this thing called Life.

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #7 on: November 04, 2017, 01:10:58 PM »
FYI:

I haven't been able to try anything yet but I was looking at the two solutions and I noticed that the original solution did NOT! have any DataSubsribers reading an Array... whereas my new logic has several.

So looks like i'll have to reinvent the wheel on my code and parse them all manually.  Quick Question.  Whats the recommend MAX number of tags I can read/write in one DS2?

Thanks
Still just trying to figure out this thing called Life.

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #8 on: November 04, 2017, 02:07:45 PM »
Ok so another question, I have 64 tags to write to the PLC that I need to parse a List object for each value. Since I can't just do an Array write, whats the best method to write these values into the PLC? I know I can do a For Loop with i and for the name but what AdvancedHMI Component should I use for writing them down?  Also is there a Synchronous method for writing the values? I'd love to do some sort of a Progress Bar to let the user know the values are downloading.

Thanks in advance.
Still just trying to figure out this thing called Life.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #9 on: November 05, 2017, 07:50:01 AM »
There is no limit to the number of items added to a DataSubscriber2. Here is what you want to keep in mind.... The Micro800 series does not support multi-read requests, therefore every item requires its own packet. Each packet will typically take 10ms round trip. The DataSubscriber adds its items to the update list the same as the controls on the screen, so it will read those values at the same rate (unless you use a separate driver instance with a different PollRateOverride). So let's take the case where you have 25 items on the form and you have a DataSubscriber with 25 items. With 50 individual packets to update all values, it will takes about 500ms in between updates of each value. In other words be careful on how much you add to a single form and DataSubscribers when using the Micro800 series because things can get sluggish.

You can write an array using a for next loop. For example:

For index=0 to 99
    EthernetIPforMicro800Com1.Write("PLCArray[" & index & "]", MyArray[index])
Next


The write is a synchronous operation, so your screen will essentially freeze during that loop, unless you put it on a background thread.

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #10 on: November 05, 2017, 09:46:27 AM »
Is there any sort of Handshake bit or a return like a function returns a result to let you know the transfer was a success? 

Also I have a DS2 and EthernetIPforMicro800Com1 driver on my main MDIParent form and each childform(1 displayed at a time) which is docked in the parent has its own as well. The parent only has like 6 tags in the DS2, do you see this as a problematic setup?



Still just trying to figure out this thing called Life.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #11 on: November 05, 2017, 12:32:36 PM »
Since the Write is synchronous, it will return when the write has succeeded otherwise it will throw an exception.

Whether your configuration will be a problem depends on how fast you need the data to refresh. The PollRateOverride regulates the refresh rate as long as the PLC can keep up to it. For example, lets say you set PollRateOverride to 100ms, but have 15 items in the screen. It will most likely refresh at about 150ms and not be able to achieve the 100ms.

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #12 on: November 05, 2017, 03:58:37 PM »
Good to know, so if I just do a Try Catch on the call and if it doesn't cast an error I can just update my progress bar within the loop?

Code: [Select]
Try
     For index=0 to 99
         EthernetIPforMicro800Com1.Write("PLCArray[" & index & "]", MyArray[index])
         Me.Progressbar1.Value = index
     Next     
Catch ex As Exception
     Messagebox.show(ex.message, "Download Failed",vbOK)
End Try
Still just trying to figure out this thing called Life.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Lost all my Comms
« Reply #13 on: November 05, 2017, 08:07:17 PM »
Exactly!

timryder

  • Jr. Member
  • **
  • Posts: 83
  • Still trying to figure it out
    • View Profile
Re: Lost all my Comms
« Reply #14 on: November 06, 2017, 02:12:49 PM »
So I tried serveral different versions of downloading the 64 tags to the PLC. Again it's a Micro850.  So what I've found today is that the PLC DOES support the array write.

The first method I did was the following.
Code: [Select]
Try
            For i As Integer = 1 To 32
                Me.ProgressBar1.Increment(1)
                Dim s As String = "XPartPositions[" & i & "]"
                EthernetIPforMicro800Com1.Write(s, xValues.Item(i).ToString)
                Me.tbActions.AppendText("Download: XPartPositions[" & i & "]" + vbCrLf)
            Next
            For i As Integer = 1 To 32
                Me.ProgressBar1.Increment(1)
                Dim s As String = "YPartPositions[" & i & "]"
                EthernetIPforMicro800Com1.Write(s, yValues.Item(i).ToString)
                Me.tbActions.AppendText("Download: YPartPositions[" & i & "]" + vbCrLf)
            Next
99% of the time the logic would parse through 1 or a few of them and then give me "Object not set to an instance of an object"  Randomly and very rarely the function would blaze through all 64 tags and return successful. However most all of the time it would fail.

Code: [Select]
Dim s(31) As String
            For index = 0 To 31
                s(index) = xValues(index).ToString
            Next
            Dim s2(31) As String
            For index = 0 To 31
                s2(index) = yValues(index).ToString
            Next

Then for the heck of it I disabled all of the other forms in my project so they don't load at all which make sure none of their driver instances or DS2 are active and it seemed to help some... but still it would fail in the same manor nearly every time.

So I tried to use the BeginWrite function of the driver and believe it or not... this worked! It wouldn't return with an error and I actually saw the data change on the PLC.  I will note however sometimes I wouldn't see it change for several seconds or even as much as a minute without attempting it again.  I even tried refreshing the page.  But it became more frequent that the data in the array just didn't change.  The more I enabled things in my project again the worse it got.

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?
Still just trying to figure out this thing called Life.