я написал код но он работает не адекватно, а может быть и я не адекватный.
Code: Select all
A "start"
JCN Ende
L #Select_IN
AW W#16#FF00
JN Err
L #Select_IN
JL num
JU step1
JU step2
JU step3
JU step4
num: JU Err
Err: L #Select_IN
L 4
>=I
L 0
T #Select_IN
R "Tag_4"
R "Tag_5"
R "Tag_2"
R "Tag_7"
R "start"
CLR
SAVE
JU Ende
Ende: NOP 0
BE
step1: A(
L #Select_IN
L 0
==I
)
L S5T#15s
SE "Tag_4"
NOP 0
NOP 0
NOP 0
A "Tag_4"
= "M_VA1.1"
= "M_VA1.2"
AN "Tag_4"
JNB Label_0
L #Select_IN
L 1
+I
T #Select_IN
AN OV
SAVE
CLR
Label_0 : A BR
JCN Ende
step2: A "start"
S "M_VA1.1"
A(
A "start"
L S5T#20s
SD "Tag_5"
NOP 0
NOP 0
NOP 0
A "Tag_5"
)
R "M_VA1.1"
A "M_VA1.1"
= "M_VA1.2"
A "Tag_5"
JNB Label_1
L #Select_IN
L 1
+I
T #Select_IN
AN OV
SAVE
CLR
Label_1 : A BR
JCN Ende
step3: A "start"
S "M_VA1.1"
A(
A "start"
L S5T#25s
SD "Tag_2"
NOP 0
NOP 0
NOP 0
A "Tag_2"
)
R "M_VA1.1"
A "M_VA1.1"
= "M_VA1.2"
A "Tag_5"
JNB Label_2
L #Select_IN
L 1
+I
T #Select_IN
AN OV
SAVE
CLR
Label_2 : A BR
JCN Ende
step4: A "start"
S "M_VA1.1"
A(
A "start"
L S5T#30s
SD "Tag_7"
NOP 0
NOP 0
NOP 0
A "Tag_7"
)
R "M_VA1.1"
A "M_VA1.1"
= "M_VA1.2"
A "Tag_5"
JNB Label_3
L #Select_IN
L 1
+I
T #Select_IN
AN OV
SAVE
CLR
Label_3 : A BR
JCN Ende
или может первый раз пройти все а второй раз при вызове этой FC зависнуть на первом же таймере