User Guide

Programming i!-Weather
20
i!-Weather
Examples
To retrieve New York’s weather by zip code:
SEND_COMMAND vdvWEATHER," ’WEATHER BY ZIP-10101’ "
To set the i!-WeatherEngine speed format to knots:
SEND_COMMAND vdvWEATHER," ’SPEED-KNOTS’ "
To request the i!-WeatherEngine’s temperature format:
SEND_COMMAND vdvWEATHER," ’TEMPERATURE’ "
The i!-WeatherEngine will respond by sending a STRING on the vdvWEATHER device:
SEND_STRING vdvWEATHER, " ‘TEMPERATURE-FARENHEIT’ "
Any command unrecognized by the i!-WeatherEngine module will send an error notification by a
DO_PUSH on VIRTUAL_CHANNEL_ERROR_UNHANDLED_COMMAND (248), and it will return a
SEND_STRING to the vdvWEATHER device. Below is the actual code that is executed when the
command received is not recognized:
//PULSE VIRTUAL DEVICE ERROR STATUS
DO_PUSH_TIMED(vdvWEATHER,VIRTUAL_CHANNEL_ERROR_UNHANDLED_COMMAND,5)
//UNHANDLED COMMAND
SEND_STRING vdvWEATHER, "'[UNHANDLED COMMAND] -',DATA.TEXT"
//DEBUG
IF([vdvWEATHER,VIRTUAL_CHANNEL_DEBUG])
SEND_STRING 0, "'UNHANDLED COMMAND: [',DATA.TEXT,']'"