Skip to content

UDP

The UDP plugin binds a local port and decodes each datagram into one sample, using byte offsets from your signal file. It is the fastest way to get a custom device or test software into VizuaLog: send a fixed binary layout and describe it once.

The plugin is a listener. It never initiates anything or connects to a remote host.

Several UDP interfaces can run in one session, each on its own port. The socket binds exclusively, so a second instance on the same port fails with a clear error.

FieldTypeDefaultNotes
Listen OncomboAll interfacesWhich local network interface to bind. Enumerated from this machine’s own IPv4 addresses when the form opens. Never the sender’s address
Accept Only FromtextemptyOptional filter on the sender’s address. Empty accepts datagrams from anyone
UDP Portnumber49152The local port to bind. Must match the port the sender transmits to
Byte OrdercomboLittleEndianness of the multi-byte fields in the datagram. Big for most industrial and network-order sources
Packet Size (bytes)number0Expected datagram size. 0 derives it from the signal file. A datagram shorter than this is rejected
Placeholder image

The two ends configure different things:

  • The sender needs a destination: the receiver’s IP address and port.
  • The receiver needs only a local port to bind. It learns the sender’s address from each datagram.

VizuaLog on 192.168.0.20, a sender on 192.168.0.10, port 5005:

SettingValue
Senderdestination IP192.168.0.20 ← the receiver
destination port5005
VizuaLogListen OnAll interfaces
UDP Port5005
Accept Only Fromempty, or 192.168.0.10

Both ends must use the same byte layout.

127.0.0.1 is only correct in the sender, and only when both programs run on the same machine.

Leave it at All interfaces unless the machine has more than one network, such as Ethernet and Wi-Fi, a VPN or a Docker bridge. Then pin the interface so traffic from other paths is ignored. An address the machine does not own fails the bind. Do not enter the sender’s address here; it belongs in Accept Only From.

On an industrial LAN, two devices often send to the same port. Without a filter the wrong device’s bytes are decoded against your layout, giving plausible but wrong numbers. The filter checks each datagram’s sender address, never its port, since most senders use an ephemeral source port that changes every run. Filtered datagrams are counted as drops and reported once, so a mistyped filter shows up in the event log.

FieldRequiredMeaning
byteOffsetYesByte position of the value within the datagram
bitbool onlyBit 0–7 within that byte. Defaults to 0

Each signal’s dataType sets how many bytes the field takes at its offset and how to read them.

dataTypeBytesRead as
bool1One bit of that byte, selected by bit
int8 / uint81Signed / unsigned byte
int16 / uint162Signed / unsigned, Byte Order applies
int32 / uint324Signed / unsigned, Byte Order applies
float324IEEE-754 single, Byte Order applies
float648IEEE-754 double, Byte Order applies

A signal with a missing or unrecognized dataType is not loaded. The parser skips it and names it in the log. See Types.

With Packet size at 0, the size is the highest byteOffset + size in the signal file. Set it explicitly when the sender pads its frames or sends a struct larger than the fields you decode.

A signal with no byteOffset keeps its place in the sample and always reads 0.0. A warning on connect names it.

A datagram is rejected without decoding when it is:

  • shorter than the expected size, since fields past its end would silently read as 0.0;
  • from a sender the filter excludes.

Each rejection is counted, and the reason is reported once, then summarized (“…and 4,312 more in the last 5s”). Raw bytes reach the raw console before this, rejected datagrams included, so debug a frame that will not parse there.

A bound port says nothing about whether a sender exists, so the states are:

StateMeans
Waiting for data…The socket is bound. Nothing has arrived yet
ConnectedAt least one datagram has been decoded, and data is still flowing
Not receiving data!Nothing has arrived for about two seconds, whether or not anything ever did
Connection failed…The bind itself failed: port in use, or an address this machine does not own

Waiting for data… points at the network, firewall, port or address. Connected with wrong values points at the schema.

The stall timeout allows sources down to about 0.5 Hz. A bind failure says why, for example “port 5005 is already in use by another application or interface”.

An 8-byte frame carrying a float, a uint16 and two packed booleans:

BytesSignalType
0 – 3MotorTempfloat32
4 – 5MotorRpmuint16
6, bit 0MotorRunningbool
6, bit 1OverTempAlarmbool
{
"dataSignals": [
{
"name": "MotorTemp",
"unit": "°C",
"dataType": "float32",
"minValue": 0,
"maxValue": 150,
"byteOffset": 0
},
{
"name": "MotorRpm",
"unit": "rpm",
"dataType": "uint16",
"minValue": 0,
"maxValue": 3000,
"byteOffset": 4
},
{ "name": "MotorRunning", "dataType": "bool", "byteOffset": 6, "bit": 0 },
{ "name": "OverTempAlarm", "dataType": "bool", "byteOffset": 6, "bit": 1 }
]
}

Unicast and broadcast only. The plugin does not join multicast groups, so a source sending to 224.x.x.x is never received. Broadcast to a subnet address works.

Work down the list; each step rules out one layer.

  1. Is anything arriving at the machine? Test without VizuaLog:

    Terminal window
    sudo tcpdump -i any -n udp port 5005 # macOS/Linux: see datagrams land
    nc -u -l 5005 # an independent listener

    Nothing here means the problem is the network, firewall or address, not the plugin.

  2. Firewall. The usual cause on Windows: inbound UDP to a new application is blocked by default, and a Public network blocks it even after the prompt.

    Terminal window
    New-NetFirewallRule -DisplayName "VizuaLog UDP" -Direction Inbound -Protocol UDP -LocalPort 5005 -Action Allow

    On Linux, check sudo ufw status; if active, run sudo ufw allow 5005/udp.

  3. macOS senders: Sonoma and later require Local Network permission. Without it an app can reach 127.0.0.1 but is silently blocked from the LAN, so it breaks when you move from one machine to two. System Settings → Privacy & Security → Local Network.

  4. Address and subnet. Run ip -4 addr or ipconfig. Both machines must be on the same subnet, with the sender aiming at the receiver’s LAN address, not a VPN or Docker address. Some routers isolate Wi-Fi clients from each other.

  5. Port match. The sender’s destination port and VizuaLog’s UDP Port must be equal.

  6. Values wrong, not missing? Check the schema: byte offsets, Byte Order or dataType. Compare the raw console with your offsets. A plausible number that never matches the device is usually a width mismatch, and every field after it is wrong too. If the schema predates the type change, check double first: it is 8 bytes now, 4 before.

  7. A signal stuck at exactly 0.0 while others move? It has no byteOffset.

  8. A signal missing from the list? Its dataType was missing or unrecognized and the parser skipped it. The warning names it and lists the accepted types.

All of these messages are kept in full in the event log after the toast has gone.