Promotic

PmABradleyCIP - Driver for communication with Allen Bradley PLC devices by the EtherNetIP/CIP protocol

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 - PLC device"
- 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. 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:

Recommended values for the Ethernet-client parameters:
TCP/UDP remote port number44818
 
See: Wikipedia: A list of TCP and UDP port numbers used by protocols to run network applications.
Ethernet transfer typeTCP
Not connect until first transferNOT checked (mandatory)
Close connection after every transferNOT 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.
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 - There will be communication with PLC devices of the Micro850 or Micro870 types.
Port number in the PLC device1 (set the linkup to documentation)
Slot number in the PLC device0, position number in rack (set the linkup to documentation)
Ticks priority5 (set the linkup to documentation)
Number of ticks to timeout247 (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 optimalised 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). 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).
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 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


Description of the "PmaCommGroup > Parameters > Special Parameters" configurator:
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 is no variable on the "Data-sent" tab.
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.

History:
Pm9.00.26: Generalization for communication with PLC devices of the Micro850 type. There is a new "PLC type" configurator configurator in the protocol parameters.
Pm9.00.25: Fixed bug: If there was only 1 character in the structure item name then the transfer of this item did not work.
Pm9.00.21: Fixed bug: Receiving the value of the $STRING type did not work when it was in the form of structure.
Pm8.03.10: Fixed bug: Was not possible to receive 2-dimensional array.
Pm8.03.02: Fixed bug: Sometimes the "Reading names of all available variables from the PLC device" message type transmission did not work correctly.
Pm8.02.16: Fixed bug:
- Two PROMOTIC applications were unable to connect to a single PLC.
- "Reading names of all available variables from the PLC device" message type transmission did not work.
Pm8.02.03: Fixed bug: Message of the Reading names of all available variables from the PLC device type sometimes generated invalid name list.
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.