SQO and SQL

toarts

Member
Join Date
Apr 2010
Location
San Jose, Calif
Posts
30
Hello everyone: This is my first time posting a thread to this website. I am just starting to learn PLC (RSLogix Micro Starter lite). I am now trying to learn SQL and SQL sequencer. I understand how the components work i.e. file, destination, length and so on. however when I actually write the logic in the rung I couldnt get it to work. The way I wrote the logic was, i called an input and called the SQO instruction at the output. I know it is not as simple as calling the SQO instruction at the output of the rung. there is gotta be more into it. can someone help give some hint or sample. thanks toarts
 
welcome to the forum ...

which Ladder File did you put the rung in? ... if it's NOT located in Ladder File #2, then you need to put a JSR instruction in Ladder File #2 to "call" the file that you used into "execution" ... if that's not your problem, try to ZIP your RSS file and attach it here to another post ... we'll be glad to help you get it working ...

and the link below should give you an example of the SQO ...

http://www.plctalk.net/qanda/showthread.php?postid=63303#post63303

survival tip: hold off on the SQL - and get the SQO working first by manually "loading" the bit patterns into the file ... then (if you want to go further) start experimenting with the SQL ... hint: that instruction is NOT very often used in the "real-world" ...
 
Last edited:
SQL SQO Help

Hello Ron, thanks for your help. I did look at the sample link you provided. let me understand what your logic does. pls correct me if i am wrong. You used the T4 DN bit to enable SQO intruction. so everytime the T4/DN become high, N7 bit goes high i.e. N7:1 to N7:10 since the lenght is 10. what does the copy instruction does N7:10 to N7:20?

You may laugh at me :) this is a rookie job, the RSS I provided, there is actually just 2 rungs in there, input switch calling SQO intstruction at the output of the rung. I have a PLC tester device that has 4 outputs O/0 to O/3, it has 4 led lights (red, green, yellow and blue) I was trying to sequence my output SQO intstruction N7:1 to N7:4 to sequence the led lights.

yes i used ladder 2. and i will experement first on SQO instruction.

thanks again Ron...
toarts
 
Last edited:
first of all, the SQO moves the bit patterns stored in the "file" into the destination – one word at a time ...

problem: you don't have anything but ZEROs stored in the "file" so all you are getting is ZERO out ... in other words, you're shooting "blanks" at the Destination (target) ...

so ...

manually type something into N7:1 (example: 1), and into N7:2 (example: 2) and into N7:3 (example: 4), and into N7:4 (example: 8) ... that should get you started ...

next delete rung number 1 for the time being ... it will interfere with the operation of the SQO by "fighting" with it for control of bit O:0/0 ...

next ... your Mask is set too restrictive ... it will only let the SQO control ONE bit the way you have it set ... set the mask for 0FFFFH for the time being ... you can always adjust it later once you get things working ...

next set the Length for 5 ... the SQO starts at the ZERO postion (N7:0 in your case) as a "rest position" and THEN it will go on for four "active" steps - before recycling back to step 1 ... so if you want to control four lights, you need something like five steps for the Length setting ...

this should get you started - and you can tweak the operation from there ... see if these ideas help ... post again and tell us how things are going ...

survival tip: skip the COP instructions in my demo program for now ... get the SQO working - and then experiment with the COPs ... but to answer your question: those rungs allow the operator (you) to "change the pattern" of flashing lights ... in other words, each COP loads a different pattern of ONEs and ZEROs from a "storage" file area into the "active" file area used by the SQO ...

and here's another SQO post that might help you along ...

http://www.plctalk.net/qanda/showthread.php?postid=4220#post4220

good luck with your project ... offline until tomorrow ...
 
Last edited:
Thank you Ron, I will write the logic tomorrow and test it. When you say, manually type N7:1 (example 1) and so on, you mean manually type this from the N7 data file?

Thanks again?
toarts
 
one other thing that trips most ppl on these instructions right click the instruction on the SQO yuo will see display special click that to see what bits are set etc for each memory location.
 
When you say, manually type N7:1 (example 1) and so on, you mean manually type this from the N7 data file?

close - but you said it backwards ... you type this "INTO" the data file - not "FROM" the data file ... basically by typing these numbers in, you're "setting the pins" into the roller on the "music box" that I mentioned in one of those earlier posts ... you could also change the Radix setting for the N7 data file to "Binary" and change the ONE or ZERO status of each of the bits ...

