Example: Use the block mode
This example creates 1000 tags, include Analog, Digital, and String tags.
Use the block mode to improve the performance.
After the block mode is started, make sure to end it.
Only one block mode is allowed at one time on an HMI server. The error
tagErrorBlockModeAlreadyStart
occurs if the block mode cannot be started. In this case, we recommend that you not execute EndBlockMode
to avoid unexpected results.Sub UseBlockMode() Dim I As Integer On Error GoTo ErrHandler TagDB.StartBlockMode For I = 1 To 100 TagDB.CreateTag "Tag" & I, StringTag Next I For I = 101 To 400 TagDB.CreateTag "Tag" & I, DigitalTag Next I For I = 401 To 1000 TagDB.CreateTag "Tag" & I, AnalogTag Next I MsgBox "Tags have been created." ErrHandler: If Err Then MsgBox Err.Description If (tagErrorBlockModeAlreadyStart = Err.Number) Then 'Do not use EndBlockMode to avoid unexpected results. Exit Sub End If End If TagDB.EndBlockMode End Sub
Provide Feedback