Dual inputs
- Last UpdatedApr 24, 2025
- 1 minute read
Given two sets of inputs, you can determine which input is fresh and only use that value in the calculation.
It is also recommended that you selectively update the fresh flag based on the fresh values of the inputs. This code defines two variables, Primary and Secondary, to represent the inputs that can be selected. The fresh flag is used to determine which value is the active one. In this example, the argument array is used rather than the input shortcut variables like input1 and input2:
Dim Primary As ACEParameter = args(1)
Dim Secondary As ACEParameter = args(2)
If (Primary.IsFresh) Then
output - Primary.CurrentValue
IsOutputFresh = True
DNALog.WriteLog(DNALog.LogLevel.Always, "Using Primary")
Else If (Secondary.IsFresh) Then
output = Secondary.CurrentValue
IsOutputFresh = True
DNALog.WriteLog(DNALog.LogLevel.Always, "Using Secondary")
Else
IsOutputFresh = False
DNALog.WriteLog(DNALog.LogLevel.Always,
"All Lines are down for point " + args(0).KeyName + ".")
End If