Cordex®CXCHPControllerSoftwareManual|22-Usingcustomviews,data,timers,counters,scheduler,andcustomactions
Astatevariablecomparesthelivevalueofastatefieldtouptofourofitspossiblevalues.Thepossible
valuesarecalled“TrueIf”valuessincethestatevariablewillevaluatetoTrueifthestatefieldmatches
anyofthepossiblevalues.
Notice: State variables will always evaluate to True or False. A state variable should always be
used with a value that represents a state. Numeric values should not be used when creating a
state variable.
Tipsonusingvariables:
•
Thekeywords“True”and“False”canalsobeusedinanequation.Theyaretreatedasbuilt-in
variablesthatrepresentthevalueofoneandzero.
•
VariablesarecreatedwithinthecontextofasingleuniqueinstanceofCustom Data.Avariable
createdforuseinaspecificCustom Data equationcannotbereusedinanotherequation.
•
Variablenamesmustadheretoaspecificformat.Thenamemuststartwithaletter,followed
byletters,digitsorunderscores.Somevalidnamesare“T1”,“T_1”,“Vbat”,“BatteryCurrent”,
“Load_2_Current”.
•
Shortbutmeaningfulnamesofferthebestreadabilitywhenusedinanequation.
OnceaCustom Data hasbeencreateditcanbeusedthroughoutthecontrollerandsystemsasinputto
variousconfigurations.
Forexample,inaUser Alarm allCustom Data equationsaredisplayedintheselectionlistoftheSource
field.YoucanusethisCustom Data toalarmandcontrolrelaysbasedonanycustomparameters
required.
Anotherexampleisconfigurationforaload.TheLoad Current Source fielddisplaysallCustom Data so
youcansummultiplecurrentstorepresenttheloadcurrent.
Generally,anySource fieldthatallowsyouselectinputswillalsoprovideallCustom Data asanoption.
Functions
Therearethreesupportedfunctions:abs(),sqrt(),power().Theabs()andsqrt()acceptasingleinput
parameter,andthepower()acceptstwoparameters.Forthepower()function,thefirstparameteristhe
baseandthesecondparameteristheexponent.Forexample,power(2,3)wouldevaluateto8.
22.2.1.1. Showing the result as text
Customdataequationsnormallyrepresentanumericalorboolean(true/false)value.Attimesthough,it
maybeconvenienttodisplaythosevaluesonthedashboardastext;thiscanbeespeciallyusefulifthe
customdatarepresentsasystemstate.Forexample,anairconditionermaybeOff,Cooling,orError.
TheResult as Text entryintheConfiguration tableusestheentriesintheText Mapping tabletomap
theresultasnumericortheresultasbooleantomeaningfultext.
Page 240 0350058-J0 Rev AL