ph_getvar_t PowerHome formula function
Description
Retrieves the specified system variable as a time.
Syntax
ph_getvar_t ( type, num )
Argument Description
type Integer. The type of system variable you wish to retrieve. Valid values are 1, 2, 3, and 4. A 1 specifies that you wish to retrieve LOCAL variables (the same as system variables LOCAL1 thru LOCAL10), a 2 specifies that you wish to retrieve TEMP variables (the same as system variables TEMP1 thru TEMP10), and a 3 specifies that you wish to retrieve GLOBAL variables (the same as system variables GLOBAL1 thru GLOBAL20). A value of 4 is a special case and represents data that is only available during the execution of Analog I/O formulas (the Calculated to Raw and Raw to Calculated formulas). Use a num value of 2 to return the calc value of the Analog device as a time. This would look like ph_getvar_t(4,2).
num Integer. The number of the specified system variable type you wish to retrieve. To retrieve system variable TEMP7 use ph_getvar_t(2,7).
Return value
Time. The data stored within the specified system variable returned as a time. You should be certain that the system variable contains data that can be properly converted to a time value.
Examples
The following examples demonstrate typical syntax/ usage for this function.
• ph_getvar_t (1,2)   --> get the time value from LOCAL2. The result is returned in a time format, eg --> 16:49:04:25
• ph_getvar_t (2,4)   --> get the time value from TEMP4.