Probe for Windows can use variables, formulas, operators, functions and constants in various places...
Use:
Global formulas and functions calculate results and variables that can be used anywhere else in Prwin  the values are global and available to all sites. For example...
Global Formula  Comment 

SHIRAZFAC = 0.25 
SHIRAZFAC can now be used in limit formulas 
BUDBURST = #12 December 2001# 
BUDBURST can be used to plot lines on graph reports 
Use:
Keydata tabFormulas must start with a +, ,, = or @
.
and can be optionally followed by a colon (:
)
and the number of decimal places or a format code.
V3 Note: Individual entry of Formula, Name and Format
Examples...
Formula  Output  Comment 

+COTTON.DWU:DWU 
3.2  Value from dwu file for each date in the readings screen, displayed in user selected dwu units. Can also be graphed 
@CUM(EDWU):0 
134  Accumulated daily water use over the season, giving total water through the plant, to 0 decimal places. 
@LKV(CLAY.RTN,RZ1/70):2 
56.32  Calculate the equivalent soil moisture tension from lookup
file CLAY.RTN , display to 2 decimal places.
but see functions 
Use:
Current State tabThe upper and lower limit for irrigation scheduling is calculated from a formula.
The default formulas are UPPER: FULL
, and
LOWER: REFILL
Examples...
Formula  Value  Comment  

LOWER 
REFILL20 
190  Set lower limit to 20 mm below refill 
UPPER 
FULL(FULLREFILL)*0.5 
234  Set upper limit to 50% to refill 
LOWER 
PWP+(FULLPWP)*SHIRAZFAC 
175  Set lower limit to be between permanent wilting and full. Actual position
set with global variable SHIRAZFAC 
LOWER 
REFILL(FULLREFILL)*SHIRAZ.FAC 
Similar to above, but position factor read from season
file SHIRAZ.FAC . 
The upper and lower limits can be graphed.
Use:
Historical DWU tabThere is a single global formula to calculate the current daily water use from historical data; and in addition each site can optionally have it's own formula. If the site formula is blank the global formula takes precedence.
The value of the site historical dwu is used...
GPIAMT
and GPIDATE
)Examples...
Formula  Output  Comment 

4.3 
4.3 mm/day  Always 4.3 mm/day 
COTTON.DWU 
2.3 mm/day  Current value from this dwu file 
COTTON.DWU * 1.2 
2.8 mm/day  Increase value by 20% 
Use:
Each line in the report definition file will print some data from a source (or calculated from a formula) at a nominated position on the paper  see page 59 for a full description.
Examples of formulas
Formula  Output  Comment 

EDWU 
2.3 mm/day  Estimated daily water use 
EPIAMT 
132  Amount in mm that needs to be applied at the scheduled irrigation 
EPIAMT*AREA*FACTOR2 
2.3 mm/day  Amount required in Kl, multiplied by site factor as set on ReadingsMenu/Scheduling delivery tab 
DELIVIRRI*AREA*10 
2,345 Kl  Total amount delivered in kl 
WATERTIME/WATERVOL 
2,345 Kl/day  Delivery rate 
24*DELIVIRRI*WATERTIME*AREA*10/WATERVOL 
145 hrs  Total amount delivered in hours 
The output can be scaled depending on the units selected by the user with
.Report output can be restricted with a where clause  for example...
Where Clause  Comment 

EPIDATE < (TODAY+3) 
Only output scheduled irrigation's due in the next 3 days 
CRNTAMT< (REFILL+20) 
Only output sites that are within 20 mm of the refill point 
Use:
report definition tab to edit the GPT fileLine in the graph report definition file can print data from a source (or calculated from a formula) at a nominated position on the paper, or plot boxes, lines and arrows  see page 23 for a full description.
Formulas for data are similar to export.
Some examples of formulas to plot lines and arrows
X1  X2  Y1  Y2  Type  Comment 

