This driver serves for communication with
Allen Bradley PLC devices by the
Rockwell Automation company by the
EtherNetIP/CIP protocol. See also
Communication with Allen Bradley PLC devices by the Rockwell Automation company.
The
CIP protocol (
Common Industrial Protocol) is a network protocol that allows to transmit values of data objects. Contrary to other protocols, that are usually oriented to support registers, inputs, outputs, etc., the
CIP protocol is oriented to support data objects. The data object is representing an user-defined data variable, array, structure, etc. that describes some part of the technology and its instances are located in the PLC memory.
The
CIP protocol can be implemented on different physical layers (
Ethernet,
CAN/DeviceNet,
FieldBus/ControlNet). The
EtherNet/IP protocol implements (encapsulates) the
CIP protocol for
Ethernet. The
PmABradleyCIP driver implements the
CIP protocol into the
EtherNet/IP protocol.
The PLC devices that are based on data areas (
DataFile, for example the
Input,
Output,
Integer type ...) cannot communicate by the
CIP protocol (e.g. PLC
MicroLogix). For such devices the
PmABradleyDF1 communication driver is designed.
The
EtherNetIP/CIP protocol is supported by following families of
Allen Bradley PLC devices by the
Rockwell Automation company:
- ControlLogix
- CompactLogix
- SoftLogix
- DriveLogix
- GuardLogix
- Micro850, Micro870
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 communication is done for Ethernet (PROMOTIC application is client).
- The PROMOTIC application is the Master (it means that it initiates the data transfer) from this communication point of view.
- The driver is incorporated into the PROMOTIC system by means of the
PmaComm object.
The driver supports to usage of the
PmaCommGroup object (for read and write of variables in the PLC device). The
PmaCommMsg object is used only for special auxiliary message that detects the variable names that can be read from the PLC device (see further).
For easy integration of this driver into the application it is handy to use:
Preconfigurations in group "Allen Bradley"
- The driver has been tested with PAC Allen-Bradley CompactLogix of the 5000 series with the 20 firmware. The driver may malfunction with devices using older versions of the firmware.
- While programming the PLC two types of variables can be used:
- Global variables (Controller Tags)
- Variables for specific program in the PLC device (Program Tags)
This communication driver can work only with
Controller Tags (so far).
The driver supports the following data types:
-
BOOL: In the PLC device: represented by 1 bit.
In the PROMOTIC application represented by the
Boolean data type.
-
SINT: In the PLC device: 8-bit signed integer.
In the PROMOTIC application represented by the
Integer data type.
-
INT: In the PLC device: 16-bit signed integer.
In the PROMOTIC application represented by the
Integer data type.
-
DINT: In the PLC device: 32-bit signed integer.
In the PROMOTIC application represented by the
Long data type.
-
LINT: In the PLC device: 64-bit signed integer.
In the PROMOTIC application represented by the
Double data type.
-
REAL: In the PLC device: 32-bit real number (
float).
In the PROMOTIC application represented by the
Single data type.
-
DWORD: In the PLC device: 32-bit array of bits (usually a host area for variables of the
BOOL type).
In the PROMOTIC application represented by the
Long data type.
-
$STRING:
In the PLC device: a structure containing the length (
DINT type) and a character array (
SINT type). Represents text.
In the PROMOTIC application represented by the
String data type.
The variables (so-called tags) are created during the PLC programming. The creation of variables means defining their data type, array dimensions and definig the items of the structure, naming the variable and naming the structure. The designer of the PROMOTIC application then works with the previously defined names. The variable names are usually called symbols (in this protocol) and the data structures are called templates. Either the templates can be user-defined, or can be taken from the libraries of the PLC programming tools that support the
CIP protocol.
Recommended values of the PmaComm object parameters:
Description and recommended values for the Protocol parameters:
PLC type |
0 = Control/Compact/..Logix - There will be communication with PLCs of the ControlLogix, CompactLogix or other ..Logix types.
1 = Micro850/870 firmware21- - The communication with PLC devices of the Micro850 or Micro870 types with outdated firmware 21.
This firmware does not allow receiving multiple variables at once (MultiRead) and therefore each variable must be transmitted in a separate message (SingleRead).
2 = Micro850/870 firmware22+ - Same as type 1 but with newer firmware 22 and above.
Allows reading multiple variables in one message ( MultiRead). |
Port number in the PLC device | 1 (set the linkup to documentation).
This configurator is not for PLC of the Micro850/870 type. |
Slot number in the PLC device | 0, position number in rack (set the linkup to documentation).
This configurator is not for PLC of the Micro850/870 type. |
Ticks priority | 5 (set the linkup to documentation) |
Number of ticks to timeout | 247 (set the linkup to documentation) |
---|
The communication description by means of the PmaCommGroup 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 optimized internal communication messages for reading the data from the device.
Caution: If the variables containing values of the
String type are transmitted, then
the driver cannot determine the maximum number of such values that can be transferred in one message. Then it is necessary to limit the number of variables in one
PmaCommGroup object.
All variables are read (if the "
Data refresh enabled" configurator is checked). On writing into the variable, only the single variable is sent into the device (if the "
Auto send on 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 either 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).
Entering the
ItemId by the button to the right of the configurator is possible only if the file with PLC variables description already exists. This file can be created by the
PmaCommMsg message (
"Reading names of all available variables from the PLC device") - see further.
The period (.) separator is used between the structure name and structure item.
The array index (zero-based index) is written inside the square brackets ([ ]).
No additional spaces are allowed.
Examples of the identifier syntax:
1) In the PLC device, there is an elementary item (e.g. of the
INT type) named "
Temperature". If we want to read/write this item, then the
ItemId will be:
Temperature
2) In the PLC device, there is a structure named "
station" and inside it there is an array named "
data". If we want to read/write the 23rd item of this array, then the
ItemId will be:
station.data[23]
3) In the PLC device, there is a
"heating" structure, containing
"Boiler" array. Each item of this array is a structure containing
"Temperature" item. We want to read/write from/into the 0. (i.e. the first position) item of the array:
heating.Boiler[0].Temperature
4) In the PLC device, there is a 3-dimensional array named "
warehouse" and we want to read/write the value on the coordinate of [12,11,5]:
warehouse[12][11][5]
5)
Reading and writing a string: In the PLC device, there is a structure named "
label" containing an item of the
DINT type (text length) and an array of characters of the
SINT type.
This structure may represent text and if we want to read/write such text, then the
ItemId must be:
label,type=STRING
This configurator is not used for given driver.
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.
For this driver, there is only a singe special message implemented:
-
Reading names of all available variables from the PLC device:
In order to set the "
ItemId" configurator correctly in variables of the
PmaCommGroup object it is necessary to know the names of user-defined variables, items and structures or array dimensions in the PLC device. This informaton can be read from the PLC device and this is exactly the sole purpose of this message:
The message reads the information and saves it into a text string on the "
Data-received" tab. If the text is saved into the file (default named
"ABradleyVarCfg.txt"), then the button on the right side in the
ItemId configurator can be used that reads the corresponding file and displays it in the form of a tree structure. The specific data items can be selected from this tree structure.
In order to create and configure the
PmaCommMsg object correctly it is handy to use the preconfiguration:
Preconfiguration "PmABradleyCIP - Communication set with data and panel by the EtherNetIP/CIP protocol (for ControlLogix, CompactLogix, ...)". If you check the "
Create PmaCommMsg for reading the variables from the PLC device" configurator in this preconfiguration, then the correctly configured
PmaCommMsg object is created together with a panel that can run the message and read the desired information from the PLC device. In the
onEndOfTransfer event of this object, there is a script that saves the received text information into the file
"ABradleyVarCfg.txt".
There are following variables on the "
Data-received" tab:
InfoVars - This variable is used for saving text information regarding available variables in the PLC device.