AnsweredAssumed Answered

Read value from an AFCurrVal TAG using PI AF

Question asked by alexbecher on Aug 27, 2019


I am trying to read the value of a TAG in PI AF using a VBA script, but I can't.


Follows the example I use and it doesn't work.


//start code

Dim sever As PISDK.Server
Set server = Servers ("MY SERVER")

Dim Datalink As Object
Dim Element As Variant

Set Datalink = New AFLibrary

'Here I want to read the current value of a TAG
Element = Datalink.AFCurrVal ("SINUSOID", "", AF2. \\ MY SERVER \ DATABASE \ ELEMENT ")

MsgBox "Value ->" & Element



If anyone can help me I just need to read a value from a PI AF element using a VBA script.

Thank you.