SQO instruction

hooter32

Member
Join Date
Feb 2011
Location
louisiana
Posts
37
Hi all. Can somebody here please give the the SQO instruction breakdown for dummies? I have seen it used a few times in some programs and have read the AB help files on it but it seems confusing to me. I see there are SQI and SQL instructions as well. Not sure how those work either. Any help will be very appreciated. Thanks.
 
SQO is pretty useful. SQI not so much. SQL can be for certain queuing applications.

Basic description of SQO:
When the SQO instruction goes true then increment the step number,
then
If step 1 the move word 1 to the destination.
If step 2 them move word 2 to the destination
If step 3 them move word 3 to the destination.
If step 4 then move word 4 to the destination.
When I get to the last step start over at step 1.

The words can be configured to write specific bit patterns to the destination.
 
Thirty years ago, I could just say "it does the same job as a drum switch". Now not many know what that was.

An SQO works like a timer on your washer, dryer, or dishwasher. It begins at the 0 (Stop) position, then upon some trigger input (a timer or other device), it advances to the next step and turns switches (outputs) on or off for that step, waits some time period, advances to the next step, turns switches (outputs) on or off for that step, continues until the last step, then stops (except the SQO repeats the cycle, going to Step 1 instead of Step 0, if not disabled).
 
Last edited:
Thanks for the replies. They reason I was asking is because I'm trying to figure out if something like that would work in an application i'm working on. I have 12 silos that will now be filled with 2 different materials. By toggling a bit on the HMI the system will know what type of material going into the silo. There is a cart on top that will ride over all the silos and fill them on at a time with the material the operator selected. If the silos were going to be using a fixed material everytime it would be no problem. The problem is making it going to only the silos with the one certain material at a time.
 
The SQO could work for that. One thing you can do is copy different recipes into the source file. You also can use the sequencer control .POS element to set different conditions for advancing each step. I recommend that if you do use SQO you make the source words a dedicated file and rather than making the destination an output word you make it a B or N word and then use that result to operate your outputs. It makes it easier to handle output permissives and exceptions that way.

I do have one caution about using SQO: Sequencers can simplify programming but sometimes they obfuscate the function of the code - making it difficult for future troubleshooting. Document your program well.
 
Last edited:
Just my 2p on SQO, SQL and SQI.

I have used them and they are very useful, but I think there is a time and a place for them. I also think that if you are thinking about using them in a program where someone with very basic knowledge of PLC's will be fault finding your PLC code, think again. Unless as TConnolly has explained you document your code in great detail you are in for some early morning calls.

In nearly all of my complex code that I write, I basically use my own sequencer, which I believe a great deal of programmers use. That is to have a step number and step on when the correct conditions are met. It makes things a whole lot easier to fault find and to follow for people.

Mark
 
Here is a quick example I threw together. Its pretty basic but it should be enough to help you see how to use it.

After looking at the program it may occur to you that you could ditch the SQO and program a series of MVM instructions with some indirect addressing that does the same thing. This is especially true if you have steps that might be skipped or repeated. It may also occur to you that you could just use a counter and compare the counter .ACC, which is very common.

If you are going to be copying different recipes to the source file though then the SQO might be easiest for you.
 
Thanks you for the replies. Basically whenever there is one type of materical selected, i need that cart to run over each silo that will be accepting material "A". it will obviously need to skip over the silos going to be filled with material "B" and vise versa. The silos will be subject to change weekly so i need to come up with a way for the system to fill accordingly. There are 100 ways to skin a cat. I would like to keep the code to a minimum. on the other hand, there are people that would be troubleshooting this with very basic experience.
 
The SQO/SQI is better suited for machines with lots of discrete I/O that tend to step through the same large number of steps in about the same order over and over. Using the SQI/SQO pair can make troubleshooting much easier if done correctly, however, I prefer not to use those instructions due to some limitations in their behavior. Instead, when called for, I use MEQ/MVM or MEQ/MOV with indirect addressing, and have separate logic to control the sequencer step value.

With that said, and looking at your description of the problem, personally speaking, I would not use the SQO/SQI instruction for this type of application.

Using an individual bit for each silo is simple enough when each silo must be configured to accept material A or material B, but what happens when along comes material C?

What if there are other reasons to skip over a silo?

Those can be combined in ladder logic, pretty easily, but once you get to 4 or more different material types, then you will want to look into using an integer to store the material type for each silo.

To better help you construct the code for the application, it would be useful to know more about the filling operation, how many carts there are, how do you know where they are, etc (a picture added to the thread is always a great way to kick start the idea train, even if it's a crude sketch).

For examples of SQI/SQO pairs:
http://forums.mrplc.com/index.php?app=downloads&showfile=854

For state machine logic (might be useful to you):
http://www.plctalk.net/qanda/showthread.php?t=52654&highlight=state+engine

Welcome to the forum!
Paul
 
Last edited:
Thanks Paul. There is one cart. It knows it's location via limit switches. Currently when it moves autmatically, it looks to see if the current silo if full (level transmitters) and it moves to the next silo that is not full that is being filled with the same material. Cart_next_position (1-12) is the tag used when it moves to the next silo. I do agree on making a INT out of the material selection. There eventually may be another fuel source (much later). There is one cart with a conveyor feeding it. It just moves back and forth in a straight line across 12 silos. Currently 2 silos are limestone which will stay constant. Silo #1 and #7 in that order. 2,3,4,5,6,8,9,10,11,& 12 will be silos with the different fuels. One week silos 2, 6,8 & 12 may have fuel "a" filled in them and 2,3,4,9,10 & 11 may have fuel "b".
By pressing the fuel select on the HMI, I need it to travel across the silos filling them accordingly. After the fuel "a" silos are full, the operator can choose to fill fuel "b" and it start over and fill the other silos.
 
yes i have it at work. I will have to look at it in the morning. Thanks. by reading the other posts I'm not sure that SQO is the right instruction for me. Seeing that it will sequence differently sometimes.
 
Last edited:

Similar Topics

I am working on a machine that is using the SQO instruction to step through a cycle, but I am getting lost following it. I have not worked with...
Replies
18
Views
3,459
how does an sqo instruction work with no bit to trigger the next step
Replies
7
Views
1,835
Can someone help converting an SQO in a SLC150 to RSLogix500? See attached JPG also attached the program. Thanks
Replies
4
Views
1,999
I am converting Old SLC 150 Program in an RSLogix 500 I am finding a problem in the understanding of the following instruction can some body help...
Replies
2
Views
1,668
Hi again, im not sure if this sqo will work and cant test it yet. cip1_seq_ctrl4 is a 2 dim array [542,150] N37_14 is a dint that goes from 525...
Replies
1
Views
1,413
Back
Top Bottom