nqchanh
Member
I've tried to simulate OB10 in plcsim.
My intention for this simulation is to enable OB10 at 23:30, 12/24/2012, interrupt event happenning once a day, in OB10 i set M0.0 to enable a timer 10 second in OB1.Here is my code:
(*)OB100:
//net 1
CALL "DATE and TOD to DT"
IN1 :=D#2012-12-24
IN2 :=TOD#23:30:0.000
RET_VAL:=#set_DateTime
CALL "SET_CLK"
PDT :=#set_DateTime
RET_VAL:=#error
//net 2
CALL "EN_IRT"
MODE :=B#16#0
OB_NR :=0
RET_VAL:=#error
CALL "DATE and TOD to DT"
IN1 :=D#2012-12-24
IN2 :=TOD#23:30:0.000
RET_VAL:=#interrupt_DateTime
CALL "SET_TINT"
OB_NR :=10
SDT :=#interrupt_DateTime
PERIOD :=W#16#1001
RET_VAL:=#error
CALL "ACT_TINT"
OB_NR :=10
RET_VAL:=#error
(*)OB10:
SET
= M 0.0
(*)OB1:
A M 0.0
L S5T#10S
SD T 0
A T 0
R M 0.0
but the simulation result on plcSim is that M0.0 is not set as well as T0 is not turned on ! hope someone can help me!
My intention for this simulation is to enable OB10 at 23:30, 12/24/2012, interrupt event happenning once a day, in OB10 i set M0.0 to enable a timer 10 second in OB1.Here is my code:
(*)OB100:
//net 1
CALL "DATE and TOD to DT"
IN1 :=D#2012-12-24
IN2 :=TOD#23:30:0.000
RET_VAL:=#set_DateTime
CALL "SET_CLK"
PDT :=#set_DateTime
RET_VAL:=#error
//net 2
CALL "EN_IRT"
MODE :=B#16#0
OB_NR :=0
RET_VAL:=#error
CALL "DATE and TOD to DT"
IN1 :=D#2012-12-24
IN2 :=TOD#23:30:0.000
RET_VAL:=#interrupt_DateTime
CALL "SET_TINT"
OB_NR :=10
SDT :=#interrupt_DateTime
PERIOD :=W#16#1001
RET_VAL:=#error
CALL "ACT_TINT"
OB_NR :=10
RET_VAL:=#error
(*)OB10:
SET
= M 0.0
(*)OB1:
A M 0.0
L S5T#10S
SD T 0
A T 0
R M 0.0
but the simulation result on plcSim is that M0.0 is not set as well as T0 is not turned on ! hope someone can help me!