SQO command help

dtong_ck

Member
Join Date
Apr 2003
Posts
5
Attached is another picture of SQO command. Why is there no condition in the SQO Command. I know the second rung is to move a 1 to N14:12 which is 10 bit long, that is N14:12/1,N14:12/2 and so on.Correct me if I am wrong. What i don't get is why will the programmer do this. After the 1 is moved to N14:12 then what? If he will use the bit in N14:12, why bother to move it there? Well, there must be a reason, it is just that I don't know. Therefore I need help here.Thanks.

sqo.jpg
 
Good question

It always amazes me how much my old programs don't make sense when I look back on them. I wonder what the heck was I thinking when I did this? The person who wrote this program is the only one who knows what was going on at the time they did this. As to the unconditional SQO, that is a new one on me. Obviously the SQO will step with each scan of the processor over and over and over again but to what avail? Only the programmer knows that for sure. The other rung is a little easier to understand. The MOV appears to put a 1 in the R6:34.POS location which is to reset the SQO to position one of the sequence. For what earthly reason I am at a loss to say since the SQO is operating unconditionally.
 
Last edited:
I would guess he is manipulating the R6:34.POS word elsewhere in the program, If you look at the cross-reference below the R6:34.POS MOV at the very bottom of the picture you can see R6:34.POS is used in a lot of MOV's.


Less likely, the SQO instruction could be scanned by a conditional subroutine call. Therefore the SUB would only be called when the program has determined that the current step is finished. Of course, SQO EN bit would have to be cleared or something of the like.


Obviously the SQO will step with each scan of the processor over and over and over again but to what avail?


From what I know of an SQO instruction a false to true transition causes a "step". So from what we can see here (if the above was the whole program) the SQO would never step.
 
Last edited:
The SQO instruction is really little more than a CTU (Counter) instruction merged with a MVM (Masked Move) instruction using indirect (or more accurately, indexed) addressing.

Like a counter, the SQO does not increment unless the rung conditions go from false to true. But like the MVM instruction, the copying of the bit pattern from the source to the destination address unless the rung conditions are true.

What the guy who programmed this is doing is using the MVM characteristics of the SQO, and doing the stepping logic elsewhere, by manipulating the value of R6:34.POS (looking at the cross-reference of R6:34.POS that you show bears that out).

You could replace SQO #N14:0 N14:12 R6:34 instruction with MOV N14:[R6:34.POS] N14:12, and the system would behave identically.
 
My opinion-

The guy who programmed this, was probably not an AB mastermind. He probably tried to relate how his "favorite brand" sequencer works and tried to adapt it to work here, seemingly the easiest to him, to get the job done.

As Allen pointed out, this is an overcomplicated (looking) indirect MOV, as he is not even using the mask function of the SQO. But he is burning up an additional 2 words of memory using that R6 file, rather than an integer as the indirect pointer, not that the extra 2 words are a big problem, but in some cases efficiency is important.
 
Another thing I noticed....

dtong_ck said:
I know the second rung is to move a 1 to N14:12 which is 10 bit long,

The length field is words not bits.

The second rung moves a 1 into the control word position of the SQO instruction not the destination of the SQO instruction. In other words, it (probably) resets the sequencer.
 
The Cross Reference Display check boxes are greyed out in the Address Display section of Properties.
Is this because I have RSLogix 500 Starter version 5.00.10?
:unsure:
 
Thank you all for the replies.

The company who build machine for our plant before is call Centerline. Their programs are written like the electrical schematic diagram logic. There is no SQO at all. There are some MOV and of course BSL command for tracking parts. I find these programs are easier to understand.

Now, i have to deal with those new program because I am the one who maintain the machine.
 
Final thoughts?

Yeah, sometimes I only wish I had final thoughts. But earlier today when I posted my reply about the SQO executing every scan, well duh on me, I know it has to toggle from false to true to step. I think trying to mix replacing disc brake rotors on my Ford and doing cerebral stuff like figuring out some else's code, don't necessarily mix. I did get the Ford back on the road and I hope you have good luck being responsible for that machine.

Now, I have to deal with those new program because I am the one who maintain the machine.

I hate trying to figure out what I did some time back let a lone looking at another programmers code and trying to do the same thing. It is very difficult to know what was in my mind at the time and knowing another persons thoughts, well darned impossible. You can only take what they did at face value and go from there. If I were you, unless you love a good challenge, just keep the same program as long as it meets your needs. If you have to do a major overhaul or upgrade, consider going with more conventional ways of accomplishing what the other guy did with the SQOs. I have always felt that the simplest approach to solving a problem is the best. There are those who love to do things in a complex manner just because they can. However, following behind them is not a treat. But ya know, one day they may have the opportunity to say, "I wonder what I was thinking when I did that"? Sometimes you have to follow yourself in this business.
 

Similar Topics

I have a program that I've used 100 times. SQO settings: File N7:0, Mask 0FFFFh, Dest B3:1, Control R6:0, Length 8, Pos 2. Length & Position...
Replies
48
Views
957
Hello I am trying to make a program work with a sqo instruction .The process has 5 steps ,and a starting step of zero.There should be 8 sec...
Replies
17
Views
1,050
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,458
I have an air press that I built ages ago, and it has been running forever. It was originally designed with Rotary Cams and Air actuated buttons...
Replies
1
Views
1,504
Hey guys Having a bit of an issue here. I want my SQO to reset on startup. Im using an (res) on the SQO with the first scan bit with nothing...
Replies
3
Views
1,373
Back
Top Bottom