The PROMOTIC system accesses the
AtouchX driver by the
PmaActiveX object. This object accesses calling the methods of the
AtouchX object and captures its events.
The
AtouchX object is available on the
https://amitomation.cz, where
free download is possible.
The following text describes the setting and basic steps for successfull communication by means of the
AtouchX object in the PROMOTIC system. (Czechia,
https://amitomation.cz).
Installation and settings of the AtouchX object
The complex information to the
AtouchX driver is provided by the
AMiT company.
The driver is available only in 32-bit version. Since version
293 the
"NetPutData" method does not request usage of specific data type of the sent values. This makes it easier to communicate in the
JavaScript language.
In order to communicate it is necessary to have the
AtouchX object installed in your computer. It is available for free download on the Web of the device manufacturer. Follow the instructions of the installation program.
For those PLC devices that will communicate with by the PROMOTIC application, the programmer of the AMiT devices must create configuration files. The default names of such configuration files are
sDBfile.ini,
sHWfile.iniand for archives
sArchFile.ini.
These contain:
sDBfile.ini: list of devices together with connection parameters
sHWfile.ini: list of variables, the WID number, type, corresponding station numbers and variable description
sArchFile.ini: archive data reading parameters (only if archive data reading is required).
Configuration of the communication in the PROMOTIC system
The configuration files for the
AtouchX object must be in the
Cfg folder of the PROMOTIC application
In the PROMOTIC application object tree create:
The preconfiguration contains only some of the most commonly used methods of the
AtouchX object for read and write the variables in the PLC device and two methods providing information regarding the setup and configuration.
The communication interface consists of designer's methods of the
PmaFolder object.
There are both initialization and communication methods. Their names and parameters correspond with the methods and parameters in the
AtouchX object.
On the "
ActiveX events" tab of the
PmaActiveX object there are events (paired with called method names), that can be used for processing the received data from the communication.
Examples calling the methods and processing
Example NetDetData, NetDetDataMtx:
Calling the "NetDetData" method for reading value of a single variable or the "NetDetDataMtx" method for reading data matrix
JavaScriptVBScriptSelect and copy to clipboard
var nErr = pMe.Pm("/AmitAtouchX").NetGetData(2314, 100);
// WID, params
// or
var nErr = pMe.Pm("/AmitAtouchX").NetGetDataMtx(1810, 2, 3, 6, 12, 100);
// WID, Row, Col, Rows, Cols, params
Dim nErr
nErr = pMe.Pm("/AmitAtouchX").NetGetData(2314, 100)
' WID, params
' or
Dim nErr
nErr = pMe.Pm("/AmitAtouchX").NetGetDataMtx(1810, 2, 3, 6, 12, 100)
' WID, Row, Col, Rows, Cols, params
Example of data processing in the
EndNetDetDataMtx event of the
PmaActiveX object
JavaScriptVBScriptSelect and copy to clipboard
var val0, val1;
if (Result >= 1024)
{
switch (WID)
{
case 2314:
pMe.Pm("/Data/#vars/d2314") = DATA;
break;
case 1810:
val0 = DATA.GetItem(0, 0);
val1 = DATA.GetItem(0, 1);
break;
}
}
Dim val0, val1
If Result >= 1024 Then
Select Case WID
Case 2314
pMe.Pm("/Data/#vars/d2314") = DATA
Case 1810
val0 = DATA(0, 0)
val1 = DATA(0, 1)
End Select
End If
Example DBGetInfo:
Calling the "DBGetInfo" method for reading information regarding the variable
JavaScriptVBScriptSelect and copy to clipboard
var nErr = pMe.Pm("/AmitAtouchX").DBGetInfo(2314);
// WID
Dim nErr
nErr = pMe.Pm("/AmitAtouchX").DBGetInfo(2314)
' WID
Example of calling the
"DBGetInfo" method and processing of input/output values of the
Array type of the
PmaActiveX object
JavaScriptVBScriptSelect and copy to clipboard
var oApp = pMe.Pm("../AtouchApp").Acx;
var mInfo = Pm.CreatePmMap();
mInfo.ParValue = Pm.CreatePmArray(1, 5);
var nState = Pm.CallAxMethod("", oApp, "DBGetInfo", nWID, mInfo);
Pm.Debug("return INFO: " + mInfo.ParValue);
Dim oApp
oApp = pMe.Pm("../AtouchApp").Acx
Dim INFO
INFO = Pm.Array1(5)
Dim nState
nState = oApp.DBGetInfo(nWID, INFO)
Trade terms:
The usage of the
PmaActiveX object requires purchase of the
"PmDllActiveX" licence. When developing the application in the freeware mode
PmFree, or with
development environment and while testing it in runtime, this component is always functional.