Sign in to follow this  
Followers 0
CanaanP

Programming Question

16 posts in this topic

Hey everyone, I may be required soon to come up with a program that will control the starting order of many portable conveyors. They are modular, connected wirelessly. I need the ability for the operator to tell the plc what order the conveyors are arranged in so that the furthest one can be started first and so on... can someone give me advice on how to do that? I'm not familiar with recipe type programming, but I wondered if that was sort of the right frame of mind here - not sure but any help would be appreciated. Thanks!

Share this post


Link to post
Share on other sites
Which platform are you using? Does it support indirect addressing? First thing that comes to mind: 1. Operator enters conveyor order into a stack of integers. The logic cycles through the stack and starts the conveyor listed in each register. Operator enters in the order to start, stored in the plc like this: N7:0 = 3 N7:1 = 1 N7:2 = 2 N7:3 = 5 N7:4 = 4 The logic starts conveyor 1, waits some amount of time, starts 1, wait, start 2 etc.....

Share this post


Link to post
Share on other sites
Im not real big on using indirect addressing unless absolutely necessary. It would not be difficult to troubleshoot in this instance, but it usually gives some field techs a fit. As always, program to your audience. That said, it would be a simple and efficient method given the right support personnel. If you dont have indirect addressing or dont want to use it, you could increment a counter and have an integer assigned to each conveyor that the operator would be able to enter the starting order. This would also allow you to start multiple conveyors simultaneously if required by entering in the same start value in both (if not necessary you would need a way to inhibit that capability). In operation the operator would enter the starting order for each conveyor. As the counter would increment, a simple EQU statement associated with the start logic for each conveyor would compare the count with the conveyors' start order. Both methods would work. As always there are many ways to do this. Deciding which works well for your environment and system is your next task. Russell

Share this post


Link to post
Share on other sites
You've got some awesome answers already but I'll go one step further. 1. Assume every conveyor uses one output card of 16 bits. 2. Assume every conveyor uses one input card of 16 bits. 3. Assume that every conveyor uses one group of ten timers. 4. Assume that every conveyor uses one group of 16 binary flag bits. 5. Number your conveyors 1 thru NN and assign your I/O so that the conveyor number is the rack number. 6. Write one Conveyor start/run subroutine and call it for each conveyor. 7. Stack the conveyor numbers into a FIFO by operator from HMI. 8. Pop conveyor numbers off the FIFo to start them. Hope I am clear enough in my general comncept. Joe Relay may ahve time with the subroutine, but the newer "Tech School" electricains of the next generation won't.

Share this post


Link to post
Share on other sites
A problem with subroutines using indirect references is that timers and counters cannot be referenced indirectly. You can't have a rung with a timer addressed as T4:[N7:5]. It just won't fly. Neither with addressing any components of the timers. One way which I have seen, and this is a little scary, is to have the individual timers and counters assigned plus some added ones which are DIRECTLY referenced in the subroutine. Just before the subroutine is called do a COPy of your individual timer (indirectly referenced) into the space of the timer used in the subroutine. Then execute the subroutine. At the end COPy the subroutine's timer back to the individual (indirectly referenced) timer. The problem is - this takes a lot of processing time. Multiple subroutines, while taking more space and taking longer to write, would process quicker.

Share this post


Link to post
Share on other sites
Well the OP has not posted back, maybe a dead thread. We do not know: Platform, operator interface, level of expertise. I still recommend the indirect addressing method. I know, I know, ....may be hard for "bubba" to troubleshoot. But, why have a tool if you can never use it.

Share this post


Link to post
Share on other sites
Sorry for not posting back, I've been out of town and didn't take my laptop. My level of expertise is nill, this will be my first official program. I understand rslogix and plc's pretty well, just don't have any experience. I'll be using a micrologix, not sure which model yet. Interface will probably be a touch screen hmi. The fifo idea seems logical, and something that's in my capabilities because I've seen the fifo being used before. But how should the operator input the information? a number pad? how is something like that normally done?

Share this post


Link to post
Share on other sites
How many conveyors are there and how many different configurations? Are the conveyors unique and arranged differently for different products, or are they so similar that they get mixed up during set up of the area? If there are only a few configurations, you may choose to just have a list of "recipes" from which the operator selects. You can program the PLC any number of ways to get that done, but make it as simple and clear for the operator as possible. If he only has to choose a button for each product, for example, then that would make his/her life easier. In the PLC, you can respond to the choice by loading the proper presets into timers by having a separate file for each mode of operation, and using indirect addressing to move the data. Then for example files N21 through N40 represent recipes 1 through 20. N21:0 would be the preset for conveyor #1 when using recipe #1. N21:1 woudl be conveyor 2 and so forth. So when a new recipe is selected, and its numberical value is for instance N7:45, you have a series of move commands: LIM 1 N7:45 20 --> ADD N7:45 20 N7:46 **get file number from recipe number by adding 20 to it. MOV N[N7:46]:0 T4:0 **Preset for conveyor 1 MOV N[N7:46]:01 T4:01 **Preset for conveyor 2 MOV N[N7:46]:02 T4:02 **Preset for conveyor 3 ... MOV N[N7:46]:99 T4:99 **Preset for conveyor 99 Hope this helps, Paul Edited by OkiePC

