105BCommunication processor
12.3 Point-to-Point (PtP) communication
S7-1200 Programmable controller
544
System Manual, 11/2011, A5E02486680-05
You can always set the LENGTH parameter to 0 and ensure that SEND_PTP 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 12- 22 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.
Elementary data type
The LENGTH value must contain the byte count of this data type. For
example, 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 only the first LENGTH bytes of the
structure are sent from the BUFFER. 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 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 number of array elements which are contained in
LENGTH bytes is transferred. 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.
Otherwise, STATUS = 8088H, ERROR = 1, and no transmission occurs.
> 0
String
The LENGTH parameter contains the number of characters to be
transmitted. Only the characters of the String are transmitted. The maximum
and actual length bytes of the String are not transmitted.
12.3.1.6
RCV_PTP instruction
Table 12- 23 RCV_PTP (Receive Point-to-Point) instruction
LAD / FBD
SCL
Description
"RCV_PTP_DB"(
EN_R:=_bool_in_,
PORT:=_uint_in_,
BUFFER:=_variant_in_,
NDR=>_bool_out_,
ERROR=>_bool_out_,
STATUS=>_word_out_,
LENGTH=>_uint_out_);
RCV_PTP checks for messages that have been
received in the CM or CB. If a message is available, it
will be transferred from the CM or CB to the CPU. An
error returns the appropriate STATUS value.
1
STEP 7 automatically creates the DB when you insert the instruction.