P-NET
P-NET is a multi-master and multi-net-capable field bus system for the primary use in process engineering processes with medium time requirements, in which sensors and actuators of a manufacturing process are connected to one another. A typical P-NET installation has response times of up to a few milliseconds and a bus length of up to one kilometer. The P-NET standard is defined according to the OSI reference model . In contrast to most fieldbus protocols, P-NET uses layers 1 ( physical layer ), 2 ( data link layer ) and 7 ( application layer ) as well as layer 3 ( network layer ) and 4 ( transport layer , here as a service layer) labeled).
P-NET layer model
P-NET layer 1 (physical layer)
The physical level of the P-NET is based on the RS-485 standard from the Electronic Industries Association . Only the cabling and the line termination differ from this. Instead of the necessary terminating resistors, the shielded two-wire cable is closed to form a physical ring. This enables the use of up to 125 bus modules with a maximum of 32 master modules per P-NET segment. The data transfer rate is a constant 76.8 kbit / s and takes place in the NRZ method ( No Return to Zero ).
P-NET Layer 2 (Data Link Layer)
The figure shows the P-NET telegram structure and the structure of a character. This is a 9-bit data UART character with a start bit (logical 0) and a stop bit (logical 1). In addition to the 8 data bits, the A / D bit is inserted before the stop bit, which is used to identify the first address byte (A / D = 1) and thus simultaneously marks the start of a frame. This bit is used to differentiate between address and data bytes. The telegram always begins with the address field with a length of 2 to 24 bytes. This is followed by a control / status field with a length of one byte. This byte contains the coding of the layer 7 service in the request frame and the corresponding error information in the response frame. The information length byte encodes the length of the user data and the type of addressing in the request telegram. In this case, bits 0 to 5 provide information about the length of the information, bit 6 indicates whether there is an offset coding, and bit 7 finally indicates whether the subsequent softwire number (SWNo) is 2 or 4 bytes long. The following information field itself contains the reference to the variable to be addressed and any data to be transferred. The data is backed up using a checksum procedure, with the security field containing the two's complement of the calculated checksum. For special applications there is a protocol variant with 2-byte CRC protection .
The address field of a P-NET telegram contains the address of a bus module, which can have a simple or complex structure. The data bits 0 to 6 contain the actual address. Bit 7 is used to differentiate between target and source addresses. Values from 1 to 125 are permitted as addresses. The addresses 0 and 127 are reserved. The address 126 is used as a broadcast address ( broadcast ). A simple address identifies a bus module in the same segment and is coded as a byte. A complex address is used to address bus modules in remote networks and is made up of a sequence of address bytes.
The allocation of bus access rights among the master modules is controlled by means of a virtual token procedure. It is based on time control and does not require any telegrams to pass on tokens.
P-NET Layer 3 (Network Layer)
The main tasks of layer 3 are the transport of data from layer 2 to layer 4 and the implementation of the gateway functionality. The figure shows the basic flow of communication via a gateway . Each gateway sends back a response telegram with the coding Answer Comes Later after receiving a request telegram addressed to another network . This behavior is necessary in order to meet the principle of immediate response . The client then goes on hold until it receives a corresponding response telegram. The gateway carries out the address conversion required according to the P-NET standard and forwards the request telegram to the server . The response telegram is generated in the server and sent back to the gateway as a response telegram . The Gateway encoded after receiving the response message by the server , the actual response to the client.
P-NET Layer 4 (Transport Layer, referred to as Service Layer in P-NET)
Layer 4 comprises two different tasks . The first includes the P-NET service, which writes or reads data into the internal memory or returns a request if the variable is stored in another module. The second task contains details of any queries that have been sent but are still awaiting a response. When the answer arrives, it is sent back to the requesting application task. The address of each variable is therefore stored in a list ( softwire list ). Each entry in this list is assigned a unique number, the softwire number . A variable is accessed using its softwire number (SWNo). This has the advantage that the physical address of a variable does not have to be known and guarantees the use of different storage media ( RAM , ROM , EEPROM ) with this model.
P-NET layer 7 (application layer)
Layer 7, with the application programs, access the structured data stored by the service in layer 4. The programming of the softwire list takes place in the application program. In addition to the pure signal state or value, additional information is assigned to each process signal. This information is stored in variables and relates to special functions such as configuration, conversion, scaling, filtering, error implementation, etc. In the P-NET, the entirety of the variables and functions relating to a process signal is treated as a process object and bears the name Channel . .
Communication services
The P-NET protocol does not differentiate between the transmission of parameterization or configuration data and the process variables. The meaning of the data can be found in the included software number (SWNo) and the offset. Since the P-NET protocol separates the application program and the communication system, the data is stored in local variables within the client. The data on the server can still be accessed by the relevant services.
service | description |
---|---|
Store | Writing to a variable |
Read | Reading a variable |
And | Bit-wise logical AND link between the sent telegram data and the variable, the result is saved in the slave |
Or | Bit-by-bit logical OR link between the sent telegram data and the variable, the result is saved in the slave |
Test-and-set | Resource control, test for multiple access by several masters |
Long load | Reading of a data block of more than 56 bytes up to a maximum of 64 KByte, automatic segmentation |
Long store | Writing a data block of more than 56 bytes to a maximum of 64 KByte, automatic segmentation |
The seven possible P-NET application services are compiled and briefly explained in the table above. These services are coded and transmitted in the control / status field of the request telegram. The associated response telegram contains the corresponding result code. A distinction can be made here between communication and application errors. In this way, the application program can determine whether there is an error in the module and branch to a corresponding service routine.
Channel type concept
The characteristic of P-NET is the channel concept, which the management structure for the process objects, i. H. represents the variables and functions of a process signal. A channel is structured as a sequence of 16 registers (variables). These variables are addressed as softwire numbers (SWNo) and can have structured data types that are stored in various storage media. The mapping rule between register, channel and SWNo specifies that the least significant nibble of a softwire number contains the register number, while the more significant nibble defines the number of the channel in the module. The aim of the introduction was the idea of always being able to address automation functions according to the same principle.
register | Surname | Storage | Data format | meaning |
---|---|---|---|---|
0 | PrimaryValue | ... | ... | ... |
9 | ChConfig | EEPROM rpw | record | configuration |
A. | Maintenance | EEPROM rpw | record | Maintenance information |
E. | ChType | ROM ro | record | Type and register information |
F. | ChError | RAM ro | record | Error status |
As can be seen in the table above, the basic structure of a channel has been laid down in the standard. The service channel contains the first 16 SWNo with a fixed typing. This channel enables unknown P-NET participants to be identified via the bus. Regardless of its special functions, each P-NET module must have a service channel. In the following table all mandatory entries of a service channel are listed and briefly explained.
register | Surname | meaning |
---|---|---|
0 | NumberOfSWNo | Contains the highest SWNo of the module |
1 | DeviceId | The module can be identified by this record |
4th | PnetSerialNo | Used to assign the node address via the bus |
9 | ModuleConfig | Contains settings for module configuration |
D. | WriteEnable | Write enable for EPROM |
E. | ChType | Type and register information |
F. | CommnonError | Module error status |
There are channels for typical fieldbus modules, e.g. B. for input / output modules ( digital I / O channel and current output channel ), for analog measured value recorders ( analog measurent channel ) and for simple controllers ( PID regulator ).
Normalization
At the European level, P-NET is specified in the EN 50170-1 (1997) standard.