beautypg.com

Built-in functions – Contemporary Control Systems BASview User Manual

Page 68

background image

TD110500-0MC

68

Built-in Functions

The following is a list of the built-in functions and a short description of each.

getValue(@referenceName)
Get the value of a point specified by the referenceName.

setValue(@referenceName, value, overrideTime=0)
Set the value of a point specified by the referenceName, to the value given in the second argument. An
optional override time in seconds may be given as a third argument. If the override time is not supplied,
or set to 0, the point will retain the value indefinitely. Note that the point must have the "Allow
modifications" option checked in its properties screen for setValue to work.

release(@referenceName)
Release the point specified by the referenceName from program control. The point will then fall back to
the value the rest of the system determines it should have (from a schedule, etc.).

resend(@referenceName)
Forces the current value of the point specified by referenceName to be resent to the device, effectively
refreshing the point. Normally when a point is already ON, a second ON command will not resend the ON
state to a device. This function forces the ON to be resent.

overrideSchedule(@referenceName, state, timer=0)
Override the schedule specified by referenceName to the state (0 or 1) given in argument 2. An optional
override time in seconds may be given as a third argument. If the override time is not supplied, or set to
0, the schedule will remain overridden indefinitely.

releaseSchedule(@referenceName)
Release the schedule specified by the referenceName from program control. The schedule will then
revert to normal operation.

overrideAlarm(@referenceName, state, timer=0)
Override the alarm specified by referenceName to the state (0 or 1) given in argument 2. An optional
override time in seconds may be given as a third argument. Note that the timeout specified on the alarm
screen is still in effect. If the alarm timeout is 2 minutes, the alarm must be overriden for at least 2
minutes to become active.

releaseAlarm(@referenceName)
Release the alarm specified by the referenceName from program control. The alarm will then revert to
normal operation.

timer()
Returns the number of seconds the program has been running since it was saved, since reboot, or since
it was last cleared. Each program has its own timer that is continuously incremented in the background.

clearTimer()
Clear the timer for this program to 0.

debug(msg)
Send a text message to the debug window on the debug tab of the Program Editor. Note that the
message must be enclosed in quotes, for example: debug("This is a debug message"). To embed a
numeric value in a debug message, use the built-in Python str() function. Example: debug("Setpoint = " +
str(getValue(@mySetpoint))).

getVariable("name")
Read a saved variable. See "Saved Variables" above for more information. Returns zero if a variable
called "name" has not been previously set.

setVariable("name", value)
Set a saved variable. See "Saved Variables" above for more information.

removeVariable("name")
Remove a saved variable from the list. See "Saved Variables" above for more information.

getGlobal("name")