Table of Contents
23 Broadcast (UDP)
The APPic framework features a UDP server/client that allows for communicating on the local (physical) network with devices or applications that are configured for other IP network ranges. A common use-case is scanning the network for other APPic software instances, mostly running on distributed systems (eg embedded devices).
NetDX over UDP
Format
An APPic UDP message consists of
-
APPIC prefix (APPIC): String “APPIC”
-
Local MAC address (LADR): String (hex notation)
-
Local Port (LPOR): Unsigned word
-
Remote MAC address (RADR): String (hex notation)
-
Data Block (DATA): String
APPIC | LADR | LPOR | RADR | DATA |
---|---|---|---|---|
“APPIC” | 6 bytes | 2 | 6 bytes | … |
Data Block
Command and parameter data are transmitted serialized within the data block. The dollar sign (ASCII-Code 0x24
) serves as a separation character for the following two elements:
-
Command Name (CMD): String
-
Parameters (PARAM): String
CMD | PARAM | |
---|---|---|
string | “$” | string |
The PARAM string can consist of more than one parameter. These are then again separated by the dollar sign (ASCII-Code 0x24
).
Sender (TX)
The NetDX UDP Client uses LabVIEWs UDP Write
function to write a NetDX UDP message to a UDP socket. Messages are sent to the broadcast IPv4 address 0xFFFFFFFF
(255.255.255.255).
Required Parameters
-
UDP Network Connection in (Reference to the UDP socket)
-
Command and Data (written to
DATA
message field) -
Remote MAC Address (hex) (written to
RADR
message field) -
Remote Port (used as port number for the UDP socket)
Optional Parameters
-
Local MAC Address (hex) (written to
LADR
message field) -
Local Port (written to
LPOR
message field)
Receiver (RX)
The NetDX UDP Server listens (default: port 33334) for incoming APPic NetDX UDP messages, and reacts accordingly.
-
Process message only if first 5 bytes equal
APPIC
-
Process message only if one of the following is true
-
RADR
equals the receivers MAC address -
RADR
equals0x000000000000
ReadLADR
andLPOR
fields in case the command requires an addressed reply (a NetDX UDP message to the very specific device that sent the message)
Commands
Command set is valid from APPic Framework release v2.2.3EVENT
Triggers the APPic System Event named
UDP
on the target device with the given parameters.Request
EVENT$<%event-parameter%>$<%event-data%>
-
event-parameter
: The parameter field of the APPic event datatype -
event-data
: The data field of the APPic event datatype
Response
None.
REPORT
A UDP message is broadcast to all local (physical) network interfaces, and every device running the APPic framework with the UDP server enabled will answer with another UDP message containing the IP address and the MAC address of the device.
Request
Triggers all targets to report their IP address and MAC address via UDP broadcast
REPORT
Response
Sends IP address and MAC address to the EVENT command of the caller's APPic UDP server.
Message is sent as NetDX UDP broadcast (RADR
=0x0000 0000 0000
).EVENT$REPORT$<%ip-address%>$<%mac-address%>
-
ip-address
: IP address of the device (dot notation) -
mac-address
: MAC address of the device (dot notation)
RESTART
Restarts the target if possible (only supported for targets running real-time OS)
Request
RESTART
Response
None.
SET-IP
Sets the IP address of the target if possible (only supported for targets running real-time OS)
Request
SET-IP$<%ip-address%>$<%subnet-mask%>$<%gateway%>$<%dns-server%>$<%hostname%>
-
ip-address
: IP address to set (dot notation) -
subnet-mask
: Subnet mask to set (dot notation) -
gateway
: Default gateway to set (dot notation) -
dns-server
: DNS server to set (dot notation) -
hostname
: Hostname of the device (optional)
Response
None.
SET-DATE
Sets the date and time of the target if possible (only supported for targets running real-time OS)
Request
SET-DATE$<%datetime%>
-
datetime
: Datetime string formatted as%<%Y-%m-%d %H:%M:%S>T
Response
None.
SET-STARTUP
Enables / disables the startup application if possible (only supported for targets running real-time OS)
Request
SET-STARTUP$<%boolean%>
-
boolean
: String (True
for true, anything else for false)
Response
None.
IDENTIFY
Lets the LEDs of the device show a blink pattern (only supported for devices with LEDs)
Request
IDENTIFY
Response
None.
EXECUTE
Executes an APPic command
Request
EXECUTE$<%kernel%>$<%command%>$<%parameters%>
-
kernel
: Addressed Kernel -
command
: Command to execute -
parameters
: Call parameters
Response
None.
INFO
Requests information on the application running.
Request
INFO
Response
Sends information from the APP_SYSTEM global variable to the EVENT command of the caller's APPic UDP server.
Message is sent as NetDX UDP unicast (toLADR
,LPOR
).EVENT$INFO$<%name%>$<%ident%>$<%title%>$<%debug%>$<%timestamp%>
-
name
: Name of the application -
ident
: Identifier of the application -
title
: Title of the application -
debug
: Debug mode enabled (true) or disabled (false) -
timestamp
: Current date and time of the device formatted as<%Y-%m-%d %H:%M:%S>T
VERSION
Requests information on the version numbers, kernels and modules of application running.
Request
VERSION
Response
Sends version information to the EVENT command of the caller's APPic UDP server.
Message is sent as NetDX UDP unicast (toLADR
,LPOR
).EVENT$VERSION$<%app-version%>$<%appic-version%>$<%kernels%>$<%modules%>
-
app-version
: Version number (release) of the application -
appic-version
: Version number (release) of the APPic Framework used in the application -
kernels
: Spreadsheet string of all loaded kernels -
modules
: Spreadsheet string of all loaded modules
-