$BEGIN_KM_HEADER
<LINES=00004-SIZE=00000078-NEXTPOS=00000000>
KM_TEXT = (c) Moeller GmbH, Bonn 2001
S40_VERSION = SucoSoft V5.00
CRC = 20228
TIMESTAMP = Mon Feb 23 21:38:26 2009
<LINES=00010-SIZE=0000012B-NEXTPOS=00000000>
tKisDeclEdi = kTxt
tKisInstrEdi = kAWL
tKisWinArea = kImpl
m_WndRect = 22#22#606#347#
tKisSplitMode = kVer
tKisKindOfDeclBlock = kDeclVar
m_ulSplitSize = 413
m_InstrPos = 1/1#0/0#0/0#
m_DeclPos = 1/1#0/0#
m_ulGridColWidth = 0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#
<LINES=00014-SIZE=000001BE-NEXTPOS=00000000>
PROJECT = DEMO
OEMNAME = Martin Rehfeldt
OEMDATE = 30.05.2005
COMPANY = Martin Rehfeldt
VERSION = 0.0.1
SPS_TYPE = PS4-341 MM1 
POETXTSIZE = 7
POETXT = main program: DEMO_Prg
POETXT = for PLCEdit demonstration
POETXT = version: 0.0.1, 30.05.2005, Martin Rehfeldt
POETXT = 
POETXT = If you are using PLCEdit and insert the comment
POETXT = from the KM Header, it uses the comment syntax
POETXT = only in the declarations & the code.
$END_KM_HEADER
PROGRAM DEMO_Prg 
VAR
(*analog inputs*)
u0  AT %IAW0.0.0.4 : WORD;              (*PS4-341 analogue input*)
u1  AT %IAW0.0.0.6 : WORD;

(*bin. inputs*)
b0  AT %I0.0.0.0.0 : BOOL;              (*PS4-341 binary inputs*)  	
b1  AT %I0.0.0.0.1 : BOOL; 

(*div. var.*)
b	 : ARRAY [0..1] OF BOOL;
an	 : ARRAY [0..1] OF INT; 

(*Instanzen*)
bin_come0 : R_TRIG;       	        (*utilisation of 0_1 flank for bin. input 0*)
DFB       : DEMO_FB;                (*DEMO_FB function block*)
END_VAR
(*
main program: DEMO_Prg
for PLCEdit demonstration
version: 0.0.1, 30.05.2005, MR
*)


LD   1
ST   an[0]


(*call R_Trig-element to utilize 0_1 flank of bin. input 0*)
CAL  bin_come0 (CLK := b0          	(*funtion block input*)
               |	
               b[0]:= Q  )             	(*funtion block output*)
                             

LD   b[0]                               (*check values*)
EQ   1
JMPC FILLED                             (*jump conditional*)
LD   u0
WORD_TO_INT
ST   an[1]

FILLED:                                 (*jump mark*)
LD   u1
WORD_TO_INT
ST   an[1]

CAL  DFB(x0 := an[0], 			(*call DFB*) 
	 x1 := b[0]
	 |
	 b[1] := y0 )
END_PROGRAM