GRANT OF LICENSE. AMX Corporation grants to you the right to use the enclosed i!-Weather software program (the
SOFTWARE) on a single central processing unit (CPU). This license is for object code only and does not convey any
rights to use of the source code.
This Agreement does not authorize you to distribute the SOFTWARE.
COPYRIGHT. The SOFTWARE is owned by AMX Corporation, and is protected by United States copyright laws and
international treaty provisions. Therefore, you must treat the SOFTWARE like any other copyrighted material (e.g., a
book or musical recording) except
val purposes, or (b) transfer the SOFTWARE to a single hard disk provided you keep the original solely for backup or
archival purposes. You may not copy the written materials accompanying the SOFTWARE.
OTHER RESTRICTIONS. You may not rent or lease the SOFTWARE, but you may transfer the SOFTWARE and
accompanying written materials on a permanent basis provided you retain no copies and the recipient agrees to the
terms of this Agreement. You may not reverse engineer, decompile, or disassemble the SOFTWARE. If the SOFTWARE is an update or has been updated, any transfer must include the most recent update and all prior versions.
You may use only one version of the SOFTWARE at any time. You may not use the version of the SOFTWARE not
being run on your CPU on any other CPU or loan, rent, lease or transfer them to another user whether with or without
consideration.
LIMITED WARRANTY
LIMITED WARRANTY. AMX Corporation warrants that the SOFTWARE will perform substantially in accordance with
the accompanying written materials for a period of ninety (90) days from the date of receipt. Any implied warranties on
the SOFTWARE and hardware are limited to ninety (90) days and one (1) year, respectively. Some states/countries do
not allow limitations on duration of an implied warranty, so the above limitation may not apply to you.
CUSTOMER REMEDIES. AMX Corporation’s entire liability and your exclusive remedy shall be, at AMX Corporation's
option, either (a) return of the price paid, or (b) repair or replacement of the SOFTWARE that does not meet AMX Corporation's Limited Warranty and which is returned to AMX Corporation. This Limited Warranty is void if failure of the
SOFTWARE or hardware has resulted from accident, abuse, or misapplication. Any replacement SOFTWARE will be
warranted for the remainder of the original warranty period or thirty (30) days, whichever is longer.
NO OTHER WARRANTIES.
not limited to implied warranties of merchantability and fitness for a particular purpose, with regard to the SOFTWARE,
the accompanying written materials, and any accompanying hardware. This limited warranty gives you specific legal
rights. You may have others which vary from state/country to state/country.
NO LIABILITY FOR CONSEQUENTIAL DAMAGES
whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business
information, or any other pecuniary loss) arising out of the use of or inability to use this AMX Corporation product, even
if AMX Corporation has been advised of the possibility of such damages. Because some states/countries do not allow
the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.
that you may either (a) make one copy of the SOFTWARE solely for backup or archi-
AMX Corporation disclaims all other warranties, either expressed or implied, including, but
. In no event shall AMX Corporation be liable for any damages
U.S. GOVERNMENT RESTRICTED RIGHTS
The SOFTWARE and documentation are provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the
Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Manufacturer is AMX Corporation, 3000 Research Drive,
Richardson, TX 75082.
If you acquired this product in the United States, this Agreement is governed by the laws of the State of Texas.
Should you have any questions concerning this Agreement, or if you desire to contact AMX for any reason, please
write: AMX Corporation, 3000 Research Drive, Richardson, TX 75082.
The following structures contain all the detailed weather data elements retrieved by
i!-WeatherEngine module. Any of these elements can be accessed by your program after weather
data has been received and decoded.
//i!-Weather DATA STRUCTURE
STRUCTURE _sWEATHER
{
//Location
CHAR cREPORTING_STATE[20] //Weather Data Reporting State
CHAR cREPORTING_CITY[100] //Weather Data Reporting City
CHAR cCELL[10] //Cell
CHAR cZIPCODE[5] //Weather Zip Code
CHAR cCITY[100] //Weather City
CHAR cSTATE[20] //Weather State
CHAR cSTATION[10] //Weather Station
CHAR cSUNRISE[15] //Sunrise Time (In GMT)
CHAR cSUNSET[15] //Sunset Time (In GMT)
//Weather Data
CHAR cLAST_UPDATE[20] //Last Date & Time of Current Weather Update (In GMT)
CHAR cLAST_UPD_DATE[15] //Last Date of Current Weather Update
CHAR cLAST_UPD_TIME[15] //Last Time of Current Weather Update (In GMT)
CHAR cTEMP[10] //Current Temp String
SINTEGER nTEMP //Current Temp Value
CHAR cHUMIDITY[10] //Current Humidity String
INTEGER nHUMIDITY //Current Humidity Value
CHAR cHEAT_INDEX[10] //Current Heat Index String
SINTEGER nHEAT_INDEX //Current Heat Index Value
CHAR cWIND_CHILL[10] //Current Wind Chill String
SINTEGER nWIND_CHILL //Current Wind Chill Value
CHAR cDEW_POINT[10] //Current Dew Point String
SINTEGER nDEW_POINT //Current Dew Point Value
CHAR cWIND_DIRECTION[20] //Current Wind Direction String
INTEGER nWIND_DIRECTION //Current Wind Direction Value
CHAR cWIND_SPEED[15] //Current Wind Speed String
INTEGER nWIND_SPEED //Current Wind Speed Value
CHAR cBAROMETER[20] //Current Barometric Pressure String
FLOAT fBAROMETER //Current Barometric Pressure Value
CHAR cCONDITION[20] //Current Condition String
INTEGER nCONDITION //Current Condition Value
//Forecasting
CHAR cFORECAST_DATE[20] //Forecast Start Date
CHAR cFC_HI[5][10] //Forecast Day Hi Temp String
SINTEGER nFC_HI[5] //Forecast Day Hi Temp Value
CHAR cFC_LO[5][10] //Forecast Day Lo Temp String
SINTEGER nFC_LO[5] //Forecast Day Lo Temp Value
CHAR cFC_CONDITION[5][15] //Forecast Day Condition String
INTEGER nFC_CONDITION[5] //Forecast Day Condition Value
CHAR cFC_DATE[5][15] //Forecast Day Date
INTEGER nFC_DAY_OF_WEEK[5] //Forecast Day Day of Week Index
CHAR cFC_DAY_OF_WEEK[5][10] //Forecast Day Day of Week String
//General
INTEGER nQUERY_SUCCESSFUL //Query Success or Fail
CHAR cBUFFER[65000] //XML Buffer
CHAR cGETZIPCODE[5] //ZIP Code to query for
CHAR cGETSTATION[10] //STATION Code to query for
INTEGER nQUERY_METHOD //Query Weather Method
CHAR cLAST_QUERY_DATE[15] //Last date weather was queried
CHAR cLAST_QUERY_TIME[15] //Last time weather was queried (In NetLinx Time)
INTEGER bDEMO_MODE //Data Received is in Demo Mode
INTEGER nMESSAGE_TYPE //Message Type received in weather packet
CHAR cMESSAGE[250] //Message Text received in weather packet
INTEGER nDAYS_REMAINING //Days in weather service subscription
remaining
CHAR cERROR_CODE[3] //Error Codes
i!-Weather
}
13
Programming i!-Weather
Request New Weather Data
To request new weather data, your program simply needs to specify the zip code or station code,
and then generate a
i!-WeatherEngine module receives the request notification, attempts to connect the weather
provider, and gets new weather data. An example is provided below:
PUSH notification on the virtual weather device (vdvWEATHER). The
//----------------------------------------------------------------------// i!-Weather Update Weather Data By Zip Code for: New York, New York.
//---------------------------------------------------------------------- BUTTON_EVENT[dvTP,1]
{
PUSH:
{
//Set ZIP Code
chZIPCODE = "'10101'"
//Get Weather Data By ZIP Code
DO_PUSH_TIMED(vdvWEATHER,VIRTUAL_CHANNEL_QUERY_BY_ZIPCODE,5)
}
}
//----------------------------------------------------------------------// i!-Weather Update Weather Data By Station Code for: Dallas, Texas
//---------------------------------------------------------------------- BUTTON_EVENT[dvTP,2]
{
PUSH:
{
//Set Station Code
chStation = "'KDFW'"
//Get Weather Data By Station Code
DO_PUSH_TIMED(vdvWEATHER,VIRTUAL_CHANNEL_QUERY_BY_STATION,5)
}
}
Weather data can also be requested via the virtual weather device command
interface.
14
i!-Weather
Programming i!-Weather
Receive New Weather Data
Once the i!-WeatherEngine module receives new weather data, it will send a notification on the
virtual weather device. Upon receiving this notification, your program can take the
chSTRUCTURE_ENCODED_BUFFER and decode it using the STRING_TO_VARIABLE function to
your local weather structure. An example is provided below:
//CHECK IN STRUCTURE TO SEE IF QUERY WAS SUCCESSFUL
IF(sWEATHER.nQUERY_SUCCESSFUL)
{
SEND_STRING 0 , "' '"
SEND_STRING 0 ,"'===================================================='"
SEND_STRING 0 ,"'===================================================='"
SEND_STRING 0 ,"' It is currently [',sWEATHER.cTEMP,'] in the city of
[',sWEATHER.cCITY,']'"
SEND_STRING 0 ,"' with conditions of [',sWEATHER.cCONDITION,']'"
SEND_STRING 0 ,"' The winds are at [',sWEATHER.cWIND_SPEED,'] in the
[',sWEATHER.cWIND_DIRECTION,'] direction'"
SEND_STRING 0 ,"' Reported By [',sWEATHER.cSTATION,'] at
//---------------------------------------------------------------------------// i!-Weather New Data Recevied----------------------------------------------//----------------------------------------------------------------------------
//i!-Weather Engine Notified Us That New Data is Ready
BUTTON_EVENT[vdvWEATHER,VIRTUAL_CHANNEL_SUCESS]
{
PUSH:
{
STACK_VAR
VOLATILE SINTEGER siRESULT
//DECODE NEW STRUCTURE DATA
siRESULT = STRING_TO_VARIABLE(sWEATHER,chSTRUCTURE_ENCODED_BUFFER,1)
//CHECK IN STRUCTURE TO SEE IF QUERY WAS SUCCESSFUL
IF(sWEATHER.nQUERY_SUCCESSFUL)
{
SEND_STRING 0 , "' '"
SEND_STRING 0 ,"'===================================================='"
SEND_STRING 0 ,"'===================================================='"
SEND_STRING 0 ,"' It is currently [',sWEATHER.cTEMP,'] in the city of
[',sWEATHER.cCITY,']'"
SEND_STRING 0 ,"' with conditions of [',sWEATHER.cCONDITION,']'"
SEND_STRING 0 ,"' The winds are at [',sWEATHER.cWIND_SPEED,'] in the
[',sWEATHER.cWIND_DIRECTION,'] direction'"
SEND_STRING 0 ,"' Reported By [',sWEATHER.cSTATION,'] at
The i!-Weather data structure returned contains an ERROR_CODE field. This field can help
determine if an error was encounted and whay type of error it is.
Error Codes:
E01 - Subscription Invalid (Expired)
E02 - Zip Not Found
E03 - Station Not Found
E04 - System Status is Down
I01 - System Maintenance
W01 - Subscription Expiring Soon
W02 - Unregistered Master (DEMO MODE)
Appendix A
The first byte in the Error Code detmines the error type.
'E' : Error - no not process weather data.
'I' : Informaion
'W' : Warning
Additional textual information will also be returned to the MESSAGE field of the i!-Weather data
structure.
!-Weather
1
Appendix A
2
i!-Weather
Appendix A
i!-Weather
3
AMX reserves the right to alter specifications without notice at any time.
DALLAS, TEXAS • LOS ANGELES, CALIFORNIA • MEXICO CITY, MEXICO • ONTARIO, CANADA • PHILADELPHIA, PENNSYLVANIA • SHANGHAI, CHINA • SINGAPORE • TAMPA, FLORIDA • WESTERLO, BELGIUM • YORK, ENGLAND
3000 RESEARCH DRIVE, RICHARDSON, TX 75082 USA • 800.222.0193 • 469.624.8000 • 4 69-624-7153 fax • 800.932.6993 techni cal support • www.amx.com
2005 AMX Corporation. All rights reserved. AMX, the AMX logo, the building icon, th e home icon, and the light bulb icon are all trademarks of AMX Corporation.