View Full Version : regarding S7-200

July 19th, 2009, 07:51 AM
hello every body can please check this program out, i have taken it from the help pages in Micro Win>

// Main Program
LD SM0.1 //On the first scan,
MOVB 16#09, SMB30 //Initialize Freeport:
// - Select 9600 baud
// - Select 8 data bits
// - Select no parity
MOVB 16#B0, SMB87 //Initialize RCV message control byte:
// - RCV enabled
// - Detect end of message character
// - Detect idle line condition as
// as message start condition
MOVB 16#0A, SMB89 //Set end of message character to hex OA (line feed)

MOVW +5, SMW90 //Set idle line timeout to 5 ms.
MOVB 100, SMB94 //Set maximum number of characters to 100.
ATCH INT_0, 23 //Attach interrupt 0 to the receive complete event.
ATCH INT_2, 9 //Attach interrupt 2 to the transmit complete event.
ENI //Enable user interrupts
RCV VB100, 0 //Enable receive box with buffer at VB100 for port 0

in atch INT_2 it show error, i don't know why...........
also the same thing in:

// Interrupt 0
//Receive complete interrupt routine

LDB= SMB86, 16#20 //If receive status shows receive of end character,
MOVB 10, SMB34 //then attach a 10 ms timer
ATCH INT_1, 10 //to trigger a transmit
CRETI //and return.
RCV VB100, 0 //If the receive completed for any other
//reason, then start a new receive.

can u please tell me what is the problem in this 2 INT_2, and 1


July 19th, 2009, 01:56 PM

You need to add INT_1 and INT_2 as subroutines in the Program Block (LH Pane in MW)

If you started with a blank new sheet and pasted this code in you will get errors as INT_1 and 2 is undefined.

Microwin Puts in as standard Main, Sub_0 and Int_0 as standard

Right click on Int_0 and click Insert > Interupt (You need to do this twice to get 1 and 2)

Then it will compile correctly

July 20th, 2009, 02:36 AM
thanks DAVE i have done that and its work fine, thanks a lot