Share this post


Link to post
Share on other sites
Well this will be for pouring concrete. The conveyors will all be handling concrete. I'm not sure how many conveyors there will be at this point... the project is still about a year out. I just want to get a good jump on the program to make sure I get it right. This is what I have in mind, maybe someone can tell me if it will work or not or what I need to do to tweak it... I'm experimenting with AdvancedHMI which is a free hmi to use with visual basic. I plan to make an operator screen that has a keypad with numbers 1-0, then perhaps 10 (just for this example of 10 conveyors) digital display screens that represent farthest to closest conveyor arrangement. The operator types in a number, like 001 or just 1 I guess for conveyor 1, 2 or 2, etc... when he types in the number it goes into the first display. This display is read off of an integer table, so they would all be getting stored in the n7 table. After all the conveyors are input into the displays, then operator hits start button, at which point plc moves the integer values into timers to begin starting the motors. There will be a timer for each conveyor that will have the value moved into it, and each timer will be preset at staggered increments so they don't all start at once.... There will be a reset button also, so that the conveyor arrangement can be changed once they are done with that poor. That would simply clear all the of the numbers in the table so the displays are blank and ready for next input. Does that sound like it might work? I realize that my description is really fuzzy but I'm not a pro. I like to work with the theory in my head and keep it rough, then try to get more and more detailed as I'm fleshing it out. Any input is greatly appreciated. Thank you.

Share this post


Link to post
Share on other sites
CONVEY_STRT.zip I threw this together, it has not been tested, and not looked at very close either. May have a typo or something. It may give you another idea on how to do your start up.

Share this post


Link to post
Share on other sites
Thanks, I'm looking this over right now and will try to figure it out.

Share this post


Link to post
Share on other sites
I've been picking this apart, trying to learn how it works... I'm still unclear on one thing, where/how is the conveyor order stored at? I understand that rung 003 is incrementing N7:100 each time the timer is done, but what are equal statements being compared to? I see that they are comparing the N7:[N7:100], which is confusing to me... is that one particular address, or is that a way to specify a range of addresses? I'm using to seeing N7:0, or N7:100, but not N7:[N7100] So I guess my most basic question is, what specific integers need to be changed to manipulate the starting order? Edited by CanaanP

Share this post


Link to post
Share on other sites
I can't recall whether this {N7:[N7100]} is INDIRECT or INDEXED addressing but it deciphers like this. For N7:100 = 10 then N7:[N7100] is the same as N7:10 For N7:100 = 11 then N7:[N7100] is the same as N7:11 For N7:100 = 12 then N7:[N7100] is the same as N7:12 For N7:100 = 20 then N7:[N7100] is the same as N7:20 For N7:100 = 50 then N7:[N7100] is the same as N7:50 Hope the pattern is clear.

Share this post


Link to post
Share on other sites
Well, sh*t the bed. That's something I wish I'd known a long time ago. That's awesome, now it all makes sense to me. It must be Indexed I think because I loaded this onto a micro 1200 rev c and I don't think that supports indirect addressing. There's so much about this I need to learn, but it can be overwhelming... but this I think will be a valuable tool for me to use :) Thanks a bunch to you and Ken both!

Share this post


Link to post
Share on other sites
It is indirect addressing, and it is supported on the ML1200. (Indexed is easy to spot by the use of the # sign, I usually don't use indexed very often.) In my example, you will load the start order into the N7:1 through N7:6 (you can make it larger.) N7:1 contains the numeric value of the conveyor to start first, N7:2, 2nd conveyor etc... Let's assume the start up order is: 3, 1, 4, 5, 2, 6 When you begin the start sequence. N7:100 has a value of 0. So the indirect address N7:[N7:100] is the same as N7:0 N7:0 = 0, so the alarm will sound for 30 seconds ( you can change the timer as needed) After 30 seconds N7:100 will equal 1, so now N7:[N7:100] is the same as N7:1, From above we know N7:1=3, so conveyor 3 will start, After 30 seconds N7:100 will equal 2, so now N7:[N7:100] is the same as N7:2, From above we know N7:2=1, so conveyor 1 will start, etc.....

Share this post


Link to post
Share on other sites
Yes it's awesome, sorry about assuming about the addressing thing.. I just thought I saw in the rslogix help file that only the 1500 supports indirect addressing.. but I'm definitely not the expert here :) I understood almost all of your file, which I was quite proud of considering the only thing I've written so far was the traffic light program in training. But the only thing I couldn't get my head around was that N7:[N7:100] deal. Then it all "snapped" together for me. Thanks a ton!

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
Sign in to follow this  
Followers 0