IO-Link master with EtherCAT interface DataLine 4 ports IP 65 / IP 66 / IP 67
60
>
9.2.21
Subscribing to notifications
61159
If a data point has the sub-element
datachanged
, the user can subscribe to notifications on value and
condition changes. Notifications can be triggered by the expiration of a timer or an event. The IoT Core
supports the output of notifications in CSV or JSON format.
Available data points:
Name
Description
Access
timer[x]/counter
Timer for triggering a notification
rw
timer[x]/interval
Cycle time of the update of the subscribed values
rw
iolinkmaster/port[n]/portevent
Display of the following events on IO-Link port n:
▪
IO-Link device connected
▪
IO-Link device disconnected
▪
Operating mode of the IO-Link port changed
rw
iolinkmaster/port[n]/iolinkdevice/iolinkevent
Display of IO-Link events
rw
r ... read only
rw ... read and write
x = [1,2]
n = 1...4
Applicable services:
Name
Description
../datachanged/subscribe
Subsrscibe to notification
../datachanged/unsubsribe
Unsubscribe notification
../datachanged/getsubscriptioninfo
Show information about notifications
Additionally, the user can use
Service: getsubscriberlist
(
) show all active subscriptions.
>
Example: Subscribing to notifications
61160
Task
: The current values of the following parameters are to be sent regularly to a network server with
IP address 192.168.0.4:
•
cyclic input data of the IO-Link Devices an IO-Link port X02
•
Operating temperature of the IO-Link master.
Solution:
Subscribe to the required data using the subscribe service.
The following options are additionally available:
•
via WebSockets (ws://):
Example: Subscribing notifications via WebSocket
(
•
via MQTT (mqtt://):
Example: Configuring the MQTT command channel
(
•
Request:
{
"code":"request",
"cid":4711,
"adr":"/timer[1]/counter/datachanged/subscribe",
"data":
{