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.

New Here? Please read this important info!!!


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

Reply
 
Thread Tools Display Modes
Old June 13th, 2012, 11:04 AM   #1
Tommycai
Member
United States

Tommycai is offline
 
Join Date: Aug 2011
Location: KY
Posts: 120
Step 7 using FC10 addressing DB of UDT

Hello all,

I have a question that hopefully has a yes

I am scanning a bar code and bringing in that string in a DB34.
I am trying to compare that string with already stored strings.
I cal FC10 for this part; however.

The first string is in a DB36.dbb0
The string is 14 characters long.

The next string starts at db36.dbb200. because in this db i have used a UDT for addressing. Is it possible to call this?

I call FC10 and string one is P#DB36.DBX0.0 and string 2 is P#DB36.DBX200.0 and the ret_value I made m155.0 but it only give me an error saying that the address does not fit?

is there a certain way to address this db that has a udt?
  Reply With Quote
Old June 13th, 2012, 11:17 AM   #2
KalleOlsen
Member
Norway

KalleOlsen is offline
 
Join Date: Oct 2008
Location: Norway (moustache area)
Posts: 1,770
Quote:
Originally Posted by Tommycai View Post
Hello all,

I have a question that hopefully has a yes

I am scanning a bar code and bringing in that string in a DB34.
I am trying to compare that string with already stored strings.
I cal FC10 for this part; however.

The first string is in a DB36.dbb0
The string is 14 characters long.

The next string starts at db36.dbb200. because in this db i have used a UDT for addressing. Is it possible to call this?

I call FC10 and string one is P#DB36.DBX0.0 and string 2 is P#DB36.DBX200.0 and the ret_value I made m155.0 but it only give me an error saying that the address does not fit?

is there a certain way to address this db that has a udt?
I've got no S7 here, but the FC10 is some string analyzer, eh?

Probably the FC10 must have equal lengths on both strings.
Try to address the UTD on both parameters and see if it fits now.

To get a better answer (and not a guess, as I do here), you should provide more specific info. Post a zip of the evil FC call.

Kalle
  Reply With Quote
Old June 13th, 2012, 11:44 AM   #3
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,241
You should be referring to the string variables by their names, not their addresses:

See example attached:
Attached Files
File Type: zip Sss.zip (18.5 KB, 50 views)
  Reply With Quote
Old June 13th, 2012, 01:17 PM   #4
highvoltage8471
Member
United States

highvoltage8471 is offline
 
highvoltage8471's Avatar
 
Join Date: Feb 2004
Posts: 84
Fc 10

You must make sure that they are both in string format and they are both the same length. If you are having truble with it being a UDT copy the same length (14) to a temp DB with equal lengths of string to compare.



FC10 EQ_STRNG

Description

The function FC10 compares the contents of two variables in the data type format STRING to find out if they are equal and outputs the result of the comparison as a return value. The return value has the signal state 1" if the string at parameter S1 is the same as the string at parameter S2.

The function does not report any errors.

Parameter Declaration Data Type Memory Area Description
S1 INPUT STRING D, L Input variable in format STRING
S2 INPUT STRING D, L Input variable in format STRING
RET_VAL OUTPUT BOOL I, Q, M, D, L Result of comparison
You can assign only a symbolically defined variable for the input parameters.
  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
S7 Sequence Programming Solution ? Jim.M LIVE PLC Questions And Answers 54 March 21st, 2012 12:22 PM
Can you recommend the proper direction on SLC500 xcode LIVE PLC Questions And Answers 96 October 22nd, 2009 02:20 AM
Confused "again" S7 indirect Thim LIVE PLC Questions And Answers 17 July 22nd, 2008 05:47 PM
indirect addressing and pointing a DB with pointer martin3885 LIVE PLC Questions And Answers 3 September 15th, 2005 06:32 AM
Creating a register array to sequence rsdoran LIVE PLC Questions And Answers 15 October 18th, 2003 12:22 AM


All times are GMT -4. The time now is 09:36 PM.


.