Siemens fc10 to compare 2 strings

  • Thread starter Thread starter Stanley_Smith
  • Start date Start date
  • Tags Tags
    Compare Strings
Click For Summary
SUMMARY

The discussion focuses on using Siemens FC10 to compare two 9-byte strings stored in DB98 for quality control of scanned boxes. The user reports that the comparison always returns true, regardless of the input. It is noted that the first character of string2 in the VAT table is incorrectly indexed, starting at db98.dbb 14 instead of 12. The Siemens documentation indicates that the first byte represents the maximum length of the string, while the second byte indicates the actual string length, which may be contributing to the comparison issue.

PREREQUISITES
  • Understanding of Siemens PLC programming and data blocks
  • Familiarity with Siemens FC10 function for string comparison
  • Knowledge of VAT (Variable Allocation Table) in Siemens systems
  • Experience with string manipulation in Siemens programming environments
NEXT STEPS
  • Investigate the correct indexing of strings in Siemens DB98
  • Review Siemens documentation on FC10 for string comparison specifics
  • Learn about the structure and purpose of the VAT in Siemens programming
  • Explore debugging techniques for Siemens PLC string operations
USEFUL FOR

Siemens PLC programmers, automation engineers, and quality control specialists involved in scanning and verifying product integrity using Siemens systems.

Stanley_Smith
Messages
16
Reaction score
0
Hi,

I'm scanning a code from each box to compare and see if the box scanned is a "good" box. The whole code is about 21 bytes and I only want to compare 9 bytes since those 9 bytes differentiate between the 2 types of box. I created (2) 9-byte strings in DB98, string1[9] starts at 0.0 and string2[9] starts at 12.00.
I entered 9 "good" characters in the initial value column for string2. String 1's value will be read from the scanner. FC10 is used to compare the two strings. The problem is that the results are always equal(true) doesn't matter which boxes was scanned ! In the VAT table, string2's first character which is 0 actually starts at db98.dbb 14, not 12. According to Siemens help file, the first byte in a string is to show maximum length of the string, the second byte shows the actual string length. HELP ! is there any suggestion on how to correctly solve my problem? Thank you
 
Engineering news on Phys.org
Since nobody has replied yet, I'm guessing that none of us are familiar with the system and tools that you are using. I'd still like to help, so if you can provide a pointer or explain what DB98, FC10, VAT, etc. pertain to, perhaps I can be of help.
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 75 ·
3
Replies
75
Views
7K
Replies
1
Views
8K
Replies
5
Views
17K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 66 ·
3
Replies
66
Views
8K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K