This driver serves for communication with
Allen Bradley PLC devices by the
Rockwell Automation company by the
DF1 protocol. See also
Communication with Allen Bradley PLC devices by the Rockwell Automation company.
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
PmABradley 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 protocol offers 3 types of the communication:
- via the computer's serial port (
COM1, COM2 ...): The communication over the
DF1 protocol can proceed in the
Full-duplex mode (default,
RS232) or the
Half-duplex mode (
RS422/RS485). The mode can be set in the PROMOTIC system in the protocol parameters in the "
Link Protocol" configurator. The
Full-duplex mode is used for connection of the point-to-point type (i.e. one PC-
Master and one device-
Slave). The
Half-duplex mode is used for the special connection of more
Slave device stations to one PC.
- via Ethernet emulated serial link: This option can be selected, for example, if the device is equipped with the serial link and it is connected to the Ethernet through the RS232/Ethernet converter. If the converter does no modifications to the transmitted data, then it is a very easy way how to communicate via Ethernet with the device not equipped with Ethernet interface.
- via Ethernet with DF1 protocol encapsulated into EtherNet/IP protocol: this option is suitable for example for PLC devices MicroLogix with Ethernet connection.
- The PROMOTIC application is the Master (it means that it initiates the data transfer) from this communication point of view.
Data types:
The driver supports the following data types:
-
Int = Integer signed:
2-byte integer (from
-32 768 to
+32 767).
In the PROMOTIC application represented by the
Integer data type.
-
Word = Integer unsigned:
2-byte integer (from
0 to
65 535).
In the PROMOTIC application represented by the
Long data type.
-
Float:
4-byte real number.
In the PROMOTIC application represented by the
Single data type.
-
Long:
4-byte integer.
In the PROMOTIC application represented by the
Long data type.
Only for
L - Long data area.
-
bit:
One bit. Only for the
PmaCommGroup object.
In the PROMOTIC application represented by the
Boolean data type.
-
Byte: 1-byte integer (from
0 to
255). Only for the
PmaCommMsg object.
In the PROMOTIC application represented by the
Byte data type.
Types of data areas (DataFile):
The driver supports the following
DataFile types.
DataFile with number higher than 8 must be "programme allocated" before use.
-
O - Output:
Output file. There is only one such area in the PLC device and is always numbered
0.
-
I - Input:
Input file. There is only one such area in the PLC device and is always numbered
1.
-
S - Status:
Status values file. There is only one such area in the PLC device and is always numbered
2.
-
B - Binary:
Binary values file. There can be multiple areas of this type in the PLC device and the first is always numbered
3.
-
T - Timer: Timers file. There can be multiple areas of this type in the PLC device and the first is always numbered
4. This type currently is not functional for the
PmaCommGroup object.
-
C - Counter: Counters file. There can be multiple areas of this type in the PLC device and the first is always numbered
5. This type currently is not functional for the
PmaCommGroup object.
-
R - Control: Control values file. There can be multiple areas of this type in the PLC device and the first is always numbered
6. This type currently is not functional for the
PmaCommGroup object.
-
N - Integer:
Integers file (2-byte integer). There can be multiple areas of this type in the PLC device and the first is always numbered
7.
-
F - Float:
Real number values file. There can be multiple areas of this type in the PLC device and the first is always numbered
8. The PLC devices of the lower series (
Micrologix1000) do not support real numbers, but for example the
Micrologix1100 can use the real numbers.
-
L - Long:
Integers file (4-byte integer).
Recommended values of the PmaComm object parameters:
Number data bits | 8 |
Parity | NO |
Number of stop bits | 1 |
---|
TCP/UDP remote port number | 44818 (for "Encapsulating into EtherNet/IP")
See: Wikipedia: A list of TCP and UDP port numbers used by protocols to run network applications. |
Ethernet transfer type | TCP (for "Encapsulating into EtherNet/IP") |
Not connect until first transfer | NOT checked (mandatory) - Only for "Encapsulating into EtherNet/IP" |
Close connection after every transfer | NOT checked (mandatory). After each connection, it is necessary to transfer several initialization messages and if the connection is closed repeatedly, the communication speed would be decreased significantly. - Only for "Encapsulating into EtherNet/IP" |
---|
Description and recommended values for the Protocol parameters:
Response receipt timeout | Only for serial link.
The default value is 1000 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). |
Protocol data type | Only for Ethernet. Specifies the protocol data form. It is possible to choose:
The same data as for serial link - This option can be selected, for example, if the device is equipped with the serial link and it is connected to the Ethernet through the RS232/Ethernet converter. If the converter does no modifications to the transmitted data, then it is a very easy way how to communicate via Ethernet with the device not equipped with Ethernet interface.
Encapsulating into EtherNet/IP - this option is suitable for example for PLC devices MicroLogix with Ethernet connection. |
Master address (SRC) | Number of the PROMOTIC station (for example 0). |
Check sum type |
BCC
CRC |
Link Protocol | Specifies the transfer mode
Full-duplex - (default)
Half-duplex |
Addressing type | Specifies whether to communicate directly with PLC devices or via bridge. Only for "Encapsulating into EtherNet/IP".
Direct device address - Communication directly with the PLC.
Remote roating - Communication via bridge. |
Port number in the PLC device | Only for "Encapsulating into EtherNet/IP".
The default value is 1. |
Slot number in the PLC device | Only for "Encapsulating into EtherNet/IP".
The default value is 0. |
Class | Only for "Encapsulating into EtherNet/IP" and "Addressing type = Remote roating". |
Instance (Channel) | Only for "Encapsulating into EtherNet/IP" and "Addressing type = Remote roating". |
Connection point | Only for "Encapsulating into EtherNet/IP" and "Addressing type = Remote roating". |
priority/time tick (PLC) | Only for "Encapsulating into EtherNet/IP".
The default value is 5. |
Number of time-out ticks (PLC) | Only for "Encapsulating into EtherNet/IP".
The default value is 247. |
---|
The communication description by means of the PmaCommGroup object
The
PmaCommGroup objects can be used for this driver. For usual data transmissions it is more favourable than using the
PmaCommMsg object.
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).
Examples of the identifier syntax:
ItemId |
Description |
"O:4:Word" |
O=DataFile type=Output, 4=Physical value address in DataFile, DataFile number is not entered because it is always 0., The value je of the following type: Word = Integer unsigned |
"I:1/2" |
I=DataFile type=Input, 1=Physical value address in DataFile, DataFile number is not entered because it is always 1., The second bit is read from this value. Cannot write. |
"I:1/2w" |
The same as previous, but the bit can also be written. |
"S:1/2" |
S=DataFile type=Status, 1=Physical value address in DataFile, DataFile number is not entered because it is always 2., The second bit is read from this value. Cannot write. |
"S:1/2w" |
The same as previous, but the bit can also be written. |
"B3:2:Word" |
B=DataFile type=Binary, 3=DataFile number, 2=Physical value address in DataFile, The value je of the following type: Word = Integer unsigned |
"N7:0" |
N=DataFile type=Integer, 7=DataFile number, 0=Physical value address in DataFile. The value je of the following type: Int = Integer signed |
"N7:0:Word" |
The same as previous, but the value je of the Word = Integer unsigned data type. |
"N7:0/1" |
The same as previous, but only the first bit is read from the value. Cannot write. |
"N7:0/1w" |
The same as previous, but the bit can also be written. |
"F8:5" |
F=DataFile type=Float, 8=DataFile number, 5=Physical value address in DataFile. The value je of the following type: Float |
"L102:1" |
L=DataFile type=Long, 102=DataFile number, 1=Physical value address in DataFile. The value je of the following type: Long |
Device address | The device address to communicate with.
The device is often preset to address 0. |
Max. data size (in bytes) in one message | The maximum length limitation of a communication message is entered here.
- 82 Bytes (default) for SLC 5/01 or SLC 5/02.
- 234 Bytes for SLC 5/03 or SLC 5/04. |
---|
The communication description by means of the PmaCommMsg object
List and description of the communication messages:
-
Protected Typed Logical Read:
Reading the data by the logical address.
The size of the data shouldn't exceed 230 bytes.
(This reading is executed by communication command, where
CMD=0F and
FNC=A2.)
There are following variables on the "
Data-sent" tab:
- "PlcAddr": The device address to communicate with.
The device is often preset to address 0.
-
"FN" (
DataFile number): Specifies the area to read from. It can be a value from 0 to 254. The first nine values are always a preset (see
Types of data areas (DataFile)).
- "EN" (Element number): Item index for reading in the DataFile. It can be a value from 0 to 254.
- "SEN" (Subelement number): Must be defined only if the item was not defined by the "Element number" (e.g. the area of binary file). Otherwise we recommend not to enter any "Sub-Element number" value, or enter 0. It can be a value from 0 to 254.
- Protected Typed Logical Write: Data writing by the logical address. The size of the written data shouldn't exceed 230 bytes.
(This writing is executed by communication command, where CMD=0F and FNC=AA.)
The meaning of the "FN", "EN", "SEN" is explained in the description of the message "Protected Typed Logical Read".
- Diagnostic Counters Reset: Setting all counters and timers to 0.
- Diagnostic Loop: It is used for testing the communication. The match of the Test string qualifies the right result in sending and receiving. It writes the string of exactly 10 characters Into the Test string variable.
- Set ENQs: Sets the maximum number of ENQ. It is not supported by PLC devices of the SLC 500 series.
- Set NAKs: Sets the maximum number of NAK. It is not supported by PLC devices of the SLC 500 series.
- Set Timeout: Sets the timeout. It is not supported by PLC devices of the SLC 500 series.
- Set Variables: Sets the maximum number of ENQ, the maximum number of NAK and the timeout. It is not supported by PLC devices of the SLC 500 series.