3 Replies Latest reply on Apr 26, 2010 3:23 PM by Asle Frantzen

    How can I output a system digital state for a non-digital point?

    yjl

      Hello,

       

      I would like to know how can I output a system digital state for a non-digital point. I would like to output "No Sample" each time the calc is triggered to a point (value_out) which is defined as float32. I am using VB6 with ACE version 1.2.32 

       

      Here is the code I have vritten, the result of the ACE calculation says "Calc Failed". "No Sample" is a valid digital state in the system digital state table.

       

      What s wrong in my calc?

       

      Thanks - Yves Lahaye 

      ' SendNoInput\GLOSS_AVG\Trigger_in        Trigger_in
      ' SendNoInput\GLOSS_AVG\Value_out         Value_out
      '
      Public Sub ActualPerformanceEquations()

          Dim SendNoInput As PIModule
          Dim Time_Delay As Single
          Dim Trigger_time As Long
              Dim Offset As Double
              Set SendNoInput = GetPIModuleFromPath(mstrACEContext)
              Time_Delay = SendNoInput.PIProperties.Item("DeadTimeSec")
              Offset = SendNoInput.PIProperties.Item("Offset")
              LogPIACEMessage mlUserMessage, "Sleeping " & Time_Delay & " Seconds", mstrRegisteredName
              Sleep (Time_Delay * 1000)
              Trigger_time = Trigger_in.ExeTime + Offset
              Set Value_out.Value(Trigger_time) = Value_out.DigState("No Sample")