Publish data to WebSocket server in JSON format
Simulink Support Package for Raspberry Pi Hardware / Network
If the WebSocket server is hosted on a network IP address, any device on the network can connect to the sever and access the data.
This figure shows the signals in JSON format with a unique block label.
Signal— Input data to be published
The signal data to be published to the WebSocket server, specified as a row vector.
The block provides an option to add up to 10 Signal input ports that you can use to obtain signal data, with each signal being a row vector.
Block label— Unique label to identify published JSON data
Specify a unique label for the block to identify the published JSON data (which gets created from the input signal data). The label can have a maximum of 128 characters.
Server IP address— IP address of WebSocket server
127.0.0.1(default) | any IP address
IP address of the WebSocket server on which the JSON data is hosted.
Server Port— Port number on WebSocket server
9000(default) | any port number
Port number on the WebSocket server on which the JSON data is hosted.
You can use multiple Websocket Publish blocks in a Simulink model if the Server IP address and Server Port parameters are unique.
Number of inputs— Total number of input signal connections
Total number of input signal connections to the block, which is then converted to JSON format.