80 
20 
95 
40 
BOX 
Plot box from 80,20 to 95,40 
80 
20 
CRNTDATE 
CRNTAMT 
LINE 
Plot line from 80,20 on paper to last probe readings 
PREVDATE 
PREVAMT 
PREVDATE 
PREVAMT+10 
ARROW 
vertical arrow pointing at last probe reading 
BUDBURST 
BUDBURST 
TYMIN 
TYMAX 
LINE 
Line at BUDBURST date (as set on global formulas), the full height of the time graph 
The scales for a graph can be entered as a fixed number (e.g. 20
or 1/1/2001
), or as a formula.
Scales can be entered...
Reset scales are only used when the user clicks the <reset>
button on the graph screen.
Scales set in a graph report definition overide the value entered by the user on the screen
Some examples
Formula  Result  Comment 

FULL+20 
235  Sets the vertical scale to be full point + 20 
CRNTDATE+10 
1/2/2001  Set the date axis to be last date in the readings screen plus 10 days. If
this is the reset formula the time graph will 'stretch' each time <reset> is used. 
PDATE10 
20/9/2000  Set the date axis to be 10 days before planting date (as set for each site on SitesMenu/Edit). 
The following variables can be used in formulas and function for export, import and graph report definitions.
Variable  Comment  Units 

TODAY 
Today's date  date 
NOW 
Today, now (includes time)  date 
NULL 
Empty (used in @IF() ) 

LXA 
Constant to calculate Volume Volume = Area * Depth *LXA ( = 10) 

SITE 
Site number  
NAME 
Name of site  
SELECTED 
Site is 'selected'  
YEAR 
Season number  
FARM 
Farm number  
CROP 
Name of crop  
CropNum 
ID number of crop (v3)  
MethodID 
Irrigation method. 0=cyclic,1=spare,2=drip/continuous (v3)  
AREA 
Area  Ha 
POSITION 
Position of tube (0100)  
WATERTIME 
Total water delivery time (days and fraction)  days 
WATERVOL 
Total delivered volume Note: DeliverRate=WATERVOL/(WATERTIME *24)(Kl/Hr) 
Kl 
LIRRDATE 
Date of last irrigation  date 
LIRRAMT 
RZ1 amount after last irrigation  mm 
REFILL 
Refill point  mm 
FULL 
Full point  mm 
LPRBDATE 
Date of last probe reading  date 
LPRBAMT 
RZ1 at last probe reading  mm 
PROBEDWU 
Latest probe dwu  mm/day 
PPIDATE 
Predicted date based on pdwu  date 
PPIAMT 
Amount to be delivered  mm 
ESTDWU 
Latest estimated dwu  mm/day 
EPIDATE 
Predicted date based on edwu  date 
EPIAMT 
Amount to be delivered  mm 
SITEGDWU 
Formula for site historical dwu  text 
GPIDATE 
Predicted date based on sitegdwu  date 
GPIAMT 
Amount to be delivered  mm 
CRNTAMT 
Rz1 value in latest column  mm 
CRNTDATE 
Date in latest column  date 
PDATE 
Planting date  date 
PWP 
Permanent wilting point  mm 
PREVAMT 
RZ1 at previous probe readings  mm 
PREVDATE 
Date of previous probe reading  date 
DELIVIRRI 
Total delivered irrigations  mm 
EFFIRRI 
Total effective irrigations  mm 
DELIVRAIN 
Total delivered rain  mm 
EFFRAIN 
Total effective rains  mm 
NUMIRRI 
Number of irrigations  
NUMRAIN 
Number of rains  
UPPER 
Formula for upper limit  text 
LOWER 
Formula for lower limit  text 
UPPERAMT 
Value of UPPER formula at CRNTDATE  mm 
LOWERAMT 
Value of LOWER formula at CRNTDATE  mm 
SUPPERAMT 
Value of UPPER formula at next scheduled irrigation date  mm 
SLOWERRAMT 
Value of LOWER formula at next scheduled irrigation date  mm 
FACTOR2 
Delivery factor  numeric 
COMMENT 
Comment for grower about site  text 
XCOORD 
GPS coordinate (not used)  
YCOORD 
GPS coordinate (not used)  
RZTEXT1 
Root zone 1 definition eg 070cm  text 
RZTEXT2 
Root zone 2 definition eg 2570cm  text 
RZTEXT3 
Root zone 3 definition eg 90130cm  text 
RZAMT2 
Latest root zone 2 amount  mm 
RZAMT3 
Latest root zone 3 amount  mm 
RZ1START 
Value of RZ1 at first reading of season (v3, v1 1.0.232>)  mm 
RZ1Top 
Value of top of Root Zone (eg: 20 for 070cm) (v3)  cm 
RZ1Bottom 
Value of bottom of Root Zone 1 (eg: 70 for 070cm) (v3)  cm 
LIRRDAMT 
Last irrigation delivered amount.  mm 
LIRREAMT 
Last irrigation effective amount.  mm 
LIRRDRAIN 
Total delivered rain since last irrigation.  mm 
LIRRERAIN 
Total effective rain since last irrigation.  mm 
ROWSPACE 
Row spacing  cm 
EMITSPACE 
Emitter spacing  cm 
EMITRATE 
Emitter rate  litre/hour 
DRIPDAYS 
Number of days over which drip volumes calculated Amount = DRIPDAYS * DWU 
days 
RDIFACTOR 
Formula that evaluates to RDIfactor value. ActualAmount = DRIPDAYS * DWU * RDIFACTOR 
text 
PLANTSPACE 
Spacing between plants  cm 
WETWIDTH 
Width of wetted zone. If value=0 assume wetted over entire area  cm 
New for ver 3...  
DATE1 
Critical date 1 (e.g. 'Bud burst') date entered on: SitesMenu/Edit text (eg Bud burst) on: ProbeMenu/Crops  date 
DATE2 
Critical date 2  date 
DATE3 
Critical date 3  date 
DATE4 
Critical date 4  date 
DATE5 
Critical date 5  date 
DATE6 
Critical date 6  date 
KSOILFILE 
name of file with dwu correction factors depending water content realative to refill/full  
SCHEDULEDWU 
Value of DWU used to calculate 'scheduled' irrigation  mm/day 
SCHEDULEAMT 
Amount required using schedule DWU  mm 
SCHEDULEDATE 
Date of irrigation using schedule DWU  date 
KEY1 
Value of keydata row1 in last column
also KEY2, KEY3,...KEY16 
numeric 
SITEREPORT 
Name of site specific report (v3)  
SEASONEND 
Value of RZ1 at first reading of season (v3)  
ALLOCATIONVOL 
Total volume needed for entire season  kL 
SUPPERAMT 
Upper (full) RZ1 amount used for scheduling (v3)  mm 
SLOWERAMT 
Lower (refill) RZ1 amount used for scheduling (v3)  mm 
GPT reports only  see ProbeMenu/Global Formulas (v3)  
R1FULL , R1REFILL , R1PWP 
Value of FULL VSW at depth 1, REFILL VSW, PWP VSW  VSW% 
R2FULL , R2REFILL , R2PWP 
Value of FULL VSW at depth 2, REFILL VSW, PWP VSW  VSW% 
... 
depth 1 to depth 16  
RZ1FULL , RZ1REFILL , RZ1PWP 
Full total in root zone 1, Refill total in root zone 1, PWP total in root zone 1  mm 
RZ2FULL , RZ2REFILL , RZ2PWP 
Full total in root zone 2, Refill total in root zone 2, PWP total in root zone 2  mm 
RZ3FULL , RZ3REFILL , RZ3PWP 
Full total in root zone 3, Refill total in root zone 3, PWP total in root zone 3  mm 
PDWUFULL , PDWUREFILL , PDWUPWP 
PDWU aalue in full column, PDWU value in refill, PDWU value in PWP column  mm/day 
EDWUFULL , EDWUREFILL , EDWUPWP 
EDWU aalue in full column, EDWU value in refill, EDWU value in PWP column  mm/day 
KEY1FULL , KEY1REFILL , KEY1PWP 
Value of max value of keydata row 1  
KEY2FULL , KEY2REFILL , KEY2PWP 
Value of max value of keydata row 2  
... 
Keydata row 1  row 16  
All below entered on FarmsMenu/Edit  
FARMNAME 

FARMOWNER 

ADDRESS1 

ADDRESS2 

TOWN 

POSTCODE 

COUNTRY 

TEL 

TEL2 

FAX 

MOBILE 

