EasyManua.ls Logo

Siemens Simatic SM331 - Page 72

Siemens Simatic SM331
78 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Appendix
A.1 Source of the user program
SM331; AI 8x12 Bit Getting Started part 1: 4 -20mA
A-4 Getting Started, 11/2006, A5E00253410-02
U
SPBN
L
SSI
T
lbl0: NOP
M
lbl0;
MW
4;
MW
0;
200.0;
100;
100;
NETWORK
TITLE =The End
BE;
END_ORGANIZATION_BLOCK
ORGANIZATION_BLOCK OB 40
TITLE = "Hardware Interrupt"
// Processing OB40_POINT_ADDR (L8 to L11)
//
//L8 High limit value exceeded
//L9 Low limit value exceeded
VERSION : 1.0
VAR_TEMP
OB40_EV_CLASS : BYTE ; //Bits 0-3 = 1 (Coming event),
Bits 4-7 = 1 (Event class 1)
OB40_STRT_INF : BYTE ; //16#41 (OB 40 has started)
OB40_PRIORITY : BYTE ; //Priority of OB Execution
OB40_OB_NUMBR : BYTE ; //40 (Organization block 40, OB40)
OB40_RESERVED_1 : BYTE ; //Reserved for system
OB40_IO_FLAG : BYTE ; //16#54 (input module), 16#55 (output module)
OB40_MDL_ADDR : WORD ; //Base address of module initiating interrupt
OB40_POINT_ADDR : DWORD ; //Interrupt status of the module
OB40_DATE_TIME : DATE_AND_TIME
;
//Date and time OB40 started
END_VAR
BEGIN
NETWORK
TITLE =Sensor 1 (Channel 0): Lower limit value
U L 9.0; // Channel 0 low limit value
SPBNB L001;
L W#16#1;
L MW 100;
OW ;
T MW 100;
L001;
NOP 0;
NETWORK
TITLE =Sensor 1 (Channel 0): Upper limit value
U L 8.0; // Channel 0 upper limit value
SPBNB L002;
L W#16#2;
L MW 100;
OW ;
T MW 100;

Related product manuals