s7 200 and printer

SHYAMAL

Member
Join Date
Aug 2007
Location
DHAKA, BANGLADESH
Posts
53
I want to interface a dot matrix printer with s7 200 through free port.

I have cpu 224xp, printer LQ300 + II, a 25 to 9 pin converter, a pc/ppi cable. I like to have some guides from you.



Regards.



Shyamal
 
Rs 232

There is a Siemens function block for RS232 communication which I don't have ANYMORE.
I'm not sure if you can Print directly or you need a PC or TS adapter.
I would buy a serial card anyway. The distributor should have that FB and give it for free. If you need fonts you'll get lots of white hair and you need the printer manufacturers' communication protocol. I did it about 10-11 years ago for a dot matrix with a serial card but it was not worth the money (spent a week on it due to fonts). The easiest way is to get a profibus industrial printer $1500.
 
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.
//
  • // the start address
 
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
//
 
TITLE=
// ***SUBROUTINE***
//
//
// ***SUBROUTINE***
//
//
Network 1 // Subroutine SBR0
// Start SBR0.
// SBR 0 // Start SBR0.
//
Network 2 // Prepare Program for Printing: Print "SIMATIC S7-200"
// Load special memory bit SM0.0 to process this network every
// scan cycle.
// Move the constant 9 (binary 1001) into special memory byte SMB30
// (Freeport control register for Port 0). This bit combination configures
// the communication interface for Freeport mode, 9600 baud, 8 data
// bits per character, and no parity.
// Move the constant 16 into variable memory byte VB80 to specify the
// length of the message as 16 ASCII characters.
// Move the hexadecimal value 5349 into variable memory word VW81 to
// specify that the first two ASCII characters are "S" and "I"
// ("S" in the ASCII character set = "53" in hexadecimal notation and
// "I" = "49").
// Move the hexadecimal value 4D41 into variable memory word VW83 to
// specify that the next two ASCII characters are "M" and "A".
// Move the hexadecimal value 5449 into variable memory word VW85 to
// specify that the next two ASCII characters are "T" and "I".
// Move the hexadecimal value 4320 into variable memory word VW87 to
// specify that the next two ASCII characters are "C" and "<space>".
// Move the hexadecimal value 5337 into variable memory word VW89 to
// specify that the next two ASCII characters are "S" and "7".
// Move the hexadecimal value 2D32 into variable memory word VW91 to
// specify that the next two ASCII characters are "-" and "2".
// Move the hexadecimal value 3030 into variable memory word VW93 to
// specify that the next two ASCII characters are "0" and "0".
//
LD SM0.0 // Load SM0.0.
MOVB 9, SMB30 // Select Freeport protocol,
// 9600 baud, 8 bits per character,
// and no parity.
MOVB 16, VB80 // Specify message length of
// 16 ASCII characters.
MOVW 16#5349, VW81 // Specify the ASCII characters
// "S" and "I".
MOVW 16#4D41, VW83 // Specify the ASCII characters
// "M" and "A".
MOVW 16#5449, VW85 // Specify the ASCII characters
// "T" and "I".
MOVW 16#4320, VW87 // Specify the ASCII characters
// "C" and <space>".
MOVW 16#5337, VW89 // Specify the ASCII characters
// "S" and "7".
MOVW 16#2D32, VW91 // Specify the ASCII characters
// "-" and "2".
MOVW 16#3030, VW93 // Specify the ASCII characters
// "0" and "0".

