Need some advice or pointers for this sequencer

Join Date
Mar 2015
Location
KY
Posts
16
I am programming a sequencer to turn on turn the outputs on and off in the following manner. Only one output will be on at a time. 0→1→2→3→7→11→10→9→8→4 then repeat the sequence. I have this correct so far.

But I also want to turn on output 5 during the first cycle and all odd numbered passes and have 6 on during the second cycle and all even passes with it. This is the part I am having trouble with.

I tried adding in a counter to look at the odd and even counts but could not quit figure out how to do it, Some advice and tips would be great.

I can't seem to figure out how to attach what I have done so I will try explain it.

Rung000- NO Start I:1/0, NC t4:0/DN, TON Timer to turn on each output light every .5 seconds.

Rung 001- NO T4:0/DN, SQO with File: N7:0
Mask:FFFFh
Dest: 0:2
Control: R6:0
Length: 10
Postion:0

I hope you can visualize what I have. That part works but I cant seem to figure out how to tackle the part that I listed above.
 
To attach a file, first ZIP it (forum rules).
Then, Go Advanced.
Toward the bottom is a button to Attach Files.
Just browse to the file and select it.

We really need your file to help with your problem.
 
Here is a SLC 500 program with a very basic sequencer in it. File N10:1-10 are the bit patters for steps 1-10 and N11:1-10 are the seconds to hold each step.

Use the N10:0 for the current step bit sequence to do what every you need.

This is the most basic sequencer you can use and its flexible enough you can just change the data table to make it do what you want.
 
But I also want to turn on output 5 during the first cycle and all odd numbered passes and have 6 on during the second cycle and all even passes with it. This is the part I am having trouble with.
I think you know what you are doing and have made an effort to solve your problem. I will give you some hints here to finish it up.

