You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old July 11th, 2019, 07:27 AM   #1
lunenburger
Member
Canada

lunenburger is offline
 
lunenburger's Avatar
 
Join Date: Jul 2008
Location: Summerside
Posts: 127
Studio 5000 Find instruction help! Not working??

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
Attached Images
File Type: png pic 1.png (10.9 KB, 21 views)
File Type: png pic 2.png (46.5 KB, 16 views)
  Reply With Quote
Old July 11th, 2019, 07:49 AM   #2
lunenburger
Member
Canada

lunenburger is offline
 
lunenburger's Avatar
 
Join Date: Jul 2008
Location: Summerside
Posts: 127
I am also in the process of trying the FSC instruction, working through Rockwell examples.....
  Reply With Quote
Old July 11th, 2019, 08:44 AM   #3
lunenburger
Member
Canada

lunenburger is offline
 
lunenburger's Avatar
 
Join Date: Jul 2008
Location: Summerside
Posts: 127
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....
Attached Images
File Type: png res.png (18.2 KB, 67 views)
  Reply With Quote
Old July 11th, 2019, 10:04 AM   #4
Contr_Conn
Member
United States

Contr_Conn is offline
 
Contr_Conn's Avatar
 
Join Date: Sep 2003
Location: Ohio
Posts: 2,038
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
  Reply With Quote
Old July 11th, 2019, 12:26 PM   #5
lunenburger
Member
Canada

lunenburger is offline
 
lunenburger's Avatar
 
Join Date: Jul 2008
Location: Summerside
Posts: 127
Yes, you are correct.... thank you....
I modified the logic to observe the FD bit
Attached Images
File Type: png new.png (25.9 KB, 48 views)
  Reply With Quote
Old July 11th, 2019, 01:40 PM   #6
cwal61
Member
United States

cwal61 is offline
 
Join Date: Jan 2011
Location: NC
Posts: 1,071
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.
  Reply With Quote
Old July 11th, 2019, 02:18 PM   #7
Contr_Conn
Member
United States

Contr_Conn is offline
 
Contr_Conn's Avatar
 
Join Date: Sep 2003
Location: Ohio
Posts: 2,038
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 by Contr_Conn; July 11th, 2019 at 02:20 PM.
  Reply With Quote
Old July 11th, 2019, 02:25 PM   #8
GaryS
Member
United States

GaryS is offline
 
GaryS's Avatar
 
Join Date: Aug 2003
Location: Lancaster Pa.
Posts: 948
it looks to me like you start the find at element 1 but the string you want is in element 0
change the start to 0 it should work
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
FBC and FAL instruction in Studio 5000 with PanelView Standard Frinehart LIVE PLC Questions And Answers 2 February 1st, 2019 03:05 PM
Looking for a Scale with Parameters ( SCLP ) in RS Logix 5000 and cannot find ? Baker in Virginia LIVE PLC Questions And Answers 18 November 27th, 2018 05:17 PM
Help FSC Instruction Problems AB Studio 5000 Help nocmsa LIVE PLC Questions And Answers 13 July 7th, 2017 11:36 AM
RSLogix & Studio 5000 shazad5444 LIVE PLC Questions And Answers 3 September 11th, 2016 11:05 AM
Studio 5000 Install Tim Ganz LIVE PLC Questions And Answers 6 June 29th, 2015 04:06 PM


All times are GMT -5. The time now is 01:57 AM.


.