VBA Held - "gTagDb" equivalent in FTView

Join Date
Nov 2013
Location
Michigan
Posts
532
I'm converting a project from RSView32 to FactoryTalk View SE, and of course it has a bunch of VB code in it. I'm in the process of copying it over, but have found an error I can't find an answer for online. Here's my code:

Code:
Public Sub display_alan()
Dim calculator_name As String

'set the string variable calculator_name equal to the tag calculator\name'

calculator_name = gTagdb.GetTag("calculator\Name").Value
 
'use the string variable in the following gettag equations to set the temporary storage locations values for the calculator'
On Error Resume Next
'SET CAL DISPLAY MIN VALUE
gTagdb.GetTag("calculator\minvalue") = gTagdb.GetTag(calculator_name).MinimumValue
On Error Resume Next
'SET CAL DISPLAY MAX VALUE
gTagdb.GetTag("calculator\maxvalue") = gTagdb.GetTag(calculator_name).MaximumValue
On Error Resume Next
'SET CALC DISPLAY CURRENT VALUE
gTagdb.GetTag("calculator\valuetag") = gTagdb.GetTag(calculator_name).Value
On Error Resume Next
'SET CALC DISPLAY DATA ENTRY VALUE
gTagdb.GetTag("calculator\valuetag2") = gTagdb.GetTag(calculator_name).Value
On Error Resume Next
gCommand.Execute "display calc2"
On Error Resume Next
End Sub

So when I try to run it, it gives me the following error:

"Compile Error: Variable not defined"

It highlights the "gTagdb" part when I click OK.

I'm assuming this means "gTagdb" is not the correct command for getting tag values into the vb variables in FactoryTalk View SE like it was in RSView32. So my question is, what is the "new" equivalent of "gTagdb?"
 
Look at creating a taggroup.

Doing that now. Having trouble understanding what that is. I mean, basically it's a "group of tags" but is that tied into the folders in the HMI Tag database or is that completely different? Ugh, this product is supposed to be an "upgrade" from RSView32 yet there are so many places where features are removed and procedures are more complicated.
 
Look at the help files. First you create a taggroup. Then you add tags (either HMI or direct) to the taggroup. There are many differences between SE and view32. VBA in View32 runs on the server, in SE it runs on the client. There are many consequences to this.
 

Similar Topics

Hi Guys, Looking for someone well versed in VBA that can either tell me a certain naming convention or point me in the right direction (I'm a...
Replies
0
Views
60
I need to use a TreeView in my FactoryTalk SE project and i found it under "ActiveX Object" > "Microsoft TreeView Control 6.0 (SP4)". Everything...
Replies
0
Views
37
I'm creating an HMI that has a recipe with 288 data point. It has 3 pieces of data for 96 segments. I need help with VBA code to copy all 288...
Replies
0
Views
140
Hi everyone Is it possible to change a button image in FactoryTalk View SE (v13.00) using VBA?
Replies
0
Views
82
Hi all. Currently I'm working on a VBa script for FTView. I would like to understand a bit better about some commands. 1) What are the...
Replies
3
Views
598
Back
Top Bottom