Promotic

PmFatek - Driver for communication with FATEK PLC devices

This driver serves for communication with FATEK PLC devices by the FACON protocol. See also Communication with PLC devices FATEK.

Before using this driver in the PROMOTIC application it is highly recommended to watch "PROMOTIC video tutorial 4 - Communication drivers".

Basic properties of the driver:
- Usage of this driver requires purchase of the PmFatek 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.
- The communication is done for Ethernet (PROMOTIC application is client) or for serial link (COM1, COM2 ...).
- The driver is incorporated into the PROMOTIC system by means of the PmaComm object.
The driver supports the usage of both PmaCommMsg and PmaCommGroup objects. For common case of the data transfer, it is better to use the PmaCommGroup object.
For easy integration of this driver into the application it is handy to use: Preconfigurations in group "Fatek - PLC device"
- The PROMOTIC application is the Master (it means that it initiates the data transfer) from this communication point of view.
- This is a network communication, it means that one PmaComm object can communicate with multiple devices (the protocol supports multiple device addressing).


The data areas in the PLC device that can be read/written::
data area indication of discrete inputs indication of 16-bit variables indication of 32-bit variables
X = Input discrete X0〜X9999 WX0〜WX9984 DWX0〜DWX9968
Y = Output relay Y0〜Y9999 WY0〜WY9984 DWY0〜DWY9968
M = Internal relay M0〜M9999 WM0〜WM9984 DWM0〜DWM9968
S = Step relay S0〜S9999 WS0〜WS9984 DWS0〜DWS9968
T = Timer discrete T0〜T9999 WT0〜WT9984 DWT0〜DWT9968
C = Counter discrete C0〜C9999 WC0〜WC9984 DWC0〜DWC9968
RT = Timer register - RT0〜RT9999 DRT0〜DRT9998
RC = Counter register - RC0〜RC9999 DRC0〜DRC9998
R = Data register - R0〜R65535 DR0〜DR65534
D = data register - D0〜D65535 DD0〜DD65534


Recommended values of the PmaComm object parameters:

Recommended values for the Serial link parameters:
Baud rate9600 Bd
Number data bits7
ParityEVEN or NO
Number of stop bits1
Description and recommended values for the Protocol parameters:
Response receipt timeoutOnly for serial link. The recommended value is for example 2000 ms. The time (in milliseconds) the driver is waiting for the response on sending the message.
If no response comes during this time, then the transmission of the message is terminated (the onEndOfTransfer event is triggered with error 24 or 66).

The communication description by means of the PmaCommGroup object

The PmaCommGroup objects can be used for this driver.
The variables in the PmaCommGroup object (or even better the variables in the PmaData object with ExtComm data extension) can be of arbitrary number, type and order. The driver uses optimalised internal communication messages for reading the data from the device.
All variables are read (if the "Data refresh enabled" configurator is checked). When writing into the variable, only the single variable is sent into the device (if the "Auto send when writing to item" configurator is checked).

Description of the "ItemId" configurator:
ItemId is the text identifier of the item that is used for addressing the item in the device. The "ItemId" configurator tells the driver how to receive or send the item value.
The text can be written manually, or it can be assembled in the window opened by the button to the right of the configurator.
Macro expression can be used for input (it is evaluated after the application is launched).
The identifier consists of mandatory and optional parts.
- The mandatory part is the "device" name (X,WX,DWX, .., C,WC,DWC, RT,DRT, .., D,DD) and numeric index.
- The optional parts are:
- The PLC device address at the beginning.
- The .S text can be entered at the end means that the variable (only for registers RT, RC, R, D) is a signed number.

Examples:
Slave5.DR100.S = It concerns the register R100 that is treated as 32-bit signed variable. The register is located in the PLC device with address 5.
DR100.S = Same as the previous example, but the address is detected from the "Default device address" configurator.
DR100 = Same as the previous example, but the value is unsigned.


Description of the "PmaCommGroup > Parameters > Special Parameters" configurator:
Default device addressThe address defined here can be used for definitions in the "ItemId" configurator in variables in this object (i.e. in variables on the "Data" tab or in data extension ExtComm). The address can be entered in ItemId:
- as for example Slave3.D6 - then the value will be read from the PLC device with address 3.
- or not defined, i.e. D6 - and the address is taken from this configurator.

This parameter can be modified and read in the script in runtime by methods: SetSpecParam("SlaveAddr") and GetSpecParam("SlaveAddr").

The communication description by means of the PmaCommMsg object

The PmaCommMsg object can be used for special communications, that cannot be executed by the PmaCommGroup object.

List and description of the communication messages:
 
40h - Read the brief system status of PLC: It reads 3 variables (Status0-2) of the Byte type. The values are 0=Enable, 1=Disable.
42h - Write single discrete status: Writes the value into one element in defined data location. The values are 1=Disable, 2=Enable, 3=Set, 4=Reset.
43h - Read multiple ENABLE/DISABLE status of discrete elements: Reads the defined number of elements starting from an address from the specified data area. The values are of the Boolean type, true=1=disable, false=0=enable.
44h - Read multiple status of consecutive discrete elements: Reads the defined number of elements starting from an address from the specified data area. The values are of the Boolean type.
45h - Write multiple status of consecutive discrete elements: Writes the defined number of elements starting from an address from the specified data area. The values are of the Boolean type.
46h - Read multiple consecutive registers data: Reads the defined number of elements starting from an address from the specified data area. The values are of the Long type.
47h - Write multiple consecutive registers data: Writes the defined number of elements starting from an address from the specified data area. The values are of the Long type.

History:
Pm8.02.00: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.