SLC500 switching logic options

VBPLC

Member
Join Date
Sep 2005
Location
Kohler,WI
Posts
2
I have a simple application where I need to add a cylinder that constantly goes back and forth to divert product, but uses no prox switches, only time base.
I thought about just using a timer then latching and unlatching it with a second timer, each done bit firing opposing sides of the cylinder air feed.
But for some reason I'm having a brain **** and keep confusing myself. Can anyone suggest a better way of programming this logic?

Dazed and Confused

PS I started looking in to sequencing, got a massive headache and created the mess I'm in.. so don't go there, unless you can explain it to your 10 year old and make him understand.
 
Yes, it can be confusing sometimes... ;)

Here's one of many solutions:

| TIM 2
|----]/[--------------( TIM 1 ) EXTEND TIME
|
| TIM 1
|----] [--------------( TIM 2 ) RETRACT TIME
|
| TIM 1
|----]/[--------------( EXTEND )
|
| TIM 1
|----] [--------------( RETRACT )


This is essentially a flasher, so the cylinder will cycle continuously. I can't believe you don't have something to initiate the cycle (i.e. a photoeye on a conveyor), so just in case, here's the same thing with a START contact:

| START TIM 2
|----] [---+---]/[----( CYCLE )
| |
| CYCLE |
|----] [---+
|
| CYCLE
|----] [--------------( TIM 1 ) EXTEND TIME
|
| TIM 1
|----] [--------------( TIM 2 ) RETRACT TIME
|
| CYCLE TIM 1
|----] [-----]/[------( EXTEND )
|
| CYCLE TIM 1
|----] [-----] [------( RETRACT )

This will cycle once each time the START contact turns on, as long as the START contact is not ON for longer than one cycle.

EDIT: I just realized you're using a double solenoid valve, so I added an additional rung to each. I would probably put a timer on those outputs to produce a pulse just long enough to switch the spool, rather than leaving them on continuously. I think you can handle that part... :nodi:

🍻

-Eric
 
Last edited:
You could also:

Drive a counter with a preset of two using a self-resetting timer. Use the counter's LSB to control the A/B signal.
 
You could also use one self resetting timer and a compare. Set the timer preset for the total time, then use a GRT 50% of the value to fire the cylinder on direction and a LES 50% for the other.
 
The two timer method you suggested should work, and I would say is the simplest to understand. In fact, it was one of the mandatory labs that I had to do in school. I think you should be able to find some kind of post on this website. I also think this way would be the best, as it leaves you ultimate control if variables ever change, like if you want it to extend for a different time as retracted etc. One thing I've learned is that just just because it's what they want now, doesn't mean it's what they want later. :)

Russ
 
Thanks anyway

Thanks guys but my boss opted to put in a chain driven diverter instead. I've been replaced with low tech... again
 
Last edited:
PS I started looking in to sequencing, got a massive headache and created the mess I'm in.. so don't go there, unless you can explain it to your 10 year old and make him understand.

diverter_sqo.JPG



Here is how you would do it with a sequencer.
Bit B10:0/0 is the bit to command the diverter to the left.
Bit B10:0/1 commands the diverter to the right.
This logic has the diverter spending 10 seconds right and 10 seconds left.

Each time the timer times out it will set the DN bit - then reset itself on the next scan.

The first time T4:0 times out it will advance the sequencer from position 0 to position 1 (R6:0.POS=1) where it will place the word in B10:2 into B10:0. Notice that B10:2/0 is set - so when it is moved to B10:0, then B10:0/0 will be set.

The next time the sequencer advances, it moves to step 2 (R6:0.POS=2), moving the word in B10:3 to B10:0. Bit B10:3/1 is set and B10:3/0 is clear, so when it is moved, B10:0/1 will be set and B10:0/0 will be clear.

Now the sequencer has reached its length (position 2) and the next time the timer is done, the sequencer will wrap around back to position one, repeating the sequence by moving B10:2 into B10:0.

Clear as mud?
I use the sequencer instruction all the time and find it to be very useful.
 
Last edited:
This sequencer logic will operate as above, using the same bit file as above, but it will funciton with independent times for diverter left and diverter right. Note that in this example some extra logic is used to start the sequencer and move it off from position zero (R6:0.POS=0 - sequencer reset position).

diverter_sqo_2x.JPG



While I do use sequencers all the time, I would probably not normally use one for this kind of a problem. However, this is a short simple example that hopefully helped you understand the SQO instruction.

I avoid the SQI instruction however. Its easier to condition the SQO rung logic rather than pair the two, and it makes the rung function more obvious.
 
Yea, something like that.
I kinda assumed he would fill in the blanks.... I was just trying to explain sequencers, without muddying it up with a whole solution. Since he is driving a simple diverter I wouldn't write to O file (though I guess he could make the mask OOO3h) but to a B or N word. Using a B or N word as the destination just seems cleaner to me - besides, I like to see the output bit on an actual rung for easier reading.
 
Alaric said:
Using a B or N word as the destination just seems cleaner to me - besides, I like to see the output bit on an actual rung for easier reading.
I agree.

When do you like to use B words versus N words?

I usually only use N files for integers.

Do you sometimes look at N files at the bit level?
 
Generally, I use B words when I am writing an integer that I will access primarily by bits later in logic. N words and B words are completely interchangable in every way except one. You can do math, compare, move, etc with B words, and especially handy, you can use CLR on B words (and O words as well). Naturally you can access N words at the bit level. I have seen programs where the programmer didn't even use B words but did everything, including all the booleans, using N words. Its perfectly acceptable as far as the PLC is concerned.


However B3/45 is a valid address, but N7/45 is not; you have to use N7:2/13. Since I like the sort notation, when I'm going to be accessing the bits with boolean instructions (as in the SQO destination word) then I usually use B words in those instances. (I didn't use short notation in the sequencer explanation above because I wanted to make it obvious which words/bits were being moved where)

Slightly off topic, here is a hint for a slick trick using N word bit access.
To determine if word N7:15 is negative or positive, one could do do a compare:
LES N7:0 0
But this is much easier:
XIC N7:0/15 - if bit fifteen is set, the word is negative.

You can access a bit of a timer ACC or counter ACC to perform periodic tasks. For example, ACC/1 of a one second time base timer creates a pulser, 2 seconds on, 2 seconds off. Using a Counter ACC/0 is a quick and dirty flip flop.
 
Alaric said:
XIC N7:0/15 - if bit fifteen is set, the word is negative.
Very Cool.
And if bit 0 is set then the word is Odd.:nodi:

Thanks for the info. I thought that files were pretty much interchangeable.
I didn't know about the short notation thing.
:site:
 
VBPLC said:
Thanks guys but my boss opted to put in a chain driven diverter instead. I've been replaced with low tech... again

I was going to comment what is wrong with low tech? Now that I think on it - you are not allowed to build a playground?? The sequencer was way too complicated for what you wanted to do. It would work though.

There is the KISS principle which flies in the face of hi tech at times. BUT it has worked well for years.

Just so you can tell me to practice what I preach
On my electric vehicle project I should go with DC drive
instead of AC drive using a VFD.
- hmmm to really adhere to KISS / low tech -- maybe DC with relays and dropping resistors instead of solid state controller ??


Dan Bentler
 
leitmotif said:
The sequencer was way too complicated for what you wanted to do. It would work though.

There is the KISS principle which flies in the face of hi tech at times.

I agree completely Dan. A sequencer would not be my choice to address this application. But since VBPLC tried a sequencer and asked for a simple explanation, I do hope I was able to explain it satisfactorily.

I would probably use some logic more like
divert3_0.JPG

which is pretty simple.
So I waould ask: Is a chain driven diverter really simpler? An air valve and cylinder is pretty simple, especially when you consider chain diverters linkage, drive, starting/stopping, lubing, adjusting, etc.
Sometimes High-tech is the best way to implement the KISS principle. So should they nix the chain driven diverter - thats what I would recommend.


(As the antithesis of the KISS principle I admit that I have thought about suggesting a sequencer solution for a flip flop next time someone comes looking for a homework answer - maybe one with a 100 element data table to enter - :D)
 

Similar Topics

I am considering switching SLC 5/05 to compactlogix. Is this an easy transition? Is there software upgrade involve? Is the instruction set the...
Replies
7
Views
6,598
I have a slc500 plc 1747-L30A. Using a communication cable 1747-PIC cable box combination. Running a version of software from DOS on a Windows 3.1...
Replies
8
Views
188
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
314
can the slc500 5/05 send a email and text over Ethernet ?
Replies
3
Views
207
Hello, did anybody know, if there exist an converting cable like the1492-CM1746-M01 (for an 1746-IB16 to an 5069-IB16), for an 1746-HSCE to an...
Replies
3
Views
411
Back
Top Bottom