FTView SE: Catch ‘item is unresolved in processor’ with VBA code.

Join Date
Jan 2016
Location
Kortrijk
Posts
3
I have VBA code on a FactorTalk View SE v11 project that reads various PLC tags in a FOR loop. All is good if the PLC tag exist.
But for a non-existing PLC tag, the “Tag Read” times-out. Via the “Tag Quality” the error is catched and moved on the next tag in the array.
The time-out time is long, ~20s, and therefore I want to stop reading this tag and directly go to the next tag in the array.
The “Tag Quality” updates only after the time-out, so does the Tag Property “LastErrorNumber”, “LastErrorString”. The “Err.Number” stays 0.
Yet in the FactoryTalk Diagnostic, the message “Item .. is unresolved in the processor …” is logged immediately.
How can I catch in VBA code this error and directly go to the next tag in the FOR loop ?
Thanks in advance.

VBA CODE

Code:
Private PLCTag() As Tag

For i = 1 To lngNumberOfParameters

   On Error Resume Next
    
    PLCTag(i).GetTagData Value, TimeStamp, Quality, SubStatus, Limit, True
    Select Case Quality
        Case 0:
            GoTo Skip
        Case Else
	…
        End Select
Skip:

Next i

VBA Error.png FT Diagnostic.png
 
Thanks for the answer, but "On Error GoTo" works after the time-out.
Stopping the code by exiting the "subroutine" (exit sub), by a stop button is also only working after the time-out. Adding DoEvents statements isn't working either.
 
I know it's a late reply, but I ran into this same issue. After some (a lot) of tinkering, I think I found a solution (more of a workaround) using GetPropertyValue:

Code:
    Private PLCTag() As Tag

    For i = 1 To lngNumberOfParameters

        If IsEmpty(PLCTag(i).GetPropertyValue(tagPropIdItemValue) then
            ' Tag is bad
            GoTo Skip
        Else
            ' Tag is good
            PLCTag(i).GetTagData Value, TimeStamp, Quality, SubStatus, Limit, True
        End If
        
    Skip:

    Next i

The tagPropIdItemValue constant for GetPropertyValue was the only one that I could find give me a different value for a good tag vs. a bad tag without having to wait for a timeout.
 

Similar Topics

I am creating a global object in FTView SE 13. I want to have a string read from the PLC and display (in this case the tagname). So lets say...
Replies
4
Views
171
I want to set user security level based on the value of a tag in my PLC called "ActiveUser". That tag will contain the A-P code which we use for...
Replies
6
Views
218
Hi All, we've recently upgraded from FTView SE v10 to v12. Since the upgrade we've been having a problem where the HMI is slow to update tags in...
Replies
0
Views
90
Hi, I have an issue accessing tags in 3 of my plcs'. When I go to select a tag there is no folder drop down as can be seen in the photo. Any...
Replies
0
Views
90
Hello, I have converted RSView 32 to FTView SE 14 (I have tested FTView 12 before as well and there were some difficulties so I moved on to...
Replies
4
Views
255
Back
Top Bottom