I'm converting an existing ProcessBook display to use element relative displays. The ProcessBook has some VBA code to write a value to a tag.
Set myServer = Servers("servername") Set myStateSet = myServer.StateSets("NotRunningRunning") Set myDigitalState = myStateSet("Running") Set myPiData = myServer.PIPoints("pitagname").Data myPiData.UpdateValue myDigitalState, "*"
Of course after updating the display to use AF, I need the tagname that is pointed to by the AF element that I have chosen. Since I have a value element on the display named valFuelFlow, I was hoping that the GetTagName method would provide me with the PI tag that was feeding the value display simliar to this...
dim TagName as string TagName = valFuelFlow.GetTagName(1) Set myPiData = myServer.PIPoints("pitagname").Data
The problem is that GetTagName returns the AF attibute name and not the tag name that the attribute is pointing to. I can't figure out an easy way to write to the value.
I know that AF 2.0 does not have a COM interface so I would need to write a ProcessBook add-in. I was thinking that I could maybe get the tagname using the module database instead if I moved the elements so that they would be sync'ed with the MD. Anyone have any ideas. I feel like this is harder than it should be so I suspect I may just be missing something in the heat of battle.