View Single Post
Old August 12th, 2008, 02:43 AM   #7
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