RS logix5000 simple recipe

Thanks That makes sense. I must thank you I really think this will work. But I have a last major hurdle. I cannot use the "RecipeActive.Track1" for computations or comparisons. I used Tracks instead of Stations. It says invalid data type,argument must match parameter data type. I thought the value would either be on or off bool so it would behave like a normal tag. A mov, cmp, equal don't work. How do I manipulate the value in my program?
 
Thanks That makes sense. I must thank you I really think this will work. But I have a last major hurdle. I cannot use the "RecipeActive.Track1" for computations or comparisons. I used Tracks instead of Stations. It says invalid data type,argument must match parameter data type. I thought the value would either be on or off bool so it would behave like a normal tag. A mov, cmp, equal don't work. How do I manipulate the value in my program?

It wouldn't be RecipeActive.Track1 but RecipeActive.Track[1]. As long as you defined Track as a BOOL in your UDT it will behave like any other boolean.
 
Thanks It was late this end. Ofcourse silly me it is a boolean.
Anyway the rest of the program now I need to send a camera to track1 if its enabled do a trig etc then do the same with track2 if its enabled etc up till track 16. Then repeat from track1 again. I was going to do it the hard coded way.
Could I have a counter if RecipeActive.Track[counter.acumulator] is on then do sub else next count What do you suggest?
 
There's a multitude of ways to do what you're suggesting. It all depends on how similar the operation is from Track1 to Track2, if there is different I/O involved, if you want to create AOI (Add on Instructions), etc.

A fairly straightforward way is to just create 16 Programs for each Track. Then call each Program with a JSR in order. Predicate calling the JSR on whether the .Track[counter] bit is true.

If it is true, call the JSR for that track and do what you need to do.

In between each JSR call, increment your counter by 1.

So, top to bottom, if .Track[0] is true, then JSR for Track 0 is called. When the program for Track 0 finishes, the rung after the JSR executes which increments your counter. Now counter = 1. If .Track[1] is true then the next JSR is called. If it isn't true, the JSR is not called and the counter just increments again on the next rung. You just keep calling the routines and incrementing the counter.

You could neatly package the above in a FOR-NEXT type setup and if the track operations are similar enough actually call the same routine over and over, using the current count number to know which track you are operating on. All depends on how fancy, and how condensed you want the program.

Me, I would tend to do it the more straightforward way so that it's easy to keep track of, and mainteance/programmers after you can easily see what's going on.
 
I had already started with a counter but changed my mind and ended up using an int and just adding there was cases if the camera failed do again etc but the long way so we all can understand it.
Unfortunately here is the next bigger question I hope it is the last.
I need to send the Robot the PLC's current running program as your example RecipeActive.RecipeName this should be a value 0-99. The robot is hard wired to output
Local:10:O.Data.8(C)= bit 1,
Local:10:O.Data.9(C) = bit 2,
Local:10:O.Data.10(C) = bit 4,
Local:10:O.Data.11(C) = bit 8,
Local:10:O.Data.12(C) = bit 16,
Local:10:O.Data.13(C) = bit 32,
Local:10:O.Data.64(C) = bit 64.

As you can see this was an add on otherwise it would of been a dedicated card.
First How do you get the value from the string recipename? then do I have to hard code the above BCD or is there an easier way.
Typical the programmer is the last to get the I/O ......

Again Thank you for your help so far.
 
I think I have answered my own question. I used a STOD or string(RecipeActive.RecipeName) to DINT (Robot_Program)
then pick each Bit of the DINT in binary order to fire the outputs ie Robot_program.0 puts on Local:10:O.Data.8(C)= bit 1,
Robot_program.1 puts on Local:10:O.Data.9(C) = bit 2,
Robot_program.2 puts on Local:10:O.Data.10(C) = bit 4,
Robot_program.3 puts on Local:10:O.Data.11(C) = bit 8,
Robot_program.4 puts on Local:10:O.Data.12(C) = bit 16,
Robot_program.5 puts on Local:10:O.Data.13(C) = bit 32,
Robot_program.6 puts on Local:10:O.Data.64(C) = bit 64.

It seems right we will see tomorrow. Again Thanks.
This forum is brilliant I will try to help others as I have been helped and this is the key to this forum.
 
Well, the RecipeName as a String was really meant as a descriptive identifier...Something like "Recipe timbuktu". If you just want to ID it as a two digit number, then instead of the extra code of String to DINT, just make your RecipeName an DINT in the UDT and populate it with 0 to 99 for each recipe. You could even ADD an extra field in the UDT called RecipeID as a type DINT and populate that with 0-99 instead, keeping the string for a more descriptive identifier. You could only use the String as an internal descriptor (not seen by anyone but someone online) and populate it with something more descriptive just as additional documention. Something like RecipeName = "Use this Recipe for product XYZ".

Lot's o options...
 
Yup you're right. I might just do that add the RecipeId into it then leave the string for later on. Will charge more for a software change. I am a siemens bloke but this controllogix has swung me very powerful and logical I always liked AB on the old SLC500 and 5 but this RSlogix 5000 is beginning to grow on me. Thanks again robertmee will let you know what happens tomorrow after testing - commisioning.
 
Update

The problem with doing this on an SLC/Micro system is that when Bubba comes out to troubleshoot and downloads an old copy of the program into the PLC without uploading first, you'll lose any changes to the recipes that have been made since then. Too bad RSLogix 500 won't let you download the program without the data files. I'm wondering if this is the same in 5000?

Again thanks to the forum especially robertmee

just to let you know I have downloaded and changed the program several times and the values in the recipe are still unchanged in rslogix 5000.
 
Again thanks to the forum especially robertmee

just to let you know I have downloaded and changed the program several times and the values in the recipe are still unchanged in rslogix 5000.

Glad to hear it worked out for you...Good job
 

Similar Topics

I made the recipe and it is all working. I made a user defined record element. I see the Recipe name (STRING) has LEN (DINT) and DATA (SINT(82))...
Replies
1
Views
3,377
Hi all,I was reading about recipes in the forums. Bulletproof way seems to be in the PLC which I like. I have 2 words for the recipe 1 word is...
Replies
0
Views
3,412
So I'm new to the PLC world and just wanting to get some general knowledge. Just a curious question... How many controllers are in the Logix5000...
Replies
9
Views
2,991
this subject has been cropping up quite a bit lately ... since I was already doing some course development work along these lines, I've decided to...
Replies
4
Views
7,985
This should be a simple one. I have a Dint array in my program that is setup for 30 elements. If I want to increase the array size, will the...
Replies
3
Views
3,509
Back
Top Bottom