Protocol Description
Transfer protocol
A simple transfer protocol is used for data communication with the Bus Coupler/Fieldbus Box. Process data exchange with the BK8x00/IPxxxx-B8x0 invariably involves the complete process image, i.e. a request by the master leads to the Bus Coupler/Fieldbus Box receiving the complete set of output data and the current process input data being sent to the master in response. Data communication
- between the Bus Coupler and the individual Bus Terminals is via the K-Bus;
- between the Coupler Box and the individual extension modules is via IP-Link.
In the default setting of the Bus Coupler/Fieldbus Box, access to the I/O signals of the terminals/extension modules is asynchronous (free running mode). The KS2000 configuration software can be used to switch the mode to synchronous. In synchronous mode, access by the Bus Coupler/Fieldbus Box to the Bus Terminals/extension modules is synchronous with access by the controller to the Bus Coupler/Fieldbus Box.
The data packets are transferred in a fixed format as a binary string. The data frame is set to 8 data bits, with even parity and 1 stop bit (8E1). The baud rate is preset to 38400 baud.
The station addresses are set to Bus Coupler/Fieldbus Box via two rotary switches. If address 0 is set, the BK8x00/IPxxxx-B8x0 operates as master, and the slave Bus Coupler/Fieldbus Box must be allocated address 1.
Request
The master sends a request to the slave with the process output data to be transferred. The slave responds by sending its status and its process input data.
Byte | Description | Valid range of values |
---|---|---|
0 | Start ID | "P" (0 x 50 hex) |
1 | Number of process data output words | 0..255 |
2 | Message Ident | 0..255 |
3 | Multipoint address | 0..99 for BK8x00 |
4 + 2 x n | Process data output: Low Byte | 0..255 |
5 + 2 x n | Process data output: High Byte | 0..255 |
6 + 2 x n +1 | Checksum | 0..255 |
Start ID
The start ID consists of one byte. It identifies the start of a data packet.
Number of process data output words
The number of process data output words specifies the size of the output process image of the addressed Bus Coupler/Fieldbus Box in words. If the number of process image bytes is odd it must be rounded up. Enter zero if only the process input data of the Bus Coupler/Fieldbus Box are to be read.
Message Ident
The message Ident is a (freely selectable) value returned by the receiver in the response string, so that the sender can correlate received and sent strings.
Multipoint address
The multipoint address specifies the receiver. The address value must be unequal 0, since 0 is the master address. For Fieldbus Boxes please note that addresses greater than 69 are not permitted.
Process data output
The process data outputs are entered as data words in Intel format.
Checksum
The checksum is formed by adding up the contents of the individual bytes (total request string, without checksum byte). Any overflow is not taken into account.
Response
The Bus Coupler/Fieldbus Box responds to a request by the master.
Byte | Description | Range of values |
---|---|---|
0 | Start ID | "p" (0 x 70 hex) |
1 | Number of process data output words | 0..255 |
2 | Message Ident | 0..255 |
3 | Multipoint address | 0..99 for BK8x00 |
4 | 0..255 | |
5 + 2 x n | Process data output | 0..255 |
6 + 2 x n | Process data output | 0..255 |
7 + 2 x n +1 | Checksum | 0..255 |
Start ID
The start ID consists of one byte. It identifies the start of a data packet.
Number of process data output words
The number of process data output words specifies the size of the output process image of the addressed Bus Coupler/Fieldbus Box in words. If the number of process image bytes is odd it must be rounded up. Enter zero if only the process input data of the Bus Coupler/Fieldbus Box are to be read.
Message Ident
The message Ident is a (freely selectable) value returned by the receiver in the response string, so that the sender can correlate received and sent strings.
Multipoint address
The multipoint address specifies the receiver. The address value must be unequal 0, since 0 is the master address. For Fieldbus Boxes please note that addresses greater than 69 are not permitted.
Status byte (SB)
Bit | Meaning | |
---|---|---|
SB.0 | 1bin | Error in the data communication with the Bus Terminals/extension modules. |
SB.1 | 1bin | Configuration error |
SB.2 | - | reserved |
SB.3 | - | reserved |
SB.4 | 1bin | Invalid process data output length: The number of process output words received is unequal the physically present data length. |
SB.5 | - | reserved |
SB.6 | - | reserved |
SB.7 | - | reserved |
Process data output
The process data inputs are entered as data words in Intel format.
Checksum
The checksum is formed by adding up the contents of the individual bytes (total request string, without checksum byte). Any overflow is not taken into account.