You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old August 12th, 2008, 12:51 AM   #1
SHYAMAL
Member
Bangladesh

SHYAMAL is offline
 
Join Date: Aug 2007
Location: DHAKA, BANGLADESH
Posts: 53
s7 200 and printer

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
  Reply With Quote
Old August 12th, 2008, 01:24 AM   #2
danpantea
Member
American Samoa

danpantea is offline
 
Join Date: Sep 2005
Location: Pago Pago
Posts: 76
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.
  Reply With Quote
Old August 12th, 2008, 01:37 AM   #3
yasser sayeed
Member
India

yasser sayeed is offline
 
Join Date: Aug 2008
Location: maharashtra
Posts: 4
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
  Reply With Quote
Old August 12th, 2008, 01:38 AM   #4
SHYAMAL
Member
Bangladesh

SHYAMAL is offline
 
Join Date: Aug 2007
Location: DHAKA, BANGLADESH
Posts: 53
Thanks danpantea for the reply. Please let me know the brand name of the profibus industrial printer. Thank u so much.

Regards,

Shyamal
  Reply With Quote
Old August 12th, 2008, 01:40 AM   #5
yasser sayeed
Member
India

yasser sayeed is offline
 
Join Date: Aug 2008
Location: maharashtra
Posts: 4
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
//
  Reply With Quote
Old August 12th, 2008, 01:43 AM   #6
yasser sayeed
Member
India

yasser sayeed is offline
 
Join Date: Aug 2008
Location: maharashtra
Posts: 4
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.
//
  Reply With Quote
Old August 12th, 2008, 01:47 AM   #7
SHYAMAL
Member
Bangladesh

SHYAMAL is offline
 
Join Date: Aug 2007
Location: DHAKA, BANGLADESH
Posts: 53
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
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
communicate to my printer via plc Farid LIVE PLC Questions And Answers 6 August 15th, 2013 10:31 AM


All times are GMT -5. The time now is 02:36 PM.


.