snap ethernet-based i/o units protocols and programming guide
snap ethernet-based i/o units protocols and programming guide
snap ethernet-based i/o units protocols and programming guide
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
CHAPTER 2<br />
Chapter 2<br />
Overview of Programming<br />
Introduction<br />
In general, writing programs to use SNAP Ethernet-<strong>based</strong> I/O <strong>units</strong> involves six steps. You can<br />
use either TCP or UDP as the protocol. The steps are:<br />
1. Connect to the brain (TCP only; not required for UDP).<br />
2. Send a powerup clear (PUC) to the brain.<br />
3. Configure points <strong>and</strong> point features.<br />
4. (Optional) Configure event/reactions, security, streaming, <strong>and</strong> other functions.<br />
5. Read <strong>and</strong> write to points.<br />
6. Disconnect from the brain (TCP only; not required for UDP). This step occurs only after all<br />
communication is finished. The connection is left open during normal communications.<br />
Details of these steps depend on the language or method you use for developing your custom<br />
application, but some basic information is common to all languages <strong>and</strong> methods. This chapter<br />
includes the following basic information you need in order to program for SNAP Ethernet-<strong>based</strong><br />
I/O <strong>units</strong>:<br />
Underst<strong>and</strong>ing the brain’s memory map page 12<br />
Referencing SNAP I/O points page 13<br />
Configuring I/O points page 18<br />
Using I/O point features page 20<br />
Using event/reactions page 26<br />
Streaming data from the brain to a host page 35<br />
Data logging page 37<br />
Using PID loops page 39<br />
Formatting <strong>and</strong> interpreting data page 41<br />
You can use ioManager to configure all points <strong>and</strong> functions (see the ioManager User’s Guide for<br />
instructions), or you can configure them in your program.<br />
SNAP Ethernet-Based I/O Units Protocols <strong>and</strong> Programming Guide 11