You need to start the sequencer on a "0" (N7:0 = "0") so that an Output 0 is not ON when your Start Switch is Off. Than means your SQO needs a length of 12 (one blank spot at Position 0, plus 11 numbers (including the 5 on odd-numbered cycles, and the 6 on the even cycles).

There are several paths you could use. One would be to set up Odd/Even Alternator logic, so that a bit would be OFF the 1st cycle, then ON on the 2nd, and so on. Then use that bit to load a new set of numbers into your sequencer after each cycle. But you would have to use the SQL instruction 2 times (or in LogixPro, 24 MOVs, 12 for each odd or even cycle). That might be difficult and long.

Another way would be to try to interrupt the one sequencer at Position 5, and turn on Output 5 or 6 depending on the value of the Odd/Even bit. Then on the next Timer DN bit, you have to turn off this Output, and then restart the sequencer. It gets hairy and iffy when you try to interrupt a sequencer and change its outputs in mid-stream.

It seemed easier to me to simply use 2 different sequencers, the first "Odd Sequencer" using R6:0 and starting at N7:0 as you have it now. Trigger the R6:0 SQO with XIC T4:0/DN followed by the XIO B3:0/0 Odd/Even Bit. That will make the Odd Sequencer on Rung 001 run on the first cycle. But change the Length to 12, and change your numbers in N7:0 so that the "5" is included.

The second Even sequencer on Rung 002 should be triggerd by XIC T4:0/DN AND XIC B3:0/0. Set File to #N7:12, Mask FFFFh, Control R6:1, Length 12, and Position 0.

Rung 003 should be your Alternator logic, where you switch B3:0/0 after each sequencer cycle. I used a counter ACCumulator bit to do the alternation. I used a paralleled combination of XIC R6:0/DN OR XIC R6:1/DN to trigger Counter C5:0. Set the Preset to 32767 (max in RSLogix), although it doesn't much matter what you set the Preset since you don't need to use the C5:0/DN bit anyway. On a parallel branch of Rung 003 (or a new rung if you prefer), use XIC C5:0.ACC/0 to turn OTE B3:0/0 "Odd/Even Alternator" on or off. The C5:0.ACC/0 bit is OFF first time, then ON, then OFF, and so on for each count.

That is the heart of this method. Now you need a rung to reset your Outputs (a sequencer can leave the last Output ON if you don't turn it OFF). So use a parallel combination of XIC R6:0/DN OR R6:1/DN to RESET O:2 to change all Slot 2 Outputs to OFF. Also on the same rung, RESET R6:0 and R6:1 to set the Sequencers back to 0 and reset the R6:x/DN bits.

Probably you will want one more rung to handle things if you turn the I:1/0 switch OFF in the middle of a cycle. Use XIO I:1/0 to again RESET R6:0, R6:1, C5:0, O:2 and T4:0.

To double-check to see if you have the right numbers in your N7 file, these are the 12 decimal numbers you need to load into your Sequencers:
Starting at N7:0: 0, 1, 2, 4, 8, 32, 128, 2048, 1024, 512, 256, 16
Starting at N7:12: 0, 1, 2, 4, 8, 64, 128, 2048, 1024, 512, 256, 16

Good Luck!
 
Last edited:
Starting at N7:0: 0, 1, 2, 4, 8, 32, 128, 2048, 1024, 512, 256, 16
Starting at N7:12: 0, 1, 2, 4, 8, 64, 128, 2048, 1024, 512, 256, 16
Looking at the numbers, really only the 6th one is different. So the first method, but simply doing one MOV after each cycle (moving a "64" to N7:5 after Odd cycles, and moving "32" to N7:5 after Even cycles) might be the easiest and best method. That would require only one sequencer, and the Alternator logic, and two MOV rung branches.

Yes, I just now tried it, using 1 sequencer, the same alternator, but removing all of the stuff for the 2nd sequencer, and adding a rung with 2 MOVs, the rung triggered by R6:0/DN, and then a XIC B3:0/0 enabling a MOV top branch of "64" to N7:5, and a bottom branch with XIO B3:0/0 enabling a second MOV of "32" to N7:5. Now there are only 6 rungs instead of 7. Probably on the last rung where you reset everything, you would need to add a MOV of "32" to N7:5 to make sure it always starts off with the odd-numbered sequence.
 
Last edited:
You may already have solved the problem but here's a way I think you could use your original attempt.

Assuming a sequencer reset to step zero:
  1. Set up a counter with any even numbered preset and a rung to reset the counter when it reaches preset.
  2. When the sequencer is reset also reset the counter.
  3. Set up a compare using R6:0.POS EQU '1' and drive the counter with it.
  4. When R6:0 transitions to a one for the first time the counter increments to '1' and you use C5:0.ACC/0 to sense odd/even and drive output five.
  5. When the sequencer moves to step two the compare goes false. The counter meanwhile retains its value and output 5 stays on.
  6. At the end of the sequence R6:0.POS will reset to '1' and the compare will again increment the counter, this time to '2'. The counter resets and ACC/0 goes false, indicating an even cycle. And so on.
 
Doug,

It depends on how you interpret the instructions. I thought they meant to insert the Outputs 5 and 6 between 3 and 7 in the natural order of the other outputs (otherwise there will be an oddball variation if each stays ON the entire cycle).

But I may be wrong.
 
I thought they meant to insert the Outputs 5 and 6 between 3 and 7 in the natural order of the other outputs (otherwise there will be an oddball variation if each stays ON the entire cycle).
Lancie1, you may well be right. I hadn't thought of it that way. Unless OP replies we may never know.
 
I am having trouble still with this. I still cannot figure out how to attach files on here as well. I attempted it Doug-P's way but output 5 isn't working and the counter will only increment to 1 and stop. I feel like I'm very close to getting this but there is just something I am not getting.
 
I attempted it Doug-P's way but output 5 isn't working and the counter will only increment to 1 and stop.
When working with a Sequencer AND trying to insert other outputs also, each time the Sequencer writes to Output Word 2, it overwrites any Outputs that were previously turned ON with a regular old OTE. So to turn ON and keep ON a single bit, the OTE must come after the Sequencer, or it will be ineffective. An option is to use a Mask (FF9Fh) with the Sequencer that masks bits 5 and 6 so the sequencer does not override the OTEs.

Here is a working LogixPro program that does the trick. Because the Counter-used-as-alternator starts at 0 (an even number), the first pass will be Even, followed by Odd when C5:0.ACC = 1. I turned on O:2/5 on the first even pass, but if you want O:2/5 ON during Odd passes, then modify Rung 002.

Sequencer- Even then Odd- Gobbling Ganster V3.jpg
 

Attachments

  • Sequencer- Even then Odd- Gobbling Ganster V3.zip
    847 bytes · Views: 12
Last edited:
Add a flip flop into each of the steps. If the bit you are flipping is on do odd step, if the bit is off do the even step.

Maybe make the flip flop sequence a subroutine and just call it when you want to flip/flop

That way if your program ends on a even number it won't flip to odd when you start at 0 again
 
Last edited:

Similar Topics

I'm currently working on a PLC setup and could use some advice on the best way to manage my power supply units (PSUs). Here's the configuration...
Replies
3
Views
407
So, I'm about to start my first ever project that include a servo motor Here some of the component i bought for the project so far: - PLC: Omron...
Replies
0
Views
388
Dear connoisseurs of antiquity and non-standard solutions, welcome) I don’t really hope, but suddenly someone had a deal and, most importantly...
Replies
0
Views
581
Hey guys, We have a metal container at work, we fill with saw dust (20fts x 15fts x 10fts) with the top open but we normally put a container...
Replies
4
Views
1,544
heya guys, For my project, i'm currently looking to add this type of linear encoder. The control company i'm working with told me they had bad...
Replies
6
Views
1,214
Back
Top Bottom