AdvancedHMI Software

General Category => Support Questions => Topic started by: abouhaa on November 09, 2018, 09:55:26 AM

Title: Handling "missing tag name" error
Post by: abouhaa on November 09, 2018, 09:55:26 AM
Hi,

What is the best way to handle an error of a missing tag name? Assuming I have 5 analogvaluedisplay components each has a different PLC tag name, what happens if somebody deletes the tag on the controllogix PLC side? Right now the whole form freezes until that tag is added back to the tags on the PLC.

I am looking for a way to deal with this error...

Not sure if there are current solutions within the advancedHMI controls/drivers projects but I tried few things and couldn't get it.

Thanks for the help.
Title: Re: Handling "missing tag name" error
Post by: Archie on November 09, 2018, 10:24:56 AM
I tried this using an AnalogValue display and setting PLCAddressValue to an existing tag. After starting the application, I deleted the tag using RSLogix. Immediately the AnalogValueDisplay changed to "Path Destination Unknown" and the application did not lock up.

Are you using any code in your application, such as a Read method, that could be locking up your application?
Title: Re: Handling "missing tag name" error
Post by: abouhaa on November 09, 2018, 11:08:55 AM
No I had a complicated program with tons of code but just to test this I created a simple one screen project with 5 analogdisplays and then tried deleting the tag and still getting the same thing.
Do I need to add any data subscribers? I have been looking on the forum and see many uses on the data subscriber; I have never used it and don't know if that is what it is made for...
Title: Re: Handling "missing tag name" error
Post by: abouhaa on November 09, 2018, 11:26:15 AM
I attached some screenshots... 3 analogdisplays, and 3 tags "DUMMY_PART_COUNT", "DUMMY_PART_COUNT1", "DUMMY_PART_COUNT2".
When I delete "DUMMY_PART_COUNT2" only one of the analogdisplays should display an error and a message invalid path or tag name or no response from PLC...

However in my case all three of them go into error display mode... see screenshot 1.

Thanks.
Title: Re: Handling "missing tag name" error
Post by: Archie on November 09, 2018, 11:35:41 AM
I just tried the same test, but get a different result.

The No Response error will show in all controls because it means no packet came back from the PLC which is different than a tag that does not exist. Something in your system us causing the communication to get interrupted.

You can run a Wireshark capture and see what is actually happening.
Title: Re: Handling "missing tag name" error
Post by: Archie on November 09, 2018, 11:38:35 AM
Do I need to add any data subscribers? I have been looking on the forum and see many uses on the data subscriber; I have never used it and don't know if that is what it is made for...
The DataSubcriber is essentially a BasicLabel without a visual part. The data is returned back to an event and code is required to process the values returned. It is designed to make using driver subscriptions easier.
Title: Re: Handling "missing tag name" error
Post by: abouhaa on November 09, 2018, 12:04:39 PM
Okay so I just found something... Do not stop your advancedhmi application, delete tag then start application again.

What my issue is deleting the tag while the application is running... So start the advancedHMI with 2 or 3 tags, then while it is running, delete one of the tags...

Let me know please.
Title: Re: Handling "missing tag name" error
Post by: Archie on November 09, 2018, 12:20:36 PM
That is the procedure I used. I did not stop AdvancedHMI. I let it run, changed values of the tags to verify it was showing current values. I then deleted a tag in RSLogix while AdvancedHMI continued to run. As soon as I deleted the tag, AdvancedHMI immediately showed the error Path Destination Unknown only on the AnalogValueDisplay for the tag I deleted.
Title: Re: Handling "missing tag name" error
Post by: abouhaa on November 09, 2018, 01:14:50 PM
I attached a link to a video of what I am doing..
Please take a peek.

https://www.dropbox.com/s/spale4mn90jq0kx/2018-11-09%2013-07-03.mp4?dl=0
Title: Re: Handling "missing tag name" error
Post by: Archie on November 09, 2018, 02:44:30 PM
I wonder if this is related to the firmware and controller. I am doing the exact same thing, but using V28 with a CompactLogix.

