Studio 5000 Find instruction help! Not working??

lunenburger

Member
Join Date
Jul 2008
Location
Summerside
Posts
207
I am using Studio 5000 Version 30 and Compactlogix.

I have a recipe created in a UDT structure, with a string value called name.
There are 50 Recipes in the RecipeList array
I want to take a string value called "ScannedRecipe" and have the PLC go down the list of 50 Recipes and find the name that matches, and load the recipe number into the CurrentRecipe list (see pic 1)

I am trying to use the find instruction, and there are no errors but it is also not working. (see pic 2)

I feel that i may need to use a wildcard or something instead of the zero in the search tag (RecipeList[0].Name but nothings working.

If anyone knows a better way i am open to other options.....

Thanks in advance

pic 1.png pic 2.png
 
Got it working with the FSC instruction. (see pic)
Have to unlatch the .IN and .FD bits of the RecipeSearch control word in the next rung....

res.png
 
Before COP instruction, for FIND instruction you need to analyze that Result is >0 because it passes power all the time, found or not.
For FSC, you need to check for .FD bit
 
In the Not Found Branch I would also add a XIC FSC.DN Bit. That way you know the search has completed and Not Found.
 
You should try to go back to FIND instruction.
FSC is probably overkill for this simple task.
But if you want to scan through an array then FSC is the way to go
 
Last edited:

Similar Topics

Hi, When installing new PC, how do I find what EDS file that is used for a device in an existing project. Without access to Studio 5000 on the...
Replies
3
Views
5,412
Hello! I am in the process of converting a Horner program into Studio 5000 for a customers gasifier. The Oxygen sensors are +/- 1000 mV. The...
Replies
3
Views
2,643
Compactlogix controller, program has 28 conveyors that use TON's to start the conveyors. The TT sounds a warning horn during start and the DN...
Replies
0
Views
1
I have to start out by saying I am not a PLC programmer and I have basic programming skills but mainly use software as a troubleshooting tool. I...
Replies
0
Views
37
Hi everyone, I was wondering how we declare Persistent Variables in Studio 5000 (main reason to keep the values during power cycle and program...
Replies
5
Views
175
Back
Top Bottom