EVENT task issue

xltek

Member
Join Date
Nov 2011
Location
China
Posts
16
I'd like to know if event task is not suit for TON instruction inside? I use event instruction to trigue an event,Inside event task, a TON.DN bit never turns on no matter how long of period I set in preset, however, .TT bit could be on, if I want this event to excute a timer and several rungs of programs, how dose it works? pls give me you advise. Thanks
 
xltek : you must first understand a few things ...

1. Timers are NOT timers.

They are just instructions which when they execute, do a comparison between the PLC clock, and a stored value hidden inside the timer data.

The timer accumulator is then updated with how much real-time has elapsed since the timer instruction was last executed.

Then the instruction checks to see if the Accumulator value (.ACC) is greater than or equal to the Preset (.PRE).

If it is, then the instruction sets the .DN bit, and turns off the .TT bit.

2. So, because of 1. above, timers will only give the appearance that they are working if the rung on which they sit actually gets scanned by the processor at regular intervals.

3. The code in event tasks only executes when the event occurs, once only (per event). After it has executed this once, it doesn't continue to function, so your timer will not update until the next event triggers the event task.

4. An Event Task is "most often" triggered by an external event, such as a specific input bit or pattern occurring, or a data-change of a consumed tag (tag data from another processor).

Summary :...
Using the EVENT instruction in your normal, continuous task is very similar to just conditionally executing a subroutine with the JSR instruction.

If you give more explanation of what you are trying to achieve, we can advise further.
 
Thanks

Thanks guys. I am just trying to use event task instead of regular JSR to see task's benefits such as efficiency. for example, alarm signal, I try to use to event task to shutdown, but if the shutdown process needs to execute rungs of programs and keeps for 30s, it seems it has problem. Am I right?
 
Yes, you are right.

As I said the code in the event task will execute once, and once only, each time the "event" occurs.

So it is not suited to a "process" that needs to run for a specific time period.


It appears you need to re-learn, or modify your understanding of, how the processor "scans" the code.

The Continuous task executes cyclically, so a timer is "seen" to have completed after as many scans of the code is needed.

A Periodic task is executed once only at a specified time interval.

An Event task is executed once only in response to a trigger (an event).

Most importantly (in your case), code execution does not wait for a timer instruction to be completed.
 
Last edited:

Similar Topics

Have you ever implemented an event driven periodic task in CLX? How'd you go about it? I have a task that needs to be executed at least every...
Replies
9
Views
2,448
I'm trying to create a new Event Task in a Logix 5000 program I am writing, but I can't seem to create it the way the manual says I should. As...
Replies
1
Views
1,885
hi dears i use from advantech apax-5520KW plc and i use from Multiprog software for programming it. i need to use from interrupt in my program...
Replies
6
Views
1,780
First time using an Event Task in Logix. And what I see makes no sense before I even start... Created a new Task, and under "Configuration" Type...
Replies
4
Views
2,923
My scan time is to hign to see an input thats comming on. I am trying to use an Event Task to see it faster. For some reason its saying "the input...
Replies
6
Views
2,202
Back
Top Bottom