PoBlocks just got a set of new communication features in PoKeys57 series ethernet devices. UDP sender enables PoKeys device to send simple messages using UDP protocol on request from the PoBlocks project. PoKeys InterCom protocol on the other hand enables sending data between PoKeys devices.

PoKeys (Simple) UDP sender

As the name applies, UDP sender is used to send simple UDP packets to target device. Target device is specified with the IP address and UDP port number, while the contents of the packet is defined in ‘Packet contents’ block property. Let’s take a look at a simple example that sends some simple data to a target PC with IP 192.168.5.101 and target port number of 25000. The example is shown below:

PoKeys Simple UDP sender

PoKeys Simple UDP sender

We used the following packet contents descriptor: In_a=%05a In_b=%3.4b In_c=%+2c

Let’s break it down to parts:

  • In_a=%05a: the first entry consists of constant ‘In_a=‘ and a value of the input a, which is displayed with 5 (zero-padded) digits.
  • In_b=%3.4b: the second entry similarly consists of a constant ‘In_b‘ and the value of the input b, displayed with 3 digits before and 4 digits after the decimal point
  • In_c=%+2c: the last entry consists of constant ‘In_c‘ and a value of the input c, displayed with + or – sign before the 2 digit number representation.

The packet received by the 192.168.5.101 is shown below.

UDP sender data packet

UDP sender data packet

In this example, we used the values of 3 block inputs – otherwise, the UDP sender block supports 6 inputs and each can be used any number of times in the packet contents specifier.

PoKeys InterCom

PoKeys InterCom enables easy exchange of PoBlocks signal values between PoKeys devices. It is uni-directional protocol that uses RAW Ethernet type II frames. In order to send data from one PoKeys device to another, simply use the ‘InterCom To/From’ blocks and configure the ‘InterCom To’ block with serial number of the target PoKeys device. The protocol does not rely on IP communication protocol and does not require the network parameters to be configured. Even PoKeys device that are configured with different IP subnet addresses can easily talk to each other using PoKeys InterCom.

Let’s take a look at the example below. One PoKeys device project (on the left) contains a counter and a ‘To (InterCom)’ block with Link ID of 0. This block is configured to send data to target PoKeys device with serial number of 45000 (device on the right). It also features a ‘From (InterCom)’ block with Link ID of 1. The right project contains a ‘From (InterCom)’ block (with Link ID of 0), connected to ‘To (InterCom)’ block with Link ID of 1 and target PoKeys device serial number of 45001 (device on the left).

This example sends counter value from PoKeys device 45001 to PoKeys device 45000, where the value is routed back to PoKeys device 45001. In order to run the example, connect PoKeys devices to a switch/router or connect them with an Ethernet cable directly. No additional network-related setting is required.

PoKeys InterCom example

PoKeys InterCom example

Both features are available in Ethernet PoKeys57 series devices with firmware version 4.2.22 or newer (check PoLabs downloads page for the latest version).