ph_setdigitalout PowerHome formula function
Description
Sets or clears a digital output defined in the Digital I/O screen.
Syntax
ph_setdigitalout ( id, value )
Argument Description
id The ID of the digital output as defined within the Digital I/O screen.
value The value to set the digital output to. 1 will turn the digital output on. 0 will turn the digital output off.
Return value
Integer. Returns a 0 if successful. Returns - 100 if the ID cannot be found. When this function is executed, the controller, unit, and point is looked up within the Digital I/O table and these values are then passed to the controller. If these values are entered improperly in the Digital I/O screen, then the following errors may be returned: - 1 is returned if the controller is not available, - 2 is returned if the controller does not support digital outputs, - 3 is returned if the unit is out of range, - 4 is returned if the point is out of range.
Usage
This function is similar to the ph_setotherdigitalout function except that the output MUST be defined within the Digital I/O screen.