|
Reacting to a Receive Sequence - Sample Project: PingPong.ptp |
|
|
The Docklight project PingPong.ptp is a simple example for how to define and use Receive Sequences.
Getting started
Docklight will detect the incoming data as being one of the defined Receive Sequences. It will then perform the action predefined for this event, which is sending out another sequence. As a result, Docklight will send out alternating Send Sequences - "Ping" and "Pong".
The Docklight communication display should look similar to this:
3/8/2009 16:25:44.201 [TX] - ----o Ping 3/8/2009 16:25:44.216 [RX] - ----o Ping "Ping" received 3/8/2009 16:25:44.218 [TX] - o---- Pong 3/8/2009 16:25:44.233 [RX] - o---- Pong "Pong" received 3/8/2009 16:25:44.236 [TX] - ----o Ping 3/8/2009 16:25:44.251 [RX] - ----o Ping "Ping" received 3/8/2009 16:25:44.254 [TX] - o---- Pong 3/8/2009 16:25:44.268 [RX] - o---- Pong "Pong" received 3/8/2009 16:25:44.271 [TX] - ----o Ping 3/8/2009 16:25:44.286 [RX] - ----o Ping "Ping" received 3/8/2009 16:25:44.289 [TX] - o---- Pong 3/8/2009 16:25:44.303 [RX] - o---- Pong "Pong" received 3/8/2009 16:25:44.307 [TX] - ----o Ping 3/8/2009 16:25:44.322 [RX] - ----o Ping "Ping" received 3/8/2009 16:25:44.324 [TX] - o---- Pong ...
See also the corresponding log files in the \Samples folder (PingPong_Logfile_asc.htm and PingPong_Logfile_hex.htm).
Further Information
This demo project can also be run in three alternative configurations:
TIP: For Docklight Scripting there is also a related example project that uses a UDP loopback connection, and does not require any serial data ports. See the PingPong_UDP_Loopback.ptp project in the \Network folder of the ScriptSamples directory.
|