Slow performance of Write to tag from VBA

1 post in this topic

As part of a startup initialisation I want to set some 400 memory tags to a string value.

I use this routine:

Public Sub WriteValue(val As Variant, TagName As String, Fm As Display)
    Dim TG As TagGroup
    Dim WriteTag As Tag
    Set TG = Application.CreateTagGroup(Fm.AreaName)
    TG.Add TagName
    Set WriteTag = TG.Item(TagName)
    WriteTag.Value = val
End Sub

It Works well - but it is slow. Making about 400 writes takes 40 seconds.

I thought maybe the creation of a taggroup before every write was slow (like it's done with the use of this WriteValue routine), so I tried making a taggroup with all 400 tags first, set active=true for this taggroup and then do all the writes.

But it's equally slow.

How do I speed up the writing of such memory text tags?

I have a had similar read-issue - here the many individual reads is slow, but if I create a large taggroup with active=true - then reading is fast.


I use FTview SE 7.0 on Win 7-64

Edited by Jake104

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now