ISV Script Example

VBScript example

Set isv = CreateObject("Proficy.ISVObjectForScripts.1")

timestamp = "2009/01/01 12:00:00"

isv.setobject("c:\Example.isv")

' SetInputValue(FieldIndex, value, quality, timestamp)

' Timestamp = must be prior to now

' Quality = 192 for Good quality, 0 for Bad quality (Other values are not documented – see the OPC standard)

' Value = Integer, Double or String depending on the field type

isv.SetInputValue 0, 5.0, 192, timestamp

isv.SetInputValue 1, -10.0, 192, timestamp

isv.SetInputValue 2, 100, 192, timestamp

isv.SetInputValue 3, "Temperature", 192, timestamp

isv.Execute(timestamp)

i = 0

count = isv.GetOutputCount

while i < count

          outname = isv.GetOutputName(i)

          outv = isv.GetOutputValue(i)

          outq = isv.GetOutputQuality(i)

          outts = isv.GetOutputTimestamp(i)

 

wscript.echo outname

wscript.echo outv

wscript.echo outq

wscript.echo outts

          i = i + 1

wend

set isv = nothing

  

CSense 2023- Last updated: June 24,2025