User manual

Figure 1 - Example HVAC System Showing RPC Call-flow (arrows)
RPCs are a fundamental part of SNAP’s communicaon infrastructure, enough so that there is an enre secon
of this manual devoted to it, beginning on page 32.
SNAPpy Scripng
SNAPpy is a subset of the Python programming language, opmized for low-power embedded devices. A
SNAPpy “script” is a collecon of funcons and data that is processed by Portal and uploaded to SNAP devices.
All SNAP devices are capable of running SNAPpy it is the nave language of SNAP RPC calls.
SNAPpy Examples
On installaon, Portal creates a folder under “My Documents” called “Portal\snappyImages”.0F
1
Several sample
script files are installed here by default. These scripts are plain text files that may be opened and edited with
Portal’s built-in editor. External text editors (such as Notepad) or even full-fledged Python Integrated
Development Environments (IDEs) may also be used. Feel free to copy and modify the sample scripts (the
installed copies are read-only), and create your own as you build custom network applicaons.
Be sure to make copies of the provided files rather than just changing the file aributes to be editable.
Otherwise, if you ever update your version of Portal you will overwrite any changes you have made to the files.
Portal Scripng
Just as with the SNAP nodes, Portal can also be extended through scripng. By loading a Python script into
Portal, you can add new funcons that you (and the other SNAP nodes) can call.
Portal scripts are wrien in full Python. You are not limited to the embedded SNAPpy subset for Portal scripts, as
you are for SNAPpy scripts that run on SNAP Engines. Python is a very powerful language, which finds use in a
wide variety of applicaon areas. Although the core of Python is not a large language, it is well beyond the scope
of this document to cover it in any detail.
1
The installaon path shown is for Windows installaons. File locaons for Mac OS X and Ubuntu Linux installaons will be
appropriate for those file systems.
SNAP® Network Operang System 5