Accessing all tags of a Driver.

Question:

How can I access all tags of a Driver if it has several subfolders?

Solution:

To do so, you must write a script using recursion.

Example (script executed at a button’s Click event):

Sub CommandButton1_Click()
    set Driver = Application.GetObject(“DriverModbus”)
    FuncRecursion(Driver)
End Sub
Sub FuncRecursion(folder)
    for each obj in folder
        if typename(obj) = “IOFolder” then
           FuncRecursion(obj)
        else
            msgbox obj.Name
        end if
    next
End Sub

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *