Siemens SIMATIC S7-200 System Manual page 107

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Example: Transmit and Receive Instructions
M
A
I
N
Network 1
//This program receives a string of characters
//until a line feed character is received.
//The message is then transmitted back
//to the sender.
LD
SM0.1
//On the first scan:
MOVB
16#09, SMB30 //1. Initialize Freeport:
//
//
//
MOVB
16#B0, SMB87 //2. Initialize RCV message control byte:
//
//
//
//
MOVB
16#0A, SMB89 //3. Set end of message character
//
MOVW
+5, SMW90
//4. Set idle line timeout
//
MOVB
100, SMB94
//5. Set maximum number of characters
//
ATCH
INT_0, 23
//6. Attach interrupt 0
//
ATCH
INT_2, 9
//7. Attach interrupt 2
//
ENI
//8. Enable user interrupts.
RCV
VB100, 0
//9. Enable receive box with
//
S7-200 Instruction Set
- - Select 9600 baud.
- - Select 8 data bits.
- - Select no parity.
- - RCV enabled.
- - Detect end of message character.
- - Detect idle line condition
as the message start condition.
to hex OA (line feed).
to 5 ms.
to 100.
to the Receive Complete event.
to the Transmit Complete event.
buffer at VB100.
Chapter 6
93

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents