beautypg.com

Contemporary Control Systems BASview User Manual

Page 69

background image

TD110500-0MC

69

Read a global variable. See "Global Variables" above for more information. Returns zero if a variable
called "name" has not been previously set.

setGlobal("name", value)
Set a global variable. See "Global Variables" above for more information.

removeGlobal("name")
Remove a global variable from the list. See "Global Variables" above for more information.

disable()
Disable this program. It will never execute again until it is manually enabled in the Program Editor.

year()
Return the current year as an integer (e.g. 2009).

month()
Return the current month as an integer (1

–12).

day()
Return the current day of the month as an integer (1

–31).

hour()
Return the current hour as an integer (0

–23).

minute()
Return the current minute as an integer (0

–59).

second()
Return the current second as an integer (0

–59).

dayOfWeek()
Return the current day of week as an integer (Monday = 0).

dayOfYear()
Return the current day of the year as an integer (1

–366).

time()
This returns the number of seconds since midnight on January 1st, 1970, as a floating point number.

clearRuntime(@referenceName)
Clear the accumulated runtime hours for the Runtime object specified by referenceName.

firstRun()
Returns 1 if this is the first time the program has been executed since the last time it was edited and
saved, or since the last reboot. It is useful for initializing saved variables:

if firstRun():

setVariable("Bias",50)

setVariable("myVariable",92.7)

A firstRun can also be simulated with the "restart()" function (see below).

restart()
This resets the internal firstRun flag so that when the program next executes, firstRun() will return 1. This
is useful to reinitialize saved variables.

setDefaultValue(@referenceName, value, timer=0)
Set the default value for the point specified by referenceName. The default value is the value the point
will have if nothing else is controlling it, such as a schedule or program. If a point is released from
program control using the "release()" function and nothing else is controlling it, this default value will be
sent to the point.

releaseDefault(@referenceName)
Clear the default value of the point specified by the referenceName. If a point is released using the
"release()" function, nothing else is controlling it and it has no default value, it will retain the last value sent
by the program indefinitely.