just wondering about event tasks

escoplcguy

Member
Join Date
Jun 2010
Location
New Jersey
Posts
191
i wanted to know if you could have simultaneous event tasks....meaning more than one running at the same time. i have a line that is measuring blocks, everyone here likes it they would like to implement this on 3 more lines........if i got a compact logix controller and set up each line with its own event task if all 4 lines were running and 2 or more lines sent a block through at the same time (their manually pushed through a seriers of laser sensers) and the event being a photoeye lets say would both events run at the same time to measure and accept/reject the block?



thanks guys
 
The Logix5000 controller is single-threaded, so it does not run logic "simultaneously". Instead as Events occur they are added to the processing thread. You assign priority to determine interrupt priority.

So see the following for an example:
  1. Start a scan with the continuous task
  2. Event A occurs
  3. Interrupt the continuous task and jump to the Event A task
  4. Scan Event A task one time
  5. Resume continuous task
  6. Finish the continuous task
  7. Restart the continuous task
  8. Finish the continuous task
  9. Restart the continuous task
  10. Event A occurs
  11. Interrupt the continuous task and jump to the Event A task
  12. Scan Event A
  13. Event B occurs and it a lower priority than Event A
  14. Finish one scan of Event A task
  15. Jump to Event B task
  16. Scan Event B task one time
  17. Resume continuous task
  18. Finish the continuous task
  19. Restart the continuous task
  20. Event A occurs
  21. Interrupt the continuous task and jump to the Event A task
  22. Scan Event A
  23. Event C occurs and it a higher priority than Event A
  24. Suspend Event A task
  25. Jump to Event C
  26. Scan Event C task one time
  27. Resume Event A task until one scan completes
  28. Resume continuous task
  29. etc.......
Hope that helps.
 
so basically for this to be perfect and fool proof than i need either more PLC's or put everything on a continuous task and hope that scan time doesnt get too high??....


for my paticular application i am trying to run 4 lines at the same time on one plc...its not a huge program, all we are doing is measuring a block and passing it or failing it based on our tolerance levels. but we would like to do this on 4 lines and use rsview as him for display and calibration....


if i used a compact logix and used event tasks it wouldnt work because they can not run at the same time and in the even that all 4 lines all pushed a block through at the same time one would get the data needed and the others would not??

i am aware scan time is very fast but were on gravity convayors with operators pushing the blocks so the program cant tell the blocks to wait for other events to finish.


hope this all makes sense
 
Is your system so fast that the milliseconds that it would take to scan really going to cause an issue?
If that is the problem then you are probably going to have issues from the inputs not updating fast enough. I don't have the books infront of me but I don't think you can get the input card update time that fast can you? I want to say that the card only scanned at 5ms minimum.
 
if it does turn out that the CompactLogix doesn't quite have the horsepower required to handle your system, you might consider moving up to the ControlLogix platform instead ...

since the CompactLogix and the ControlLogix both use the same RSLogix5000 software for programming, many people assume that the platforms operate the same ...

actually they are quite different "under the hood" – particularly where I/O processing is concerned ... the ControlLogix can run faster ...
 
Shoving all the logic into the Continuous task is actually going to result in a much longer scan time than using event tasks. Event tasks only run when the event occurs as opposed to the continuous task where all the logic within runs all the time every time.

Event tasks are event-driven interrupts that have priority over the continuous task.

OG
 
@Jeff.....the milliseconds wouldnt be a problem if when the event was taken place and the scan starts as the scan is taking place and another event trigger happened will it start to scan that task as well?

a problem i see is the line will get backed up....and a block will go under a measuring machine and not make it out until it has the room, so yes it took milliseconds to scan that task but the task isnt finished it is still waiting on a photoeye to become unblocked and the analog signal to reach 0 in that time is was just scanning and scanning and scanning that task but another block on a different line went under a different measuring machine, did that task start up and begin its scan or am i still waiting for the last task to complete.

imagine pushing 600lb blocks on a convayor, these blocks arent moving very fast, and dont always make it through the measuring station......this is why i cant accept/reject a block untill the last photoeye is on and the analog signal reaches 0