Can you do a Wireshark capture and post the file?
Title: Re: Handling "missing tag name" error
Post by: bachphi on November 10, 2018, 08:06:09 AM
What is the best way to handle an error of a missing tag name?
I would create a dummy routine/rung with the all AAHMI tagnames being used, so others cant delete it.

As for comparison, apple to apple, You should try v399y like Archie and I am not clear on whether both used the same BasicLabels or  AnalogValueDisplays.
What version of Studio 5000 being used?
Title: Re: Handling "missing tag name" error
Post by: abouhaa on November 13, 2018, 08:15:19 AM
Archie, wire shark capture is attached...
Title: Re: Handling "missing tag name" error
Post by: abouhaa on November 13, 2018, 08:18:41 AM
bachphi,

I am using Studio 5000 v30.01.
Even if I create a routine with the tags like you suggested, somebody can mistakenly delete the routine and probably the tags later on after noticing these tags are not being used...
Funny things happen all the time.
Title: Re: Handling "missing tag name" error
Post by: abouhaa on November 13, 2018, 09:16:16 AM
What is the best way to migrate my current 3.99x based forms to 3.99y to try resolving this issue?
Title: Re: Handling "missing tag name" error
Post by: Archie on November 13, 2018, 09:25:27 AM
Archie, wire shark capture is attached...
Did you delete one of the variables while running the packet capture? From what I see the 3 variables are still reading successfully at the end of the capture file.
Title: Re: Handling "missing tag name" error
Post by: abouhaa 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.
Title: Re: Handling "missing tag name" error
Post by: Archie 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.
Title: Re: Handling "missing tag name" error
Post by: abouhaa 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.
Title: Re: Handling "missing tag name" error
Post by: Archie 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?
Title: Re: Handling "missing tag name" error
Post by: abouhaa 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..."
Title: Re: Handling "missing tag name" error
Post by: Archie 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
Title: Re: Handling "missing tag name" error
Post by: abouhaa 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.
Title: Re: Handling "missing tag name" error
Post by: Archie on November 13, 2018, 01:53:05 PM
I just tried it and it worked for me. The Window Text changed to the error
Title: Re: Handling "missing tag name" error
Post by: abouhaa 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...
Title: Re: Handling "missing tag name" error
Post by: Archie 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
Title: Re: Handling "missing tag name" error
Post by: Archie 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
Title: Re: Handling "missing tag name" error
Post by: abouhaa 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...
Title: Re: Handling "missing tag name" error
Post by: Archie 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?
Title: Re: Handling "missing tag name" error
Post by: abouhaa 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.
Title: Re: Handling "missing tag name" error
Post by: abouhaa 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?
Title: Re: Handling "missing tag name" error
Post by: abouhaa on November 13, 2018, 04:14:21 PM
nvm the previous post, I think I got you I will try it now...
Title: Re: Handling "missing tag name" error
Post by: Archie on November 13, 2018, 04:14:53 PM
Code: [Select]
   Private Sub EthernetIPforCLXCom1_ComError(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforCLXCom1.ComError
        If e.ErrorId = 4 Then
            Me.Text = "Invalid or Missing Tag Error : " & e.ErrorMessage & "," & e.PlcAddress
            Timer1.Stop()
            Timer1.Start()
        End If
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Me.Text = "No Error"
        Timer1.Stop()
    End Sub

So what software are you comparing this to that can report missing tags then clear the error when they are put back?
Title: Re: Handling "missing tag name" error
Post by: Phrog30 on November 13, 2018, 07:52:19 PM
somebody can mistakenly delete the routine

Seriously? How do you mistakenly delete something like that?  If they are that dumb you should show them the door!
Title: Re: Handling "missing tag name" error
Post by: abouhaa on November 14, 2018, 12:03:45 PM
Lol you are right!
But new people tend to do mistakes all the time and you always going to have someone new on the job...