|
|
Rank: Newbie Groups: Member
Joined: 6/23/2011 Posts: 2 Location: boston
|
HELLO!
In my excel spread sheet I have in column A PI Tags's, Column B Time Stamp, and I'm trying to write a macro that takes those PI Tag's and Time Stamp and get an Archive Value from it. Going down the columns until there are no more tags.
I tried putting
PIArcVal("bpu108:FIC-1149A/PID1/SP.CV",$C$6, 0,"CAMDVAPP01","auto") Into a loop but that doesn't seem to work.
Any help would be greatly appreciated!
Thanks!
|
|
|
|
|
OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System. We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ or contact OSIsoft vCampus for more details.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
Look at the VBA code for the PIEXAM32.XLS file located in your pihome\excel directory. I don't want to copy and past the code here. Look at the bottom part of the code where it is reading data back from the PI Server. Also try and download the DAP (Data Access Pack) from the OSISoft website, in there they have a very nice PI-SDK help file with examples and very good explanations
|
|
|
Rank: Newbie Groups: Member
Joined: 6/23/2011 Posts: 2 Location: boston
|
ere a way i can just run PiArcValue in a macro?
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
Here is a quick and dirty way of doing it. You can play around with this code in VBA and learn in the process, notice the double quotes.
Private Sub DO_SOMETHING()
Dim myform As String myform = "=" & "PIArcVal(Sheet2!$A$1,Sheet2!$L$1,0,""mbkmis00"",""auto"")" 'A1 is tagnumber and L1 is timestamp
ThisWorkbook.Sheets("Sheet2").Cells(3, 12).Value = myform '3 is row and 12 is column
End Sub
|
|
|
|
Guest
|