User guide

BB2-7040 User Guide – Rev. 1.2 Page 41
This page emulates terminal I/O interaction with your Basic program as best an HTML page can.
Start the program by clicking "Start". While running, input you type in the input window will be made available to your
program each time you click "Enter". Each time you click "Refresh", the output window will be updated with any output
generated by your program since the last time you clicked "Refresh". Click "Clear" to discard old output.
Note: The "Enter" and "Refresh" buttons have the same effect as they are both submit buttons. Input present in the input
box will be submitted when you click any button.
11.2 Script Basic Enhancements Specific to ZigBee
The ZigBee-specific statements are found only in BB2-7040 version of Script Basic. Communication with a ZigBee
device is done via the file interface in Basic. The ZigBee API channel is opened as a file, and ASCII strings are printed
to and input from this file.
Opening the ZigBee COM port: Any file number may be used, but file #1 is used in the following example(s).
Program lines:
open "API" for comm as 1
open "API+" for comm as 1
The first example using "API" as file name will expect API packets to all use the 0x17 remote API command, and will
be filtered such that received packets are only returned to Basic when they contain the 0x97 reply code and reference a
frame ID generated by Basic. The second example using "API+" will result in Basic receiving unqualified packets,
including 0x92 packets generated voluntarily by sensors, etc.