Need help with small program

Ayejay

Member
Join Date
Dec 2023
Location
Townsville
Posts
1
Hi all,
I’m new to programming and want to write a simple routine.
Push start button, turns on sensor.
2 second delay before anymore logic read.
When sensor is triggered alarm 1 sounds for 5 seconds then alarm 2
Sounds for 5 seconds.
Then reset and wait for start button.

This is what I have done but not quite right


IF _IO_EM_DI_00 THEN

_IO_EM_DO_00 := TRUE;

TIMER_DELAY(IN := TRUE);

END_IF;



IF TIMER_DELAY.Q THEN

IF _IO_EM_DI_01 THEN

_IO_EM_DO_01 := TRUE;

TIMER_ALARM1(IN := _IO_EM_DO_01);

END_IF;



IF TIMER_ALARM1.Q THEN

_IO_EM_DO_01 := FALSE;

_IO_EM_DO_02 := TRUE;

TIMER_ALARM2(IN := _IO_EM_DO_02);

END_IF;



IF TIMER_ALARM2.Q THEN

_IO_EM_DO_02 := FALSE;

RESETSYSTEM := TRUE;

END_IF;



IF RESETSYSTEM THEN

_IO_EM_DO_00 := FALSE;

_IO_EM_DO_01 := FALSE;

_IO_EM_DO_02 := FALSE;

END_IF;

END_IF;
 
Read the red statements in order: (1); (2); (3); (4); (5).



if _io_em_di_00 then
_io_em_do_00 := true;
timer_delay(in := true);
end_if;

if timer_delay.q then

if _io_em_di_01 then
_io_em_do_01 := true;
timer_alarm1(in := _io_em_do_01); <= (3) which will reset timer_alarm1, and timer_alarm1 value will be 0
end_if;

if timer_alarm1.q then <= (1) when timer_alarm1.q becomes 1,
<= (4) so this IF will no longer evaluate to True

_io_em_do_01 := false; <= (2) _io_em_do_01 will be assigned a value of 0
_io_em_do_02 := true;
timer_alarm2(in := _io_em_do_02); <= (5) and timer_alarm2 will no longer be evaluated and will never expire
end_if;

if timer_alarm2.q then
_io_em_do_02 := false;
resetsystem := true;
end_if;

if resetsystem then
_io_em_do_00 := false;
_io_em_do_01 := false;
_io_em_do_02 := false;
end_if;

end_if;

 

Similar Topics

Hello all, I need help in a small plc program in Allen Bradley plc. Need to generate a 1 second pulse on every ON and OFF of a bit. Suppose for...
Replies
4
Views
2,111
Dear sir. i have one Automation Direct hmi, if you have the CMORE Programming software,i will send you .eap file in email, can you please...
Replies
3
Views
2,443
Hi guys we are constructing a small production line 5 km away from our factory that includes hydrolic presses and small machines. We want to get...
Replies
8
Views
3,954
So i've been at this for a long while, i have Citect Scada 2018, i have full access to everything but i can't seem to find any option or...
Replies
0
Views
23
I'm fairly new to Rockwell software, I've had some basic training in the past but nothing too advanced. My company and I use Reliable products for...
Replies
11
Views
342
Back
Top Bottom