YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Is it possible to query PI values from vbs? Options · View
MacaroniPI
#1 Posted : Friday, February 12, 2010 1:22:24 PM
Rank: Advanced Member
Groups: Member

Joined: 7/16/2008
Posts: 33
Location: UK
Don't suppose anyone has used the PISDK from a VBS file? Is this simple to setup? I have a script that I would like to be able to query the current value of a tag and then take some action and it would be great if this could exist as a vbs file for easy modification from time to time, or is building an exe the only way?
Who ate all the PIs?
Sponsor  
 
RJK Solutions
#2 Posted : Friday, February 12, 2010 1:41:27 PM
Rank: Administration

Groups: Administration

Joined: 6/20/2008
Posts: 409
Location: Cheshire, United Kingdom.
Afternoon...

Yes you can use VBScript, you just need to remember no Intellisense etc
So a little tip is to just use VB6 to check syntax for PISDK calls then remove the type declarations for variables.

I bet you want an example too, here is a basic one:

Code:

Dim mySDK
Set mySDK = CreateObject("PISDK.PISDK")

Dim myServer
Set myServer = mySDK.Servers("localhost")

Dim myPoint
Set myPoint = myServer.PIPoints("sinusoid")

wscript.echo myPoint.Data.Snapshot.Value

Set myPoint = Nothing

Set myServer = Nothing

Set mySDK = Nothing


Same things apply as normal, security, error handling etc but I will leave those parts up to you to sort out BigGrin

Cheers,

Rhys.


OSIsoft PI System Specialists
PI consultancy on PI Systems, PISDK, AFSDK, OLEDB etc and PI custom developments. Well pretty much anything to do with PI!


MacaroniPI
#3 Posted : Friday, February 12, 2010 2:26:10 PM
Rank: Advanced Member
Groups: Member

Joined: 7/16/2008
Posts: 33
Location: UK
As simple as that eh? Excellent, thanks!!! Can see a lot of potential in this.....ThumbsUp
Who ate all the PIs?
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.