Author Topic: Handling "missing tag name" error  (Read 2959 times)

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Handling "missing tag name" error
« Reply #15 on: November 13, 2018, 10:03:07 AM »
That correct.
I assumed you would want to see a variable getting deleted while capturing.

Around line 300 I believe is when I deleted one of the variables and around line 1000 is when I added it back in.

Sorry I thought I mentioned that I had done this in my previous post but I didn't.. my bad.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: Handling "missing tag name" error
« Reply #16 on: November 13, 2018, 10:47:22 AM »
The Wireshark looks ok, so it must be related to the AdancedHMI version.

To upgrade:
- Download and extract the latest version
- Open the latest version in Visual Studio
- In Solution Explorer, right click the AdvancedHMI project
- Select Add->Existing Item
- Browse to your existing project and select the .vb file for the first form. Repeat this process for each form. ONLY SELECT 1 AT A TIME and ONLY SELECT THE .vb file
- After adding all forms, then Rebuild Solution

Depending on the version upgrading from and the controls you have used, you may have some errors that need to be manually corrected.

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Handling "missing tag name" error
« Reply #17 on: November 13, 2018, 01:05:30 PM »
Problem Solved.
I am now using 3.99y beta and the issue has disappeard...HOWEVER:

Is there a way, in case there isn't one already, of reading status of drivers dll or maybe controls dll to get a global status of all current subscriptions?
It is very important for the user to access a global array of status bits; I kind of created one now but I am having trouble accessing the array from my main form under AdvancedHMI;  I am not a VS expert but would like to learn how to do that. I was thinking of adding an event to the controls dll but not sure of if there's an easier way..
Also I prefer not to have to customize any of the AdvancedHMI code in controls and drivers so future updates go smoothly.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: Handling "missing tag name" error
« Reply #18 on: November 13, 2018, 01:30:27 PM »
What status are you looking for? Whether it has an error, whether it is reading data, etc?

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Handling "missing tag name" error
« Reply #19 on: November 13, 2018, 01:32:23 PM »
For starters lets say the most important thing I am looking for is if the tag name is missing on the PLC side. error string "Path segment..."

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: Handling "missing tag name" error
« Reply #20 on: November 13, 2018, 01:34:47 PM »
You can add an event handler for the driver' ComError event as such:
Code: [Select]
    Private Sub EthernetIPforCLXCom1_ComError(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforCLXCom1.ComError
        Me.Text = "Error : " & e.ErrorMessage
    End Sub

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Handling "missing tag name" error
« Reply #21 on: November 13, 2018, 01:41:48 PM »
I have this event added but that doesn't cover the "path segment invalid" error. The com_error of the driver will trigger in case of a network timeout or a network connection change/termination.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: Handling "missing tag name" error
« Reply #22 on: November 13, 2018, 01:53:05 PM »
I just tried it and it worked for me. The Window Text changed to the error

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Handling "missing tag name" error
« Reply #23 on: November 13, 2018, 02:05:35 PM »
Yes it changes you are right, I already mentioned that this issue has disappeared once I used 3.99y beta...

BUT when this error is displayed, the com_error event of the driver doesn't trigger which is good.. We don't want to stop the whole application thinking there is a communication error.. All I want is to show a global message on top of the screen saying there is one or more tags missing; I like the error display on each control item but that is not necessarily the good way of alerting the user of an error... With a screen of too many controls, the screen will look like an ant colony if all the controls error on a com or path segment error...

This boils down to this, I want to suppress all error display on individual control(Which you guys already implemented) but I want to have access to a separate error events: 1) Com_error 2) Path segment error 3) idk maybe timeout error...

I know that com_error is available and I know that timeout error is already part of com_error but I need something like path_segment_error event...

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: Handling "missing tag name" error
« Reply #24 on: November 13, 2018, 02:11:07 PM »
The path segment error occurs in the same ComError event. If you want to filter the events, you will need to look at the values returned to the event to determine which error is being reported.

        Me.Text = "Error : " & e.ErrorMessage & "," & e.ErrorId & "," & e.PlcAddress

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: Handling "missing tag name" error
« Reply #25 on: November 13, 2018, 02:44:38 PM »
Here is a better code example:
Code: [Select]
       If e.ErrorId = 4 Then
            Me.Text = "Invalid or Missing Tag Error : " & e.ErrorMessage & "," & e.PlcAddress
        End If

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Handling "missing tag name" error
« Reply #26 on: November 13, 2018, 03:25:28 PM »
Okay so I am using e.error_id to turn on a red light and write a string in a text box; when all the tags are added back how do I clear the red light and textbox; is there any other event that can do that?
The way I really hoped to implement it is by adding a new event in CLXdriver as in capture 1 and see it on the event list as in capture 2...

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: Handling "missing tag name" error
« Reply #27 on: November 13, 2018, 03:55:56 PM »
Okay so I am using e.error_id to turn on a red light and write a string in a text box; when all the tags are added back how do I clear the red light and textbox; is there any other event that can do that?
The way I really hoped to implement it is by adding a new event in CLXdriver as in capture 1 and see it on the event list as in capture 2...
You can create a timer of about 3 seconds. If an error occurs reset the timer. If no error occurs the timer will elapse and it can clear the red light.

You seem to be going a long way to accommodate programmers that randomly delete tags. Is this really a problem where you work?

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Handling "missing tag name" error
« Reply #28 on: November 13, 2018, 04:06:35 PM »
LOL I am a huge fan of this project and am working on the code to improve it and perfect it to make it fool proof so that I can demonstrate its stability and finally use it on the field.
Before it becomes authorized to go on the field it will go through many tests when people will deliberately try to make it fail(I think it is a good quality and stability test)... however I don't want it to fail.
It has to be automated properly for any body to use.

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Handling "missing tag name" error
« Reply #29 on: November 13, 2018, 04:09:18 PM »
You can create a timer of about 3 seconds. If an error occurs reset the timer. If no error occurs the timer will elapse and it can clear the red light.

You seem to be going a long way to accommodate programmers that randomly delete tags. Is this really a problem where you work?
[/quote]

What error bit/value/event would I be looking for to check if the fault has cleared on the timer after 3 seconds?
Can you show an example?