EMAIL 

All below entered on FileMenu/Register  
OWNER1 
normally Company name  
OWNER2 
normally Address  
... (110) 
Notes:
DWU, AMT, VOL, AREA, DEPTH, VSW,
EMITRATE
will be automatically converted to the 'user units' as set on
(T
= time graph; use D
for depth graph)
Variable  Value returned 

TXMIN 
Minimum value on horizontal axis 
TXMAX 
Maximum value on horizontal axis 
TYMIN 
Minimum value on vertical axis 
TYMAX 
Maximum value on vertical axis 
TLEFT 
Left edge of graph (% paper) 
TRIGHT 
Right edge of graph (% paper) 
TTOP 
Top edge of graph (% paper) 
TBOTTOM 
Bottom of graph (% paper) 
TXLEG 
Horizontal position of legend (% paper) 
TYLEG 
Vertical position of legend (% paper) 
Variable  Value returned 

SORT 
Sort order 
WHERE 
Where criteria 
FILE 
Name of file used for export 
PAGE 
Current page number 
Cn 
Value of column n in report 
JOIN 
Name of lookup file 
Ln 
Value from column n in lookup file 
LName 
Value for named field LName in lookup file 
UDWU 
Text of dwu units e.g. ins/day 
FDWU 
Factor to convert to user units of dwu e.g. UserValue = EDWU/FDWU returns in ins/day 
UVOL 
Text of dwu units e.g. AcreFt 
FVOL 
Factor to convert to user units of volume e.g. UserValue = AREA*EPIAMT/FAREA returns in AcreFt 
UAMT 
Text of amount units e.g. ins 
FAMT 
Factor to convert to user units of amounts of water e.g. UserValue = EPIAMT/FAMT returns in ins 
UAREA 
Text of dwu units e.g. mm/day 
FAREA 
Factor to convert to user units of area e.g. UserValue = AREA/FAREA returns in acres 
UDEPTH 
Text of depth units e.g. ft 
FDEPTH 
Factor to convert to user units of area e.g. UserValue = AREA/FDEPTH returns in ft 
UVSW 
Text of volumetric soil water units e.g. ins/ft 
FVSW 
Factor to convert to user units of VSW e.g. UserValue = R1/FVSW returns in ins/ft 
UEMITRATE 
Text of emitter rate units e.g. gal/hour 
FEMITRATE 
Factor to convert to user units of emitter rate e.g. UserValue = EMITRATE/FEMITRATE returns in gal/hour 
Variable  Value returned 

Cn 
Value from column n in import file 
LASTDATE 
Last date in current readings 
LOADSITE 
Used to load and post to a site 
Entered on
Variable  Value returned 

DATE 
date of column 
TYPE 
Type of column 
Rn 
VSW row n. Eg R1 = row 1 
SN 
Serial number 
RZn 
Root zone n Eg RZ1 = root zone 1 
PDWU 
Probe daily water use 
EDWU 
Estimated daily water use 
Deficit 
Full  current RZ1 value 
Kn 
Keydata row n Eg K1 = keydata row 1 
The following functions are available.
Function  Comments  Used...  Example 

