FactoryTalk/Studio Recipe Search

hrissley

Supporting Member
Join Date
Dec 2015
Location
Kentwood
Posts
3
I have array of 600 recipes, going to go up to 1000, I would like to add a search for the part number option on my screen. I could have 10 part numbers that start with 12345 and I would like to find the 10 recipes then select from that. Any easy way to do this?

Thanks in advance..
 
hrissley,

Do your recipe files have the part number as part of the recipe's name, or are you trying to dig into the recipe itself to determine if its part number is 12345?

-Nathan
 
Since you already have a recipe array i assume you understand how to index through an array to get to the array index you are looking for. I will further assume you understand the syntax related to selecting specific elements in a given index from an array of structures. Finally, I assume this isn't something that needs to occur in a single scan or you are (likely) going to bring your processor to its knees.

I would index through the recipe array one index per scan and use the ASCII find instruction (FIND) to search through the Base_5_Finish string for your compare string. The FIND instruction returns the character location in the searched string of the start of the characters in the compare string. If FIND doesn't find the string it returns a 0. In your case you are looking for equal values that start only at character location 1. Any other result is not a valid find.

I would also create a single dimension array of 10 DINTs. Prior to running the search through the recipe array, zero out all the values in the DINT array. As you search through the recipe array and find the recipe name start you are looking for, save the recipe array indices to the DINT array until either the DINT array is full (you had 10 finds) or you come to the end of the recipe. A page on the HMI would display the Base_5_Finish string value of any recipe index in the DINT array. From there you can select the recipe index you want and do with it what you will.

Keith
 
Since you already have a recipe array i assume you understand how to index through an array to get to the array index you are looking for. I will further assume you understand the syntax related to selecting specific elements in a given index from an array of structures. Finally, I assume this isn't something that needs to occur in a single scan or you are (likely) going to bring your processor to its knees.

I would index through the recipe array one index per scan and use the ASCII find instruction (FIND) to search through the Base_5_Finish string for your compare string. The FIND instruction returns the character location in the searched string of the start of the characters in the compare string. If FIND doesn't find the string it returns a 0. In your case you are looking for equal values that start only at character location 1. Any other result is not a valid find.

I would also create a single dimension array of 10 DINTs. Prior to running the search through the recipe array, zero out all the values in the DINT array. As you search through the recipe array and find the recipe name start you are looking for, save the recipe array indices to the DINT array until either the DINT array is full (you had 10 finds) or you come to the end of the recipe. A page on the HMI would display the Base_5_Finish string value of any recipe index in the DINT array. From there you can select the recipe index you want and do with it what you will.

Keith

im going to bookmark this idea because i like it and could use this in the future.

if there were 1000 recipes say it would take 1000 scans to index through all of them?
 

Similar Topics

Is it possible to view recipes from a mer file pulled from a PanelView ? The recipes are selected to be part of the HMI. This system has...
Replies
0
Views
999
Hello Eveyone: I have PVPlus Compact 1000 ,and I use FactoryTalk to create recipes now I do not know, how to Export and Import recipe data from...
Replies
1
Views
1,799
So, I have been having an issue for the past couple days, with the full recipe in my program not being downloaded fully. I'm at a complete loss...
Replies
0
Views
1,966
I have searched previous posts but cannot find any references.... I have a created a recipe with the recipe plus function, all is working fine...
Replies
2
Views
5,102
Hello, I made a change in alarm setup in factory view studio, where I changed a alarm message text. After that I made a run application and...
Replies
0
Views
129
Back
Top Bottom