ACR Electronics SmartReader Plus Uživatelský manuál Strana 151

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 198
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 150
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.
Sub
EQN101( )
Dim
Watts, Volts, Current, PowerFactor
As
Double
Dim
VchanNum
As
Integer
,VchanIndex
As
Integer
Dim
x
As
MsgBoxResult
'*********************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
voltage
'ANSWER2 will hold the voltage value that is entered by the user
VchanNum =Logger.GetChannelNumberByIndex(CurrentChannelIndex) + 1
VchanIndex = Logger.GetChannelIndexByNumber(VchanNum)
If
VchanIndex <> -1
Then
' force to calculate engineering value of channel 'VchanIndex
Volts =Logger.GetChannelReading(VchanIndex)
Else
If
ANSWER1 = 0
Then
ANSWER2 =
CDbl
(InputBox ("Enter the nominal voltage during the logging
session:", "Voltage Input"))
ANSWER1 = 1
End
If
Volts = ANSWER2
End
If
'**************************************************************************************
'*********************determine if power factor is needed
'if the user does not want to use power factor then the equation will default a power
factor of 1
'ANSWER4 will hold the power factor value
If
ANSWER3 = 0
Then
x = MsgBox("Do you want to include the power factor?",vbYesNo,"Power Factor")
If
x = vbYes
Then
ANSWER4 =
CDbl
(InputBox("Enter the nominal power factor for the
logging session:","Power Factor Input"))
Else
ANSWER4 = 1
End
If
ANSWER3 = 1
End
If
PowerFactor = ANSWER4
'**************************************************************************************
'Invoke equation: 0-250 Amps AC, A60FL for logger: 12bit Logger, channel: AC Current
AMPROBE
'You may replace ANSWER0 with your own parameter and assign the statement to a
boolean.
Eqn("517DF8952F7142c0A70EEC21A23E6AA8", ANSWER0)
Current = ANSWER0
Zobrazit stránku 150
1 2 ... 146 147 148 149 150 151 152 153 154 155 156 ... 197 198

Komentáře k této Příručce

Žádné komentáře