chantecler

Sequence Instructions question

4 posts in this topic

Hi,

I’m working on a project in which the process has some sequences that I believe I can program using the SQI and SQO instructions. I usually avoid utilizing the built in sequence instructions but this time I think they’re going to save me a lot of programming.

My first question is: There are some inputs that I need to ignore in certain steps but I have to look at them in other steps. The problem is the mask is the same for all the steps and I don’t find a way to solve this. Any help? How do I tell the SQI that those inputs can be either 0 or 1 in certain steps but they have to be specific in other steps?

Second question: I would like to set a time out limit for every step and want a different limit for every step. Any idea?

I have been considering options like writing the ladder the way I usually do or learning SFC but I still think the sequence instructions are the best choice.

Thank you.
 

Share this post


Link to post
Share on other sites

Are you using a PLC-5 or Logix5000 platform? Either one allows for indexing through mask values as the SQI transitions through steps

If PLC-5-------------

Use an N (integer) or B (binary) file to hold the different mask values. Using the the same R (Control)  element you used for the SQO instruction insures that both instructions are at the same step.

You would need another integer stack to store the max. time limit for each step. Each member of the stack would also correspond to the position of the sequencer instructions.

So in the end you might have something like this....

B10:0 - B10:15     (16 output positions where each B10 element has its 16 bits set or reset as you desire the outputs to be.) for the SQO File

B11:0 - B11:15     (16 output positions where each B10 element has its 16 bits set or reset as you desire the mask to be.) for the SQI File

N12:0 - N12:15  (16 time limit value positions where each N12 element has the max. time limit you want a particular step to be in) for the SQO File. You would need a MOV instruction to move the new time limit in your step timer at each step change.

R6:5  The R (Control) address element used for the SQI and SQO instructions if you desire to keep them in lockstep at all time. If there are times or situations where such a thing is undesirable, you'll use different Control elements for each instruction and add logic to manage their .POS values as necessary.

I've always been leery about using SQI & SQO instructions when somebody "thinks" there will never be a need to add steps in between...add additional outputs beyond the original number of outputs...allow an operator to change the mask values...etc.You need to make sure that whatever solution you use, there is relative ease for modifications down the road

If Logix5000 -------

Substitute tags & tag arrays where elements and data files are mentioned above in the PLC-5 area.

However...I would use UDTs for the operational/status membbrs of the sequencer...

So my tags for the operation of the sequencer would look like (using a tag named 'MySEQ' in my example)

MySEQ.Position

MySEQ.Output

MySEQ.Input

MySEQ.Mask

MySEQ.StepTimeLimit

etc.

If this is something I thought I would do at other locations/machines  or need to change with an HMI, I would create a sequencer AOI (Add-on Instruction).

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

A few things you didn't mention.....

When the timer times out for a particular step, does the sequencer automatically advance to the next step? Or do the outputs for that step change

to a "safe state" until the sequencer advances?

What starts and stops the sequencer?

Is there a desire to be able to put the sequencer in a "Hold" state manually? If so, how are the outputs controlled while in that step?

This is another reason why I would use UDT's and possibly an AOI instruction.

This would afford me access to monitoring ....

MySEQ.Start

MySEQ.Stop

MySEQ.Reset

MySEQ.Hold

MySEQ.ClearOutputs

MySEQ.Resume

The AOI would be a lot more flexible than using SQI and SQO instructions as the core of the sequncer

 

 

Edited by Filthy McNasty

Share this post


Link to post
Share on other sites

Thank you for taking the time to answer my question Mc.

The platform is Logix 5000

In this particular case if any timer times out the outputs are going to change to a safe state and the operator's intervention will be required and the sequence will have to start from the beginning

The operator will start the sequence the first time and it has to continue repeating automatically once it reaches the final step

I also plan to add a "manual" option so the operator can advance steps one at a time.

I still have to read your answer more carefully. At least I know that what I want to do can be done. I'm also going to consider using my own UDTs and AOIs.

Thank you again.

 

Share this post


Link to post
Share on other sites
20 hours ago, chantecler said:

>>>>>>>In this particular case if any timer times out the outputs are going to change to a safe state and the operator's intervention will be required and the sequence will have to start from the beginning

I would recommend setting the bit values in Word 0 of your output array to the "safe state" values that you desire.

 

Quote

>>>>>>The operator will start the sequence the first time and it has to continue repeating automatically once it reaches the final step

 


 

If you decide to use Sequencer instructions in one or more routines or embed them in an AOI, some tips...

If you've worked with SQI and SQO before you know that after the Position value reaches the Length value (the last step) and the last step values are written to the Destination (through the mask)..... the next false-to-true rung transition in front of an SQO moves the bit values of Word 1 to the Destination word (through the mask.) In other words, the word 0 bits are not used again (except as laid out below).

If you need to reset the sequencer instruction before it reaches the last step, be aware that how and when you reset it dictates the operation of the Destination. To wit:
Scenario ---                   Reset Method                            True/False status of the rung the SQO is on at time of reset                              
1.                                    RES instruction                                           False                                                             
2.                                   RES instruction                                            True
3.                               CLR or MOV instruction                                  False
                              setting the Position value to 0 (zero)
4.                               CLR or MOV instruction                                  True
                              setting the Position value to 0 (zero)
Outcome ------
1. SQO Position is set to 0 (Step 0) but Destination value remains at value dictated by the value of the Stack word (based on Position value) that was last moved to the Destination. It will take a False-to-True rung transition on the SQO rung to move the SQO Position to Step 1.


2. SQO Position is set to 1 (Step 1) and Destination value changes to value in Stack for Word 1. Obviously a different outcome from Scenario 1.    The next False-to-True rung transition for the SQO rung will move the Position value to 2 and the Destination will reflect the Stack word value for Step 2.


3. SQO Position is set to 0 (Step 0) but Destination value remains at value dictated by the value of the Stack word that was last moved to the Destination. It will take a False-to-True rung transition on the SQO rung to move the SQO Position to Step 1. (Same outcome as Scenario 1.)


4. SQO Position is set to 0 (Step 1) AND Destination value changes to value in Stack for Word 0. Obviously a different outcome from all of the scenarios. This would be one way to get the SQO back to your "safe state" if you've used Position 0 in the Stack for that purpose. NOTE: This is nothing the other scenarios do.

-------
If you're going to be using sequencer instructions much, I would recommend saving this Scenario list as Rockwell has never explained this well in the Logix5000, PLC-5, and SLC 500 software help files.

Hope this helps.

 

ADDENDA: I would actually use logic external to the SQO to put the process in a "safe" state and use Position 0 (zero) for a "home" or "initialized" state.

 

 

Edited by Filthy McNasty

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now