Delay Ouputs

tonzur1

Lifetime Supporting Member
Join Date
Nov 2016
Location
US
Posts
3
My first post so I am going to try my best.:D

I am totally new to RSlogix 5000, all my previous work was on 500.

I am working with a CompactLogix and a point I/O. This is an assembly line and I have inputs reading parts moving in station 1 which is few meters from station 2. I need to power the outputs in the station 2 base on the readings of the inputs in the station 1 for every part. Meaning I read a part in station 1 and the outputs will have to come on whatever time it takes to get to station 1( This time is a variable that I will have).

I do not see a way to use regulars timers because then I will have to use one for every time a part goes by so if I have parts going every 1 second then I will need as many timer as the time to reach one station to the other.

I hope this really make some sense:confused::confused:
 
Welcome to the Forum.

You didn't mention how the part is transferred from Station 1 to 2. You mentioned a few meters, so I guess it is a conveyor.
You had means to detect part at both station, so you need another sensor or any other means to detect the transfer. Maybe a sensor which trigger once or a fixed number of times when your part is moved. With this, you can use a shift register. There are many thread about shift register [BSL]. Search in this forum and you will find it.

Regards
 
chavak. thanks for the response.
I did not get into the details and maybe that did not help.

The system is a paint line moving in a chain. What I call station 1 is the area where we measure the size of the part (like an encoder but instead discreet sensors) they are like 2 meters away from the paint guns (station 2) .

The outputs are to move the paint guns base on the size of the parts that were read. So the problem is I have to constantly move the guns base on the size of the parts going through. I can not place sensors in the paint gun area. So basically I read the size of the part and when the part reach the guns (is a fixed speed) they have to move to the position indicated by the sensors previously. so there is a time difference and parts could make the guns move as much as every part that goes by. :confused:
 
[Update: I had it backwards; FFL Loads new values at the end of the FIFO array and FFU Unloads them from element 0; but the basic idea is the same. I tried to edit the text here, but I am not sure it is correct now, so caveat emptor.]

@Chavak mentioned BSL, and that works if the information being measured at station 1 and read at station 2 is one bit (e.g. present or not).

Now that we know that the information is more involved e.g. an INTeger, then a FIFO is probably the way to go. A FIFO is basically the same concept as a BSL, but with more bits being moved in parallel. A FIFO is implemented with the FFL and FFU instructions, plus an array of some atomic data type, more or less the same as in RSLogix 500; see this link and this link.

A search for the term "FIFO" on this forum should provide multiple examples.

TL;DR

A FIFO is an array of data, which models the process:

  • The size measured at station 1 is placed at the tail of the array (element [.POS-1]).
  • A rising edge, in this case probably driven by a timer*,
    • If FIFO array is full (.POS equals .LEN), then FFU instruction
      • unloads the size value at the head (element [0]) of the array
      • Shifts every element of the array to one position toward the head position in the array,
      • decrements .POS by 1
    • FFL instruction
      • inserts a value into the tail position ([.POS]) of the array, and
      • increments .POS by 1**
* A possibly more reliable (deterministic?) system would generate rising edges from a fixed proximity sensor detecting teeth of the sprocket that drives the chain, but either way the distance from station 1 to station 2 is modeled by some count of rising edges. If each edge is based on time, then the increment between consecutive edges represents distance as (time_between_edges * known_speed), so a reasonably constant and known speed is a precondition for that approach to work; if each edge is based on sprocket teeth and a proximity sensor, then the increment between consecutive edges represents distance as (teeth_pitch * gearing_ratio).

** I think the flowchart in the manual may be wrong - it shows .POS being incremented before inserting the new value at position [.POS] in the array. It also has a test for .POS>.LEN after a negative result of a test for .POS>=.LEN, which latter test would preclude the former from ever being performed.

If timing is used, there are better approaches than a simple self-resetting TON e.g. [XIO Timer/DN TON ...], as that technique has some noise in the actual time increment, although for a short time between stations it could probably be calibrated empirically to be good enough (e.g. a "half-second" repeating timer that actually has a .PREset of 497).

The actual implementation will depend on how the process detects when parts are at station 1 and/or station 2. For example,

  • the FFL instruction could always load an invalid size (e.g. -1) by default at the tail element of the array after it does the shift, and the station 1 process could overwrite the tail element whenever it makes a size measurement.
  • the FIFO could be oversized i.e. represent far more distance than is actually between the stations, and when station 2 detects a valid size at the known location in the array that represents the distance between stations, it could initiate the spray operation based on that size
    • This would require an FFU to unload the head element in the array once the FIFO is full (.POS equal to .LENgth), before each FFL, to avoid overflow.
 
Last edited:
FIFO sample app, MicroLogix 1100; RSLogix 5000 will be similar.

Video of running program at this link.

N.B. FFU and FFL instructions execute* once on False-to-True transition of input rung only, and do not execute* on subsequent scans where rung continues to be True. That feature is not in play in this example as the input rung condition [GRT T4:0.ACC 498] evaluating to True will be a one-shot anyway.

* "Execute" is not quite the right word here, but is close enough; what I mean by "execute" is that the FFL Loads an element, and the FFU Unloads an element; those instructions still perform some actions when their input rungs are False, but those actions do not change the contents of the FIFO array.

xxx.png
 
Last edited:
THANKs a lot I believe FIFO is definitely going to do it for me. Can you use a multidimensional (2 dimensions) array in the FFL and FFU instructions?
 
