Personal tools

OpenPLC-on-SL-IoT-BOX-VisionSOM-6ULL

From SomLabs Wiki

Jump to: navigation, search

OpenPLC on SL-IoT-BOX with VisionSOM-6ULL


OpenPLC runtime

The default Debian system image for SL-IoT-BOX with VisionSOM-6ULL has OpenPLC runtime installed and enabled (https://autonomylogic.com/docs/openplc-overview/). After running the system, the OpenPLC webserver can be accessed using the network name or IP address with 8080 port:

The IP address can be checked after logging to the serial console as root (password: root) or as som (password: som) and calling ip a command.

The default webserver login credentials are:

  • username: openplc
  • password: openplc

Setting hardware

OpenPLC requires correct hardware driver to support hardware inputs and outputs. The driver for the SL-IoT-BOX is called SoMLabs IoT Box and should be selected in Hardware window. After clicking Save changes the driver will be compiled.

SL-IoT-BOX has six binary outputs and four binary inputs configured for OpenPLC programs. They are mapped as follows:

OpenPLC address GPIO Connector Function
%IX0.0 GPIO3_IO5 J6A_2 Digital input
%IX0.1 GPIO3_IO11 J6A_3 Digital input
%IX0.2 GPIO3_IO4 J6A_4 Digital input
%IX0.3 GPIO3_IO6 J6A_5 Digital input
%QX0.0 GPIO1_IO14 J5A_2 Digital output
%QX0.1 GPIO1_IO26 J5A_3 Digital output
%QX0.2 GPIO1_IO22 J5A_4 Digital output
%QX0.3 GPIO1_IO12 J5A_5 Digital output
%QX0.4 GPIO1_IO11 J2_4-6 Relay output
%QX0.5 GPIO1_IO15 J2_1-3 Relay output

Demo application

OpenPLC runtime executes programs built using OpenPLC IDE (https://autonomylogic.com/). The example project and pre-compiled program can be downloaded here: Openplc_6ull_demo.zip

This example uses all four binary inputs to control binary outputs and two relays as shown on the project scheme.

It can be uploaded to SL-IoT-BOX OpenPLC runtime in the Programs window:

After compilation the project can be run using the Start PLC button in Dashboard window

The program autostart after system boot can be enabled in the Settings window