Special Hardware Requirements:
- One PC/PPI cable
- One converter, 9-pin female to 25-pin male
- One converter, serial-to-parallel
- One null modem adapter for swapping lines 2 and 3 (if required)
- One parallel printer
One problem might occur. Because the SIMATIC S7-200 and the printer both behave as slaves (data communications equipment, or DCE), the data transfer of each device tries to run in the same direction. This means that both the receive and transmit data lines end up connected to each other (lines 2 and 3). You can avoid this problem by setting up the converter properly or by using an appropriate wiring adapter (a null modem adapter).
This example demonstrates how to connect an S7-200 CPU to a printer and send information to the printer by using the Freeport communication mode of the CPU. You can use Freeport mode to transmit data and to receive data.
You can use the Freeport mode to define your communication protocol. You select the Freeport protocol in special memory byte SMB30 (for Port 0 of your S7-200 CPU) or SMB130 (for Port 1 of your S7-200 CPU, if your CPU has two ports). You also store the information needed for communication in one of these special memory bytes. After selecting the Freeport mode, you declare the following:
- Baud rate
- Number of data bits per character
- Parity
The program performs the following tasks:
When input I0.0 is activated, the program displays the text “SIMATIC S7-200”. When inputs I0.1 through I0.7 are activated, the program displays an appropriate message: “INPUT 0.x IS SET !”, where “x” is the number of the corresponding input bit.
The program in this example assumes that you have connected the printer to your S7-200 CPU by means of a parallel interface

Program Flowchart

Download Project Example :

















