simulate OB10 ?

nqchanh

Member
Join Date
Dec 2012
Location
Ho Chi Minh city, in Viet Nam
Posts
15
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!
 
With the TOD settings you are using, you will have to wait one day for the timed interrupt to occur. Modify OB100 n/w 1 to set the current time to TOD#23:29:0.000, then you will only have to wait one minute for the timed interrupt to occur and set M0.0

(NB - next time you post code, please post in absolute address format)
 
With the TOD settings you are using, you will have to wait one day for the timed interrupt to occur. Modify OB100 n/w 1 to set the current time to TOD#23:29:0.000, then you will only have to wait one minute for the timed interrupt to occur and set M0.0

(NB - next time you post code, please post in absolute address format)
thanks L D[AR2,P#0.0] !it's well-done now ! ^~^
 
(NB - next time you post code, please post in absolute address format)
sorry, but i can't find the tool for edit code in the absolute format as you said on Edit window ! please show me more ! sorry for the uncomfort!
now, i'd like to ask about OB31.Here is my code:
(*)OB100:
//net 1
CALL "DATE and TOD to DT"
IN1 :=D#2012-12-23
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#2
OB_NR :=31
RET_VAL:=#error
(*)OB31:
SET
= M0.0
but OB31 doesn't work ! what's wrong with my code ? hope for help !
 

Similar Topics

Hi there, I'm doing some extensive testing and commissioning with a slew of new Emerson PACSystems RX3i PLCs. It would be convenient to...
Replies
5
Views
100
Hello, I have a small application with a S7-1200 CPU 1212 and a KTP400 Basic HMI. When i am connected to the PLC with my PC i would like to...
Replies
1
Views
544
Hello everyone, i would like to test and run os server in pcs7 v8.2 project without rear PLC.i used plcim on ES and nettoplcsim and adjust the...
Replies
4
Views
1,333
Hi all, Im new to Allen Bradley software, so i was given a existing studio 5000 plc program. i already know how to use emulator and rslinx but as...
Replies
2
Views
1,409
I want to run a simulation of a program uploaded from a rockwell PLC, but I can't configure the CPU on the emulate to match the actual CPU.
Replies
10
Views
2,229
Back
Top Bottom