CK 2020

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Tagname Type RTU

START Memory Discrete


STOP Memory Discrete
TG1 Memory Discrete
TG2 Memory Discrete
TG3 Memory Discrete
TG4 Memory Discrete
CD Memory Integer
SL Memory Integer
ND Memory Integer
TIMER1 Memory Integer
TIMER2 Memory Integer
LO_NHIET Memory Discrete
CB_NHIET I/O Integer
MT_EP I/O Discrete
ENCODER I/O Integer
PT_CAT I/O Discrete
BT1 I/O Discrete
BT2 I/O Discrete
CB_DN I/O Discrete
PT_DN I/O Discrete
BT3 I/O Discrete
MT_MAI I/O Discrete
BT4 I/O Discrete
CB_DEM I/O Discrete
Dem Memory Integer

Code

IF START==1 AND (CD>0 AND CD<=2000) AND (SL>0 AND SL<=1000) AND (ND>=400 AND
ND<=900) THEN TG1=1; ENDIF;
IF TG1==1 THEN LO_NHIET=1; ENDIF;
IF TG1==1 AND LO_NHIET==1 AND CB_NHIET==ND THEN MT_EP=1; ENDIF;
IF TG1==1 AND MT_EP==1 AND ENCODER==CD*10 THEN MT_EP=0; CB_NHIET=0; LO_NHIET=0;
TG1=0; PT_CAT=1; ENDIF;
IF PT_CAT==1 THEN TIMER1=TIMER1+1; ENDIF;
IF PT_CAT==1 AND TIMER1==30 THEN PT_CAT=0; TIMER1=0; TG2=1; ENDIF;
IF TG2==1 THEN MT_EP=1; BT1=1; BT2=1; ENDIF;
IF BT2==1 AND CB_DN==1 THEN BT1=0; BT2=0; TG2=0; PT_DN=1; ENDIF;
IF PT_DN==1 THEN TIMER2=TIMER2+1; ENDIF;
IF PT_DN==1 AND TIMER2==30 THEN PT_DN=0; TIMER2=0; BT1=1; BT2=1; TG3=1; ENDIF;
IF TG3==1 THEN BT3=1; MT_MAI=1;ENDIF;
IF TG3==1 AND CB1==1 THEN TG3=0; BT3=0; MT_MAI=0; TG4=1; ENDIF;
IF TG4==1 THEN BT4=1; ENDIF;
IF TG4==1 AND CB_DEM==1 THEN BT4=0; TG4=0; DEM=DEM+1; TG1=1; ENDIF;
IF DEM==SL THEN DEM=0; TG1=0; TG2=0; TG3=0; TG4=0; MT_EP=0; MT_MAI=0; ENCODER=0;
PT_CAT=0; PT_DN=0; TIMER1=0; TIMER2=0; BT1=0; BT2=0; BT3=0; BT4=0; PT_DN=0; ENDIF;
IF STOP==1 THEN DEM=0; TG1=0; TG2=0; TG3=0; TG4=0; MT_EP=0; MT_MAI=0; ENCODER=0;
PT_CAT=0; PT_DN=0; TIMER1=0; TIMER2=0; BT1=0; BT2=0; BT3=0; BT4=0; PT_DN=0; ENDIF;

You might also like