then once that step has been done, when you look at the sixteen-bit words N7:0, N7:1, N7:2, etc. with the Radix set for "binary" every ONE (1) in the pattern will turn ON a lamp whenever that particular sixteee-bit word is moved into the Destination by the SQO ... Mordred mentioned the "Display Special" feature ... try that and you should see the pattern that I'm talking about ...
 
Hi Ron, thank u for your support..i am making progress here. I made my masking 0FFFH, pos 0, lenght 5, dist O:0.0. When I make my input high, I can see the position count from 1 - 5. When i make my input high on position 1, N7:1 data file stays at zero, however when I change the value from 0 to 1, Output O:0.0 get energize, blue light come on. Input is hight on Position 2, N7:2 data file stays at zero, when i manually type 1 to N7:2, Blue light come on again same result all the way to pos 5. it seems that bit does not move. also isn't that it SQO instruction suppose to at least make N7:1 high without me typing 1 in the data file when input become high? Do I have it setup wrong? Thanks again for your help Ron...toarts
 
OK, now that you've got it working you should be able to see WHY it works ... the key issues are that the bit patterns that you want to use are stored in the "File" ... normally YOU (the programmer) will type those bit patterns into the File area manually ... then as the SQO operates, the bit patterns stored in the sixteen-bit "File" words (example: N7:0, N7:1, N7:2, etc.) are sent FROM the file TO the Destination ONE WORD AT A TIME ...

most of what you've posted indicated that you were expecting signals/information/data to go INTO the file area ... now you should see that idea was backwards ... specifically, the signals/information/data actually goes FROM the file area - TO the Destination ... more specifically, the SQO will NOT change any of the data located in the File area ...

the Control structure "controls" the operation of the SQO ... think of it as a "pointer" type device ... the basic idea is this: a T4 structure is used to "time" ... a C5 structure is used to "count" ... an R6 structure is used to "point" ... you could think of it as the PLC processor's electronic finger - which he uses to keep track of WHERE he is currently located within the File area ... the "Position" is the numerical value (a built-in part of the R6 "pointer") which shows the SQO's current location within the File ...

the MASK is used to decide which of the sixteen bits within the Destination that you want the SQO to exercise control over ... suppose that you have ten output bits on your controller - but you only want the SQO to control eight of those bits ... specifically, you want to reserve the other two bits for yourself - and to control those bits with OTE instructions and manual switches ... without the Mask feature, this would be impossible - since the SQO is a "bit hog" which normally controls ALL of the bits within the sixteen-bit Destination ... so - you use the Mask to tell the SQO which of the sixteen Destination bits BELONG to him - and which of the sixteen Destination bits he should LEAVE ALONE ... every bit position within the Mask which contains a ONE (1) belongs to the SQO ... every bit position within the Mask which contains a ZERO (0) will be ignored by the SQO ... the tricky part is that the Mask is usually entered in Hexadecimal notation ... I've already covered that subject in one of those earlier posts ...

if you haven't seen how those COP instructions work in my earlier example, you really should go back and work with those ideas ... the concepts aren't earth-shaking by any means - but working through them should prove educational ...

moving forward:

earlier you mentioned the SQL ... personally I have NEVER seen a real-world use for this particular instruction ... now I don't doubt that there are uses for it out there (somewhere) - but my advice would be to skip the SQL and move on to something more useful ...

party on ...
 
Last edited:
Thanks for the advice and support. I went it look at your COP instructions again and it seems that everything is clicking now on my head but still needs to experiment on it.
Thanks again Ron...
 
you're welcome ... glad we were able to help ...

and THANK YOU for posting your program file ... it's amazing that so many new members make it needlessly hard on themselves by not taking that all-important step ...

once we have something to work from, we can offer specific answers and detailed help ... on the other hand, without the program we have to make "guesses" and "assumptions" about what's causing the problems - so the best we can do in those cases is offer generalized hints and suggestions ...

few of us have time to play "twenty questions" guessing games in order to cover all of the potential sources of confusion - and so often we're forced to simply skip over problems where the program files aren't made available - especially after repeated requests for the files have been simply ignored by the original poster ...

we wish you the best of luck with your studies ...
 

Similar Topics

Hi All, I need some clarification on sequencers, I researched this forum but haven't been able to find a good explanation, including the ones...
Replies
10
Views
5,067
Hello Everyone.... Has been a while, well I am still putting along learing what ever I can on PLC's, got to give dibs to Lance1...he's been...
Replies
1
Views
2,883
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,051
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
Back
Top Bottom