Posted on

Developer: Art-Net – Identifying the source of an ArtTodData packet

The ArtTodData packet is used to encode a list of UIDs received from a particular physical port. This is the Table of Devices or ToD.

It is often useful to identify the physical port that generated the packet. Because Art-Net (for historical reasons) allows a variable number of ports to be encoded in an ArtPollReply, the calculation is not trivial.

ArtTodData->Port is limited to a range of 1-4. It is used in combination with BindIndex to identify the physical port that generated the packet. This is done by referencing data in the ArtPollReply with a matching BindIndex:

ArtPollReplyData->BindIndex == ArtTodData->BindIndex

An ArtPollReply can encode between 1 and 4 physical ports, defined by ArtPollReply->NumPortsLo. This number must be used when calculating the physical port in order to allow for the variable encoding.

The calculation is:

Physical Port = (BindIndex-1) * ArtPollReply->NumPortsLo + ArtTodData->Port

As most modern Art-Net gateways implement one universe per ArtPollReply, ArtTodData->Port will usually be set to a value of 1.

The following tables show how this works in practice:

A gateway that has 5 physical ports and encodes 1 port per ArtPollReply (the recommended modern implementation).

Physical port 1-xArtTodData->BindIndexArtPollReply->NumPortsLoArtTodData->Port
1111
2211
3311
4411
5511

A gateway that has 9 physical ports and encodes 2 ports per ArtPollReply (very widely implemented in Art-Net 3 era products).

Physical port 1-xArtTodData->BindIndexArtPollReply->NumPortsLoArtTodData->Port
1121
2122
3221
4222
5321
6322
7421
8422
9521

A gateway that has 9 physical ports and encodes 4 ports per ArtPollReply (very widely implemented in Art-Net 3 era products).

Physical port 1-xArtTodData->BindIndexArtPollReply->NumPortsLoArtTodData->Port
1141
2142
3143
4144
5241
6242
7243
8244
9341