we also have 3 points of measurment, the front edge which is captured as soon as the block enters the station this is critical as the block slopes up by an inch. we capture the middle of the block which is judged by a photo eye on the side of the convayor and this is also critical...and last the rear edge.....our tolerance for accept reject is an +/- 1/8th of an inch so if we miss these points that block is failing because of our slope.

this is why i ask about them running simultaniously.....its not even a matter of how incredibly fast its running its scan then switching back and forth (i know its still important) as much as can it do 2 or more at the same time.

currently i have this set up on one line with a slc 5/03 and its doing great so far......my last recorded scan times are...
Maximum [x10 ms] = 3
average [x10 ms] = 1
current = 1
watchdog = 10
last 1ms scan time = 6
 
I think you may be misunderstanding what an event task does. The processor doesn't enter the event task and stay there until the end of the "Event" to the exclusion of all else. It is simply an interrupt task that runs as a result of an event. If you refer to Operaghost's first post, line 4 should be a sub-millisecond event. If you are doing more than recording a couple values and making a quick comparison in the event task you probably have too much stuff in there.

If you are currently doing this on an SLC 5/03 I don't think you have too much to worry about moving to CPLX.

Keith
 
What Keith said!!

The Event task is used to react to an Event faster than the scan cycle would normally allow.


The controller adds that logic to the normal scan. It does not run instead of other logic, it runs with other logic. Review my list above.
  • Step 1-6 represented one complete scan with one event occuring
  • Step 7-8 represented one complete scan with no events occuring
  • Step 9-18 represented one complete scan with two events occuring
  • Step 19-end represented one scan complete with two events occuring
OG
 
escoplcguy;433417this is why i ask about them running simultaniously.....its not even a matter of how incredibly fast its running its scan then switching back and forth (i know its still important) as much as can it do 2 or more at the same time. [/quote said:
Let's put it this way....

I have one rung of logic reading Photoeye A to trigger Output A and I have one rung of logic reading Photoeye B to trigger Output B.

When the PLC scans the logic, it does not scan those rungs simultaneously, it scans the logic sequentially, from top to bottom. The top is the beginning of one scan and the bottom is the end of one scan.

Let's say now I decide to use subroutines. I write logic where Photoeye A calls Subroutine A. Within Subroutine A I have logic that controls Output A. I have a similar setup for B.

When the PLC runs that logic lets say both photoeyes are made. Do those routines get scanned simultaneously? Again, no, they run sequentially. The scan jumps from the main routine to Sub A. It runs Sub A once (not, "until it finishes") and then returns to the main routine. Then it jumps to Sub B and runs it once. Then it returns to the main routine where we finish one scan of the program. We then start all over with a new scan where in all probability we do the exact same thing again. Until one of those routines "finishes".

An Event task would simply make the act of jumping to the routine happen immediately when the event occurs instead of waiting for the scan to reach the rung that calls the routine.

That description got a lot longer than I intended, but hopefully it helps a little.

OG
 
Maybe I've missed something, but I didn't think CompactLogix was able to support interrupts. I've always had to use a ControlLogix to get a COS interrupt. Or maybe someone could elaborate when an Event Interrupt is useful over, say, just calling a function block or sub-routine. Seems to me the only really useful interrupt is COS type. Om my equipment I use COS interrupts (or the EII function in a Mlogix1100) for encoder tracking of products on a conveyor belt. I'd LOVE to find a way to do that in CompactLogix.
 

Similar Topics

Good Morning , I think I have upper management convinced to begin replacing our SLC 500 PLC's . It is incredible the increase in price on SLC...
Replies
1
Views
2,025
Hey all, I've recently been asked to help spec some SCADAPack controllers for a project. I'm specifically being asked if the E series...
Replies
12
Views
8,001
Hi I just were sitting in my desk and was wondering if by any chance any of you worked for Eaton in Aurora or Berea in Ohio. Aurora was full of...
Replies
0
Views
1,625
Wondering how to "defeat" the left hand most timer in Logixpro I/O simulator Wondering if any one can help answer the attached two questions...
Replies
3
Views
2,197
I'm working with SLC 500 Data File. I have a few numbers like 8.313452e+07 . I forget , how do you convert these numbers . Thanks so much.
Replies
11
Views
2,478
Back
Top Bottom