FactoryTalktotheHand
Member
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:
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?"
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?"