hi , just use free port cor communication between printer and s7-200
i m sending u the program of tips which will help u in two mail just look at it help
TITLE= Tip019B
// TOPIC: Connecting a Parallel Printer to an S7-200 in Freeport Mode
// VERSION: 4.0
// DATE: 12/98
//
// ***SPECIAL HARDWARE REQUIREMENTS***
//
// One SIMATIC S7-200 CPU 212, CPU 214, CPU 215, OR CPU 216
// 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
//
// ***NOTE:***
//
// 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).
//
// ***DISCLAIMER***
//
// These SIMATIC S7-200 Application Tips are provided free of charge
// to give users of the S7-200 examples of programming techniques
// available to accomplish certain tasks in various applications.
// These Tips do not purport to cover all details or variations in
// equipment, nor do they provide for every possible contingency.
// Your application may be different from those contemplated herein.
// It is your responsibility to use the SIMATIC S7-200 properly in
// your application. These Tips do not relieve you of the responsibility
// to use sound practices in application, installation, operation
// and maintenance. By using these Tips, you acknowledge that Siemens
// shall not be liable under any theory for damages or personal
// injury resulting from such use.
//
// Siemens reserves the right to make changes in these Tips at any
// time without notice or obligation. Should a conflict arise between
// the suggestions in these Tips and other Siemens publications such
// as the S7-200 Programmable Controller System Manual or the
// SIMATIC S7 / M7 / C7 Programmable Controllers Catalog ST 70, the
// other publication shall take precedence.
//
// Copyright© 1999 Siemens Energy & Automation, Inc. Any form
// of duplication or distribution of these Tips or excerpts hereof
// is prohibited without the express consent of Siemens Energy &
// Automation, Inc.
//
// ***ONLINE HELP***
//
// To activate the associated online Help file, open the directory
// on your desktop where you stored these files or select the
// documentation CD and double-click on the 200TIPSB.hlp file. After
// the Help file starts, use the Table of Contents or the Help Topics
// Index to select the file associated with this tip.
//
// ***OVERVIEW***
//
// 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 with
// a transmission rate of 9600 baud.
//
// ***PROGRAM DESCRIPTION***
//
// When this program starts, if the mode switch is set to RUN mode,
// the main program switches the communication protocol to Freeport
// mode. (If the mode switch is in TERM mode, the main program switches
// the communication protocol to PPI.) Next, the program sends a
// message to the printer. The content of the message depends on which
// input is set. The main program defines which memory bytes are called.
//
// Subroutine SBR0 contains the setup parameters for the Freeport mode
// and the text that is printed out when each input is set. If input
// I0.0 is set, the printer prints "SIMATIC S7-200". If inputs I0.1
// through I0.7 are set, the program displays an appropriate message:
// "INPUT 0.x IS SET !", where "x" is the number of the corresponding
// input bit.
//
// The program consists of the following routines:
// Main Initialize connection to printer and handle input requests
// SBR0 Prepare program for printing
//
// The S7-200 Programmable Controller System Manual provides you with
// more information about configuring the communication interface for
// Freeport mode.
//
// ***MAIN PROGRAM
//
// The information that is required for setting the Freeport mode is
// stored in special memory byte SMB30 (for Port 0 of your S7-200 CPU)
// or in special memory byte SMB130 (for Port 1 of your S7-200 CPU,
// if your CPU has two ports). The Transmit (XMT) instruction contains
// the start address of the data that is to be transmitted. The data
// is transmitted in a data buffer (TABLE). The first entry in the
// data buffer specifies the length of the message, that is, the
// number of bytes to be transmitted.
// Tip019B
// TOPIC: Connecting a Parallel Printer to an S7-200 in Freeport Mode
// VERSION: 4.0
// DATE: 12/98
//
// ***SPECIAL HARDWARE REQUIREMENTS***
//
// One SIMATIC S7-200 CPU 212, CPU 214, CPU 215, OR CPU 216
// 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
//
// ***NOTE:***
//
// 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).
//
// ***DISCLAIMER***
//
// These SIMATIC S7-200 Application Tips are provided free of charge
// to give users of the S7-200 examples of programming techniques
// available to accomplish certain tasks in various applications.
// These Tips do not purport to cover all details or variations in
// equipment, nor do they provide for every possible contingency.
// Your application may be different from those contemplated herein.
// It is your responsibility to use the SIMATIC S7-200 properly in
// your application. These Tips do not relieve you of the responsibility
// to use sound practices in application, installation, operation
// and maintenance. By using these Tips, you acknowledge that Siemens
// shall not be liable under any theory for damages or personal
// injury resulting from such use.
//
// Siemens reserves the right to make changes in these Tips at any
// time without notice or obligation. Should a conflict arise between
// the suggestions in these Tips and other Siemens publications such
// as the S7-200 Programmable Controller System Manual or the
// SIMATIC S7 / M7 / C7 Programmable Controllers Catalog ST 70, the
// other publication shall take precedence.
//
// Copyright© 1999 Siemens Energy & Automation, Inc. Any form
// of duplication or distribution of these Tips or excerpts hereof
// is prohibited without the express consent of Siemens Energy &
// Automation, Inc.
//