Network 3 // Print "INPUT 0.x IS SET !"
// Load special memory bit SM0.0 to process this network every scan
// cycle.
// Move the hexadecimal value 0D0A into variable memory word VW95 to
// specify the ASCII characters "CR" (Carriage return) and "LF"
// (Linefeed). This instruction enables the next character that is
// transmitted to begin on a new line.
// Move the constant 20 into variable memory byte VB100 to specify
// the length of the message as 20 ASCII characters.
// Move the hexadecimal value 494E into variable memory word VW101 to
// specify the ASCII characters "I" and "N".
// Move the hexadecimal value 5055 into variable memory word VW103 to
// specify the ASCII characters "P" and "U".
// Move the hexadecimal value 5420 into variable memory word VW105 to
// specify the ASCII characters "T" and "<space>".
// Move the hexadecimal value 302E into variable memory word VW107 to
// specify the ASCII characters "0" and ".". (Variable memory byte
// VB109 is loaded in the main program, NETWORKS 4 through 10.)
// Move the hexadecimal value 20 into variable memory byte VB110 to
// specify the ASCII character "<space>".
// Move the hexadecimal value 4953 into variable memory word VW111 to
// specify the ASCII characters "I" and "S".
// Move the hexadecimal value 2053 into variable memory word VW113 to
// specify the ASCII characters "<space>" and "S".
// Move the hexadecimal value 4554 into variable memory word VW115 to
// specify the ASCII characters "E" and "T".
// Move the hexadecimal value 2021 into variable memory word VW117 to
// specify the ASCII characters "<space>" and "!".
// Move the hexadecimal value 0D0A into variable memory word VW119 to
// specify the ASCII characters "CR" (Carriage return) and "LF"
// (Linefeed). This instruction begins a new line.
//
LD SM0.0 // Load SM0.0.
MOVW 16#0D0A, VW95 // Specify the ASCII characters
// "CR" (Carriage return) and
// "LF" (Linefeed).
MOVB 20, VB100 // Specify message length of 20
// ASCII characters.
MOVW 16#494E, VW101 // Specify the ASCII characters
// "I" and "N".
MOVW 16#5055, VW103 // Specify the ASCII characters
// "P" and "U".
MOVW 16#5420, VW105 // Specify the ASCII characters
// "T" and "<space>".
MOVW 16#302E, VW107 // Specify the ASCII characters
// "0" and ".".
MOVB 16#20, VB110 // Specify the ASCII character
// "<space>".
MOVW 16#4953, VW111 // Specify the ASCII characters
// "I" and "S".
MOVW 16#2053, VW113 // Specify the ASCII characters
// "<space>" and "S".
MOVW 16#4554, VW115 // Specify the ASCII characters
// "E" and "T".
MOVW 16#2021, VW117 // Specify the ASCII characters
// "<space>" and "!".
MOVW 16#0D0A, VW119 // Specify the ASCII characters
// "CR" (Carriage return) and
// "LF" (Linefeed).

Network 4 // End of Subroutine SBR0
// End SBR0. This instruction returns control to the instruction that
// follows the CALL instruction for SBR0.
// RET // End SBR0.
//
 
Thank you Yaseer Sayeed so much for the reply. I would like to have more explaination on :

"One converter, serial-to-parallel
One null modem adapter for swapping lines 2 and 3 (if required)"


I have the printer of a 25-pin serial port. Still then, do I need a serial to parallel converter?

Regards,

Shyamal
 

Similar Topics

Hello, S7-200 is installed with dot matrix printer. its printer is not working. now I have changed the printer. Problem in new printer is that...
Replies
0
Views
167
I have built my first 3d printer. I used a k8200 kit that was gifted to me and gave it a z-axis upgrade and direct drive extruder. I am in the...
Replies
3
Views
1,084
Hi everyone, Does anyone have a guide on how to communicate a zebra printer with a s7-1200 plc via TCP using TIA portal?? or any advices on what...
Replies
2
Views
1,828
Hi, I am having a right nightmare of a time. I have never programmed a Zebra printer before and need some help from you professionals. I don't...
Replies
2
Views
2,833
Hi, I need help about how establishment communication between a Siemens S7-1200 plc and a Zebra ZM-400 printer over Ethernet. I am using Tia V13...
Replies
1
Views
2,695
Back
Top Bottom