Last edited:
Now I understand what you are trying to do, I have actually done this exact thing on a spray booth, I suggest rather than rely on the conveyor running at a constant speed you fit a proximity to the drive with a toothed wheel, does not have to be fast pulses perhaps 1 pulse every 4 or 5 inches, then use the pulses to shift bits in a shift register the position of the spray heads will be say bit 50 to 75 of the shift register this allows for different sized parts & only sprays the parts.

So for example:
a Part is sensed by a sensor, while this sensor is on the pulses from the toothed wheel move the status of the part into the shift register, when bit 50 (or what ever) is true then it starts spraying when it goes off it stops
Shift register:
0001111111000000001111000000001111111111000000011111111
0 denotes no box the ones denote a box & it's length.
Sensor
|---------------------------------------------------------------------|spray head
Conveyor
 
You might look into an Allen-Bradley 842E CIP encoder. Assuming that you don't have over 100 items on the line at the same time, you can set up a virtual axis for each part to track the position of the part as it moves along, and trigger outputs based on a set position of the virtual axis. When the part is sensed, the virtual axis MAGs to the encoder and tracks it through the process. When the process completes, the virtual axis position is reset to zero, and then re-used. Because you know the position of the parts, the virtual axis can eliminate the need for timers and the need to run at a fixed speed. Just make sure that your PLC has enough memory to account for several virtual axis to run simultaneously. You would need to set up at least as many virtual axis as parts that would be running at once.
 
So for example:
a Part is sensed by a sensor, ...


I think this assumes the direction of the measured size of the part is along the direction of motion of the conveyor, and the measuring sensor is a simple proximity device i.e. "part is here" or "part is not here." The FIFO is perfect for that, it puts a delay (FIFO moved by time) or offset (FIFO moved by sensed sprocket teeth) between the 1s from the discrete sensor(s) that do the size detection, and when (delay) or where (offset) the paint sprayer is on.

However, what if the size sensors measure a different direction than the direction of conveyor motion, e.g. height above (or below) conveyor, or width across conveyor? I say this because OP (@tonzur1) said the process "[has] to constantly move the [paint spray] guns base[d] on the size of the parts ..." They also asked about a two-dimensional FIFO, which suggests there is an aspect to the measurement of the parts that is not in parallel with the direction conveyor motion.

@tonzur1: can you provide a more detailed description how this measurement is made? You stated that the size sensor(s) are [discrete], which means 0 or 1 to me, but they somehow express a "size," which usually indicates an analog - i.e. non-discrete - value. Are there several sensors aligned across (horizontally or vertically) the direction of conveyor motion? If yes, then is it how many, or the pattern of, sensors transmitting a 1 that says something about the size of a part and how the spray gun should move when that part reaches the paint gun area?
 
DR: you are right, that is what I assumed. I did a lot of work for a spray booth MFG. it is simple to do as depicted, length, but also height, did a couple of them just used a distance sensor (the height was always from the hangar so measured the height based on a sensor under the part) just used another shift integer register so the reciprocating spray heads only sprayed the part from top to bottom as well as right to left.
 
If it's a painting process, I imagine the parts will be hanging from a chain conveyor. From the wee bit of info we have, I would guess that there are several discrete sensors, e.g. through-beam, detecting how far each part hangs below the conveyor; a short part would have just one sensor that has its input value as a 1; a long part would have many or all of the sensors with their inputs as 1s.

If that is the case, the two-dimensional request could be achieved by combining each of the individual inputs to a unique bit of INT or DINT elements of the FIFO array, and using FFL and FFU to move the bits in parallel. That approach does limit the number of sensors that can be modeled to 16 or 32, or maybe 64?

When the paint gun FFUs a non-zero INT/DINT, it could find the location of most significant bit with a value of 1, and use that location (i.e. size) to control the spraying. Perhaps each bit starting at bit 0 at the top, could represent a gun position, and the code RESets the value of that bit to 0, and repeats for the next bit location if the INT/DINT is still not zero. That would allow for intermediate sensors at one height to miss the object (be 0 at those bit locations) even though the part extends lower and other bits below that are 1.

Not a complex application, but until we know more we can't really help.
 
I have never seen a paint booth where the part hangs at different distances from the chain, I have done many of these of varying types & for different companies, the "hangers" generally are all the same height & the part is designed to hang in such a way so the top of the part is at the same height (well almost) The ones I did worked on this principal the stroke was calculated from the distance of the bottom stroke limit to the bottom of the part plus a small over travel, this is not to say all are like this but it is common in my experience.
 
I have never seen a paint booth where the part hangs at different distances from the chain,

Whoops, instead of my writing
I would guess that there are several discrete sensors, e.g. through-beam, detecting how far each part hangs below the conveyor
it would have been better if I had written
I would guess that there are several discrete sensors, e.g. through-beam, detecting how far each part extends below the conveyor
The latter less ambiguously states what I meant to say.
 

Similar Topics

Build error occurs with TON ladder logic command. Time Input expected on block. Using Integer Tag under Control Local, and then hard number 19...
Replies
2
Views
734
I have an SLC 503 running a machine with a scanner and 1794 RIO. One of the functions is a register motor on a printing cylinder. The manual 3...
Replies
3
Views
1,246
Hello all, I am using a temposonic R series linear transducer for positioning of a lower ram on a hydraulic powdered metal press. The transducer...
Replies
7
Views
1,911
In the code below I have what should be, in its current condition, a simple cycling up counter with a delay before recycling. But as it is shown...
Replies
36
Views
8,104
I am stuck on where to put the 5th timer to put a 3 second delay on the red light in the traffic light program. I have a pic of my plc rungs here
Replies
7
Views
1,920
Back
Top Bottom