Industrial
Electronic Devices
ADFweb.com S.r.l.
User Manual
Serial / MQTT
Document code: MN67932_ENG Revision 1.000 Page 27 of 32
TEMPLATE STRING: ETHERNET AND MQTT PAYLOAD
In the section “MQTT Set Topic” of the SW67932, it is possible to define the expected format of the Ethernet message received/transmitted.
This feature allows to define a fixed part of the Ethernet message and some parts to map from/to MQTT side. The parts to link to MQTT side
is made using keywords, defined between ‘$’ chars.
Example
From Serial side, the serial device sends a message with this ASCII format:
“ID=xxxx, Register=xxxx, Desc=xxxxx, Data=xxxxx”
Where ‘xxx’ parts are variable parts of the message.
On MQTT side, we want to receive just the variable parts, discharging the fixed parts that are not necessary. In this case, the “Input
Template” will be defined in this way:
“ID=$ID$, Register=$REG$, Desc=$DESC$, Data=$DATA$”
Supposing that the real string from the Serial message is:
“ID=0001, Register=0100, Desc=Temp1, Data=02345”
We wil have:
$ID$ = 0001
$REG$ = 0100
$DESC$ = Temp1
$DATA$ = 02345