@DATESERIAL(Y,M,D) 
Y=Year M=Month D=Day 
Export, Import  @DATE(\C2,\C3,\C4) 
@TIMESERIAL(H,M,S) 
H=Hour M=Minute S=Second 
Export, Import  @TIME(\C5,\C6) 
@DOY(Date) 
Day of year since Jan 1  Export, Readings  @DOY(PPIDATE) 
@LKV(File) 
Looks up corresponding value in file  Export, Import, Readings  @LKV(CLAY.RTN, RZ1/70) v1 
@LKV(Value,File,Style,ColIn,ColOut,Headers)
ColIN (Optional, default=1) column in table for value ColOUT(optional, default=2) column in file for result Number of header lines (Optional, default=0) 
Looks up corresponding value in file
Style: 0 = Interpolate between two values 1 = use Value just less than passed value 2 = use Value just greater than passed value 
Export, Import, Readings  @LKV(Date, blenheim.et,0, 1, 2, 1) v3
0=interpolate;1=Value column;2=result column;1=1 heading row 
@IF(Test,Value1,Value2) 
If 'test' is true return 'value1', else return 'value2'  Export, Import, Readings  @IF(TYPE=21,RZ1,NULL) 
@MAX(Value1, Value2) 
Maximum of Value1 or Value2  any  @Max(RZ1, FULL) v3 
@MIN(Value1, Value2) 
Maximum of Value1 or Value2  any  v3 
@RATE(Item) 
Rate of change of ‘item’ eg fruit size growth rate  Readings  @RATE(SIZE) 
@DIFF(Item) 
Difference between values e.g. water used between readings from water meter readings 
Readings  @DIFF(WaterMeter) 
@ADD(Item) 
Addition of succesive values e.g. ?? 
Readings  @ADD(K3) 
@ACC(Item) 
Running total e.g. running total of rain during season 
Readings  @ACC(DeliveredRain) 
@CUM(item) 
Accumulate dwu  total water used by crop  Readings  @CUM(EDWU) 
@SM(item,factor) 
Smooth item using factor  Readings  @SM(SIZE,0.1) 
@PI() 
3.14159...  any  
@PI() 
3.14159...  any  @PI() * 200 * 200 v3 
@ABS(Value) 
Result is always positive  any  @ABS(PDWU) v3 
@INT(Value) 
Whole number, truncated  any  @INT(RZ1) v3 
@FIX(Value) 
Same as INT(), unless Value is negative (phone..)  any  v3 
@SGN(Value) 
+1 if > zero; 0 if = zero ;1 if < zero  any  v3 
@SQR(Value) 
Square root of Value  any  v3 
@LOG(Value) 
Log(Value) to base e: Log10 = Log(Value)/Log(10)  any  v3 
@EXP(Value) 
e ^ Value (e=2.718)  any  v3 
@SIN(Value) 
Value in radians  any  v3 
@COS(Value) 
Value in radians  any  v3 
@TAN(Value) 
Value in radians  any  v3 
@ATAN(Value) 
Value in radians  any  v3 
Notes:
LKV()
looks up data in a lookup text
file. For example... @LKV(CLAY.RTN,RZ1/70)
RZ1/70
calculates the average VSW in
root zone 1 (assuming it is set to be from 070 cm), so this formula will calculate the
equivalent soil suction using values file CLAY.RTN
.
This could also be used to calculate sap pressure from soil moisture.
Constants such as COTTON.DWU * 1.2
can be used.
Date constants must be enclosed in # #
. For
example, a criteria for a report to only output irrigations scheduled before 1 June...
EPIDATE < #1 June 2000#
+  Add 
  Subtract 
*  Multiply 
/  Divide 
AND  logical AND 
OR  logical OR 
XOR  phone 
UPPERAMT, LOWERAMT are calculated from UPPER and LOWER formulas
'RDICorrection' is calculated from RDIFACTOR
EffectiveAmountRequired(mm) = UPPERAMT  LOWERAMT or DWU * DRIPDAYS * RDICorrection
Calculated amount left in variables EPIAMT, PPIAMT, GPIAMT.
So 'DeliverAmountRequired(mm)' = FACTOR2 * EPIAMT
V2 Note: SCHEDULEAMT uses 'schedule with', and is either... (EPIAMT or PPIAMT or GPIAMT) * FACTOR2)
So 'ScheduleAmountRequired(mm)' = SCHEDULEAMT (FACTOR2 is already included)
If these intermediate values are calculated...
WetArea = AREA * ( WETWIDTH / PLANTSPACE )
PumpRate = WATERVOL * WATERTIME
The formulas in GPT, RPT or SPT files...
Caption  Formula  Format code 

DeliveredAmount(Vol) using EDWU  FACTOR2 * EPIAMT * WetArea * 10  VOL 
DeliveredAmount(Hours) using EDWU  FACTOR2 * EPIAMT * WetArea * 10 / PumpRate  LONGTIME 
DeliveredAmount(Vol) using 'Schedule with'  SCHEDULEAMT * WetArea * 10  VOL 
DeliveredAmount(Hours) using 'Schedule with'  SCHEDULEAMT * WetArea * 10 / PumpRate  LONGTIME 