AnsweredAssumed Answered

Error con  IPICalculation en Visual Script

Question asked by HugoDelgado on Jun 1, 2018
Latest reply on Jun 6, 2018 by Eugene Lee

Estimados

Tengo el siguiente código escrito en proccessbock funcionando y al transformar esto a Visual Script no me reconoce la función IPICalculation

 

Dim myPISDK As Object
Dim srv As Object
Dim pt As Object
Dim pd As Object
Dim ptd2 As Object
Dim dtI As Object
Dim dtF As Object
Dim nval As Object
Dim IPICalc As IPICalculation
Dim pv As Object
Dim pn As Object
Dim retorno As Variant
expr = "timeNE('PCQ.HORNO_DESCARGA', prevevent('PCQ.HORNO_DESCARGA', '*'),'*',prevval('PCQ.HORNO_DESCARGA',prevevent('PCQ.HORNO_DESCARGA', '*')))/60"

Set myPISDK = CreateObject("PISDK.PISDK")
Set pv = CreateObject("PISDK.PIValues")

Set srv = myPISDK.Servers.Item("piserver")
Set IPICalc = srv

Set pn = IPICalc.TimedCalculate("*", expr)
Set pv = pn

va = pn.Item(1).Value
ThisDisplay.ValorEXP.Contents = Format(va, "0")

Codigo transformado a Visual Script no me reconoce la funcion IPICalculation, he buscado solucion en la red pero encuentro nada al respecto.

    Dim myPISDK 
    Dim srv 
    Dim pt 
    Dim pd 
    Dim ptd2 
    Dim nval 
    Dim IPICalc 
    Dim pv 
    Dim pn 

    expr = "timeNE('PCQ.HORNO_DESCARGA', prevevent('PCQ.HORNO_DESCARGA', '*'),'*',prevval('PCQ.HORNO_DESCARGA',prevevent('PCQ.HORNO_DESCARGA', '*')))/60"

    Set myPISDK = CreateObject("PISDK.PISDK")
    Set pv = CreateObject("PISDK.PIValues")
    Set IPICalc = CreateObject("PISDK.IPICalculation")


    Set srv = myPISDK.Servers("piserver")
    Set IPICalc = srv


    Set pn = IPICalc.TimedCalculate("*", expr)      

    va = pn.Item(1).Value

    msgbox Format(va2, "0")

 

     Alguien conoce alguna solución a lo planteado en correo anterior.

Outcomes