EasyManua.ls Logo

Siemens SIMATIC S7-1200 - Page 1125

Siemens SIMATIC S7-1200
1614 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Communication processor and Modbus TCP
13.3 Point-to-point (PtP) communication
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
1125
Interaction of the LENGTH and BUFFER parameters
The minimum size of data that can be transmitted by the SEND_P2P instruction is one byte.
The BUFFER parameter determines the size of the data to be transmitted. You cannot use
the data type Bool or arrays of Bool for the BUFFER parameter.
You can always set the LENGTH parameter to 0 and ensure that SEND_P2P sends the
entire data structure represented by the BUFFER parameter. If you only want to send part of
a data structure in the BUFFER parameter, you can set LENGTH as follows:
Table 13- 25 LENGTH and BUFFER parameters
LENGTH
BUFFER
Description
= 0 Not used
The complete data is sent as defined at the BUFFER parameter. You do not
need to specify the number of transmitted bytes when LENGTH = 0.
> 0 Elementary data type The LENGTH value must contain the byte count of this data type. For ex-
ample, for a Word value, the LENGTH must be two. For a Dword or Real,
the LENGTH must be four. Otherwise, nothing is transferred and the error
8088H is returned.
Structure The LENGTH value can contain a byte count less than the complete byte
length of the structure, in which case the instruction sends only the first n
bytes of the structure from the BUFFER, where n = LENGTH. Since the
internal byte organization of a structure cannot always be determined, you
might get unexpected results. In this case, use a LENGTH of 0 to send the
complete structure.
Array The LENGTH value must contain a byte count that is less than or equal to
the complete byte length of the array and which must be a multiple of the
data element byte count. For example, the LENGTH parameter for an array
of Words must be a multiple of two and for an array of Reals, a multiple of
four. When LENGTH is specified, the instruction transfers the number of
array elements that correspond to the LENGTH value in bytes. If your
BUFFER, for example, contains an array of 15 Dwords (60 total bytes), and
you specify a LENGTH of 20, then the first five Dwords in the array are
transferred.
The LENGTH value must be a multiple of the data element byte count. Oth-
erwise, STATUS = 8088H, ERROR = 1, and no transmission occurs.
String The LENGTH parameter contains the number of characters to be transmit-
ted. Only the characters of the String are transmitted. The maximum and
actual length bytes of the String are not transmitted.

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals