Navigation:  Tutorial >

Build Defined Sensors

Previous pageReturn to chapter overviewNext page

 

Define Derived Sensors

 

Defined sensors are derived from existing sensors using equations and tables.  The new sensor (Defined Name) is used by Events for displaying and storing its data.  The Defined Name should be unique and different from other RX or TX Array names.

 

clip0229

Special functions can be defined in the Define tab.  Examples above show some If_Then_Else, Capture, Sum and Max equations.

 

1.  Add a new row for the defined sensor.

2.  Enter a new Defined Name.

3.  Select the Format down arrow for the number of decimals to show.

4.  Now click on the 3 dot button in Equation/Table column.

 

clip0001_4

 

5.  Click the Build Equation button.

 

clip0001_5

 

Operators include:

 AND,  OR,  XOR,  NOT

 <,  >,  =,  >=,  <=,  <>

 +,  -,  *,  /,  %,  ^

 

Complete Function List Includes:

 MODBUSFAIL   //return 1 if modbus polling failed, 0 if OK

 MODBUSCOM  //returns 1 if open, 0 if closed

 ALERTCOM      //returns 1 if open, 0 if closed

 IIF(X Function,TrueValue, FalseValue)

 XTIME(minute)  //returns a 1 every (0..59) x minutes

 XDAYTIME(minute)  //returns a 1 every (0..1439) x minutes

 FILTER(X,Deadband)

 ONCHG(X,Deadband)  //returns 1 or 0

 READCTRL(FormName,SensorType,TagName)

 OPEN(open:filename, Y operator SetPt)

 READVFLO(readvflo:filename, Y operator SetPt)

 READFILE(readfile:filename, Y operator SetPt)

 SCRIPT(script:filename, Y operator SetPt)

 FTP(ftp:scriptName, Y operator SetPt)

 FTPRECEIVE(ftpreceive:scriptName, Y operator SetPt)

 MAIL(mail:scriptName, Y operator SetPt)

 HTTP(http://www.website.com, Y operator SetPt)

 CAPTURE(NOW,Y operator SetPt)

 POKE(Y operator SetPt,SensorName,newValue)

 WRITE(Y operator SetPt,FileName,Data1,..,DataN)

 RESETSTATROW(start,stop, X operator SetPt)

 STRING(XString, OnString, OffString)

 ALERTREPORT(SensorName)

 % = MOD  X % Y = Integer Remainder

 ABS(X)    COS(X)    EXP(X);

 ROUND(X)    TRUNC(X)

 X + Y,   X % Y,   X * Y,   X / Y,

 X AND Y,   X OR Y,  

 X XOR Y,   X NOT Y

 LN( X )

 COUNT(X operator SetPt )

 MAX(X0, ,X1,  X2, ... XN)

 MIN(X0, X1, X2, ... XN)

 NOW()  = todays datetime as string

 SIN(X)

 SQR(X) , SQRT(X)

 SUM(X0, X1, X2, ... XN)

 TAN(X)

 

This is a sequence of tasks in the define grid to collect flow totals, build a script file and send the XML file via FTP.

clip0381

 

 

The Rcv01Time Name captures the Datetime of the last received from each site.

The equation uses a R-Rcvd01.Coil that goes to 1 for 30 seconds and goes back to 0 when a new value is received from a site.

clip0382

 

 

6.  Enter the equation is the top edit box.  Select sensors and press Use IT button to add a sensor to your equation.

 

clip0001_6

 

7.  Press the Test Calculation button.  If an error happens the result box will show an error.  Edit your formula until there are no errors.

 

8.  Press Save & Close button.

 

9.  Press OK button on the Equation or Table Form.

 

10.  Click the Run button and your equation will be updated.

 

 

See Equation Editor for more information.