Technical data

Table Of Contents
S7 Communication
System Software for S7-300/400 System and Standard Functions - Volume 2/2
A5E00739858-01
21-29
21.10 Sending Data to a Printer with SFB 16 "PRINT"
Description
SFB 16 "PRINT" sends data and a formatting instruction to a remote printer, for
example, via the CP 441.
When there is a rising edge at control input REQ, the format description (FORMAT)
and the data (SD_i) are sent to the printer selected with ID and PRN_NR.
If you do not use all four send areas, you must make sure that the first area is
described by the SD_1 parameter, the second area (if it exists) by the SD_2
parameter, the third area (if it exists) by SD_3.
Successful execution of the job is indicated by the DONE status parameter, errors
are indicated by the ERROR and STATUS parameters.
Parameter Declaration Data Type Memory Area Description
REQ INPUT BOOL I, Q, M, D, L Control parameter request, activates the
data exchange at a rising edge.
ID INPUT WORD M, D,
constant
Addressing parameter ID, refer to Common
Parameters of the SFBs/FBs and SFCs/FCs
for S7 Communication.
DONE OUTPUT BOOL I, Q, M, D, L DONE status parameter:
0: Job not started or still running
1: Job has been executed error-free
ERROR
STATE
OUTPUT
OUTPUT
BOOL
WORD
I, Q, M, D, L
I, Q, M, D, L
ERROR and STATUS state parameters,
error display:
ERROR=0 and STATUS has the value:
0000H: neither warning nor error
<> 0000H: Warning, STATUS supplies
detailed information
ERROR=1
There is an error. STATUS supplies
detailed information on the type of
error.
PRN_NR IN_OUT BYTE I, Q, M, D, L Printer number
FORMAT IN_OUT STRING I, Q, M, D, L Format description
SD_i
(1<
i<4)
IN_OUT ANY M, D, T, C Pointer to the "i-th" send data area.
Only the following data types are
permissible: BOOL (not allowed: bit field),
BYTE, CHAR, WORD, INT, DWORD, DINT,
REAL, DATE, TOD, TIME, S5TIME,
DATE_AND_TIME, COUNTER, TIMER.
Note:
If the ANY pointer accesses a DB, the DB
must always be specified (for example: p#
DB10.DBX5.0 Byte 10).