New Ltouch7 Plus

Coming soon a new black HMI touch screen panel with Android operating system with inputs and outputs on board.
16 digital inputs / outputs, 4 configurable analog inputs with 16bit resolution, 4 analog outputs 0..10V / 4..20mA.
Display HD 7 “capacitive resolution 1028×800 IP56.

Quad core A9 dinamyc frequency scaling from 400 to 1.4G Hz.

A new native library dedicated to manage the inputs and outputs.


In this lesson we show to finalize the graph we just made.

First of all with the “getData()” function, get all your data e put into one/or more variables, than add one/or more parameters for every day of the week you putted in:

	int[][] datas = getData();	 	// calls a user created function tha gets all the data from source
	int[] d= datas [0];
	yAx2.add(new Entry(d[0],0)); 		// it requires a new Entry, Entry requires a numeric value, and for 2th argument an Integer index
	yAx2.add(new Entry(d[1],1));
	yAx2.add(new Entry(d[2],2));
	yAx2.add(new Entry(d[3],3));
	yAx2.add(new Entry(d[4],4));
	yAx2.add(new Entry(d[5],5));
	yAx2.add(new Entry(d[6],6));

Than activate the zoom and scroll, you can even set move limits for its Axis and other stuff.

	lc.setVisibleXRangeMaximum(65f);					//Sets the max visible field on the x Axis
        lc.setVisibleYRangeMaximum(50, YAxis.AxisDependency.LEFT);		//Sets the max visible field on the y Axis
        lc.setTouchEnabled(true);						//Activates the touch Control
        lc.setDragEnabled(true);						//Enables dragging
        lc.getAxisLeft().setAxisMinValue(0);					//Set minimum axis Zoom level
        lc.getAxisLeft().setAxisMaxValue(50);					//Set maximum axis Zoom level
        lc.setScaleMinima(0, 1);						//Set the graph total scale, from min to max

And… we have so easely made our graph!


In this example we are going to show you how to create a Graph with Android studio on our PlTouch devices. To make the graph, we need to use an external library called MpAndroidChart, that you can find here, otherwise without downloading it, you can include into the grade build file in the next stage.

This Article divides into 3 posts, Initiation, Data Setup, Finalization.

Fist of all, open one of your projects or create a new one, keeping in mind that you can put the graph itself on a specific Activity or you can directly call it under Main Activity.

If you want to import the Library by downloading it, and you don’t know how to import it in Android Studio, here’s a tutorial that fits your need, otherwise,

just follow the build gradle procedure:

Go to your file and paste in the following lines of code, be aware to put those outside application.

repositories {
 maven { url '' }

dependencies {
 compile fileTree(include: ['*.jar'], dir: 'libs')
 androidTestCompile('', {
 exclude group: '', module: 'support-annotations'
 compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
 compile ''
 compile ''
 compile ''
 testCompile 'junit:junit:4.12'


Fine, now the libray that will allow you to make the graph, has included into the project!
In the next post we are going to see how to initiate every Component correctly, stay tuned.


First thing, we need to put the graph into the layou.xml file, to do this, search in the layout designer the lineChart tag, and put it in, or just type it by hand into the xml file.

At this point we need to declare some variables, that will allow us to communicate with other inner elements of Plugin/Library:

    LineChart lc; 				//lineChart Main Component
    ArrayList<String> xAx2;			//xAxis titles Array
    ArrayList<Entry> yAx2;			//yAx entry Array (Values associated with an index)
    ArrayList<ILineDataSet> dss;		//multidimensional Array containing the whole DataSet
    LineDataSet lds;			//the DataSet Component

Than we are going to Initiate every component, in your Activity on the onCreate method:

    lc = (LineChart) findViewById(;		//xml layout Id Reference
    dss = new ArrayList<>();				//Initiate the DataSet Component as an empty Array
    xAx2 = new ArrayList<>();				//Initiate xAxis titles as an empty Array
    yAx2 = new ArrayList<>();				//Initiate yAxis values as an empty Array

After that, we need need to put our data unto the graph, to do this, first of all, we decide how to save the datas that are going to be put to the graph.
- WITH TEXT FILES Go to Tutorial

After created our Data Save System, and after instatiation, and after you have check some statement on your code, create a function to load the saved data, and in this example
we call that function “getData()”

Add to the ArrayList every day of the week, this data are going to be put to the graph like titles.

        xAx2.add("LUNEDI");		//It only adds a string parameter to the xAxis of the Graph as a Title

In the next post we are going to see how put some values to the graph, and complete the configuration, stay tuned.

Add a custom Library, on Android Studio

In this example we are going to show you, how to import a Custom Library on Android Studio.

First of all, open one of you projects or create a new one.

Click on the DropDown menu that you find on the left-top corner of the screen, under the File Menu, scroll options until you find the word Project and click it.

Copy your Library with a Jar format in the Lib folder, that you can find at ProjectName/App/Lib

If you have .so files associated to the Library, you have to copy those under the JniLib folder, if it doesn’t exist you have to create it, precisely on the path ProjectName/App/Src/Main


Select the Librart that you just imported on the Lib folder by left clicking and click on “Add as Library!”


so the import, has just been completed.

Delayed timer at Insertion – ANDROID TIMER

In the industrial World, and in domotics one of the needs that you can find, is how to generate an Event after sometime Interval that you fixed .
In this simple blog we want show you, in a few simple rows of code, a Timer delayed in this insertion using Android Timers and in detail, Executors.

We are using in this case out pLtouch 101g, so you can make your idea real.
Suppose we want to activate a Relè exit after some time T from the presence of a digital input.

All that we need is a method name ScheduledExecutorService; please read this Executors tutorial

int TimeValue = 5; / 5 second of delay for active output
if (pManager.digitalRead(0) == DigitalValues.HIGH) { // if input is HIGH
ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(5);

ScheduledFuture scheduledFuture = scheduledExecutorService.schedule(new Callable() {
	public Object call() throws Exception {
	     pManager.digitalWrite(1,DigitalValues.HIGH); //delay Time TimeValue and active output
	     return "Called!";
	TimeValue,TimeUnit.SECONDS); // TimeValue is time of delay - TimeUnit.SECONDS is time scale Second

	} else{
	   pManager.digitalWrite(1,DigitalValues.LOW); // if input is LOW then switch off output


In our case using the pLtouch 101g we are using the library for the acquisition of digital inputs, e when something present on input the Timer counts 5 seconds(TimeValue)
after that i activates the first Relè exit
When the Input stops coming, i set the Output to zero