How to use Relay on Ltouch43

In our Ltouch43 Android HMI  there are 4 Relays and all the relays are in exchange contact. They have 24Vdc coil and max 5A contact current. All RELAY outputs are high quality relay and protected by varistors, all connectors are removable.

BMTouchGP12 – Relay R2

BMTouchGP13 – Relay R4

BMTouchGP14 – Relay R1

BMTouchGP15 – Relay R3

Before using them we must in the onCreate method :

instantiate the library BMtouch::

  • tmp = BMTouch.LIBsetup(BMTouch.EN12 + BMTouch.EN13 + BMTouch.EN14 + BMTouch.EN15);

Set PIN (GP–) as output, sets the pin (pin) indicated as output and sets its logical level as value::

    • val[0]= 0;
    • BMTouch.GPIOSetupOut(BMTouch.GP12, val[0]);
    • BMTouch.GPIOSetupOut(BMTouch.GP13, val[0]);
    • BMTouch.GPIOSetupOut(BMTouch.GP14, val[0]);
    • BMTouch.GPIOSetupOut(BMTouch.GP15, val[0]);

To switch the output by activating it or not, use this command::

    • tmp=BMTouch.GPIOWrite(BMTouch.GP13, val[0]);

where val [0] corresponds to:

  • 0 relay OFF
  • 1 relay ON

Websoket with server inside Android HMI Ltouch

In 2018 eight out of ten people have a smartphone, so it is a great achievement to share data acquired by our Android HMI Ltouch
(such as the measure of a temperature) over a wireless network and look at it with a web browser.

Let’s see how using an Ltouch 7, there are only 2 steps:

Step 1
Install an http server to provide the webpage with measures; in our tests we used Http Server by Tautvydas Andrikys, it is very interesting
because it can support php after the installation of Server for PHP by the same author. Once installed these apks, tap “server address and port” to set
an http port ,default is 8000, you can change but do not use privileged ports (ports below 1024 , see for example ), then choose ip address 0.0.0.0 to answer on each ip assigned to the Ltouch.

Enable php support:

CGI setting -> enable com.esminis.server.php (Server for PHP)

Finally enable start on boot.

Copy webpage index2.html to /mnt/sdcard/htdocs/public :
adb push index2.html /mnt/sdcard/htdocs/public
Copy configuration files for php server php.ini to /mnt/sdcard/www/config :
adb push index2.html /mnt/sdcard/www/config
Copy configuration files for http server: certificate.cert / certificate.key / httpd.conf to: /mnt/sdcard/htdocs/config
adb push certificate.cert /mnt/sdcard/htdocs/config
adb push certificate.key /mnt/sdcard/htdocs/config
adb push http.conf /mnt/sdcard/htdocs/config

Reboot touch.

However you can use any http server.
Enable hotspot in the settings of Ltouch: settings -> more -> portable hotspot , here we can setup wifi parameters : network name and
password, then tap on portable hotspot to enable it

Step 2
install the apk available in the download area; it’s a simple app which uses modbus library by Biemme to read the measure of a temperature
provided by an external device and connected to the rs485 port of the touch

Now using your pc or smartphone, you can connect to the wifi network just created: open a browser and type http://192.168.43.1:8000/index2.html
in the address bar, note that you must use the port set in the http server in the address, we are using 8000, if you set another value use that
instead of 8000.

Moreover, the duo webpage/application allow us to handle input/output pins handled by Android kernel on the side of Ltouch, the ones provided
by expansion boards are handled with modbus calls and are excluded.

Source codes are available in our download area

Industrial Automation: An introduction to the Pltouch

Pltouch processors schemaHome and industrial automation projects employ a big set of products, such as sensors, touch screens, external modules, PLCs and HMIs in order to solve specific problems and dealing with special requirements. The current scenario shows that the logic and the user interface are frequently managed by different components, using a common bus in order to communicate and modify statuses. 

Based on this state of the art, our research and development lab, designed and created a brand new product with the aim of merging some of the products presented above, in order to reduce complexity, enhance user interface experience and especially reduce the costs.

Continue reading

Android Industrial: AC Drive over rs485

The following video represents an example of HMI in Industrial applications. In particular, in this project I used an Android multi touch that runs on Cortex A8 at 1Ghz and show how it can greatly control an AC drive. Specifically, I used a Allen-Bradley adjustable frequency AC drive.

The Android UI on the touch screen device allows to:

  • Start/Stop the motor
  • Set the direction (forward, backward)
  • Manage the output relay
  • Control the status of the digital inputs
  • See the parameters such as the current, frequency and output voltage
  • Set the motor frequency

You’ll find the source code and complete specifications of the project on my github channel. Don’t miss to check it out also our wiki section! As usual, comments are welcome 🙂