
Equations
140
2005 ACR Systems Inc.
7.8.5.5
Persistent Variables
The variables ANSWER1 to ANSWER9 are channel level variables you can use that are
persistent during the whole life cycle of the logger.
7.8.5.6
Working with Multiple Channels
The following example shows how to calculate power consumption, in watts, based on the
values of input channels. The present channel is used as the current, in amps, and the next
channel is the voltage, in volts.
Watts, Volts, Current, PowerFactor
'*********************Determine the voltage to use for the logging session
'equation assumes that the current channel plus 1 is the voltage source.
'If the current channel plus 1 is not found the equation will prompt the user to input the
'ANSWER2 will hold the voltage value that is entered by the user
VchanNum =Logger.GetChannelNumberByIndex(CurrentChannelIndex) + 1
VchanIndex = Logger.GetChannelIndexByNumber(VchanNum)
' force to calculate engineering value of channel 'VchanIndex
Volts =Logger.GetChannelReading(VchanIndex)
(InputBox ("Enter the nominal voltage during the logging
session:", "Voltage Input"))
'**************************************************************************************
'*********************determine if power factor is needed
'if the user does not want to use power factor then the equation will default a power
'ANSWER4 will hold the power factor value
x = MsgBox("Do you want to include the power factor?",vbYesNo,"Power Factor")
(InputBox("Enter the nominal power factor for the
logging session:","Power Factor Input"))
'**************************************************************************************
'Invoke equation: 0-250 Amps AC, A60FL for logger: 12bit Logger, channel: AC Current
'You may replace ANSWER0 with your own parameter and assign the statement to a
Eqn("517DF8952F7142c0A70EEC21A23E6AA8", ANSWER0)
Komentáře k této Příručce