Force Multiple Coils (Function 15)

The Force multiple coils function can be used to set or reset a number of digital outputs at the same time.

The first 20 digital outputs are written in this example. The digital outputs start at an offset of 0x0000. Here the offset always describes a bit. Offset 0x0003 writes to the fourth bit in the output process image. The length indicates the number of bits, and the Byte count is formed from the combination all the bytes that are to be written.

Example: 20 bits yield a byte count of 3 (rounded up to a byte boundary).

The data bytes contain the values for the individual bits. In this example, bits 0 to 15 are set to TRUE, while bits 16 to 23 are FALSE.

Query

Byte Name

Example

Function code

15

Start address high

0

Start address low

0

Length high

0

Length low

20

Byte Count

3

Data 1 bit 0...7

255

Data 2 bit 8...15

255

Data 3 bit 16...23

0

Response

The Bus Coupler answers with the same telegram.

Byte Name

Example

Function code

15

Start address high

0

Start address low

0

Length high

0

Length low

20