Example: Sensor App for Android
Product: Link to CODESYS Sensor App for Android
The sample project shows how to send sensor data from an Android smartphone to a CODESYS controller.
Installation
Installation of the Android app
The Android app CODESYS Sensor App can be installed only from the Google Play Store.
Search for "CODESYS Sensor App" in the Google Play Store and install the application on your Android device.
Installation of the CODESYS package
Install the CODESYS Sensor App for Android Example package via the CODESYS Installer. Use the download link at the bottom of this page.
Configuration
The Android app uses network variables to send the sensor data of the Android device to the CODESYS controller via UDP on ports 1202 and 1059. The Android device (for example, smartphone or tablet) and the CODESYS controller must be located in the same local network. The easiest way to achieve this is by using the Wi-Fi hotspot of the Android device.
Set up a Wi-Fi hotspot on the Android device.
(for example, via Settings → Hotspot and tethering → WLAN hotspot)
Connect the CODESYS controller to the Wi-Fi hotspot and find the IP address of the controller for the Wi-Fi adapter (for example, using the
ipconfigcommand).
Open the CODESYS sample project
AndroidSensorApp.project.Start the
SensorReceiverapplication on the controller.
Start the "CODESYS Sensor App".
In the Target IP address field, specify the IP address of the CODESYS controller.
Switch the Send sensor data to control setting to ON.
The current sensor data is now being send to the controller and displayed in the visualization.
Important
If the CODESYS application is not receiving any data, then check the port forwarding settings in your network and firewall.
Functional scope
Target IP address: Setting of the IP address of the CODESYS controller
Send sensor data to control: Sends the sensor data to the specified IP address
Messages: Status messages for the CODESYS app
Start Speech Recognition: Starts the automatic word recognition by Google
(Only when connected to the Internet)
Recognized Words: List of recognized words
AndroidSensorApp.projectThe received sensor data is displayed in the visualization of the
SensorReceiverapplication. The words recognized by the speech recognition are stored in the stringstrCommandThe network variable NVL is stored.

Screenshot: CODESYS Sensor App for Android on the Android device

Screenshot: Display of sensor data in the CODESYS Development System (AndroidSensorApp.project)
System requirements and restrictions
Programming system | CODESYS Development System (version 3.5.17.0 or higher) |
Runtime system | CODESYS Control Win (version 3.5.17.0) TipUse the free Device Reader project (available in the CODESYS Store International) to find out the functions supported by the controller. |
Add-on components |
|
Additional requirements |
|
Note
DOWNLOAD Project