Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

Get timed value into vba

$
0
0

Hello All,

 

I just started to use vba an pisdk together.

 

I would like to get timed data from a pipoint into a vba variable.

 

Here is a quick code

 

Option Explicit
Dim srv As Server
Dim pt As PIPoint

Sub main()
Dim point As String
Dim a As Variant
Dim t As New PITimeFormat
Dim j(0) As Date
point = "364-FY-0288-UPV"

Set srv = Servers("xxx")

Set pt = srv.PIPoints(point)

t.InputString = Format(CDbl("4/24/2014 11:29:00 PM"), "dd-mmm-yyyy hh:mm:ss")

a = pt.Data.TimedValues(t)

End Sub

 

(I replaced server name by xxx) It does not work and a window pop up saying "Wrong number of argument or invalid property assigned".

 

Somebody could help me please?

 

Thank you.

 

 


Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>