Comparing Strings

Hello,

I am having a rough time getting my ouput to energize when trying to compare two strings. I have a fault that I am getting in string format from my FANUC robot using explicit messaging. I have a string tag with a dim of 10 so I can 10 fault strings and use them in my logic to compare with the actual faults I am getting from the robot. I have tried two methods so far. First I tried using a EQU block where I am comparing the string I am getting from the rorobt to my first string I have in my STRING[10]. Currently they do equal eachother but the output is not turning on. Next I tried using a CMP. The tags I used were the same as the EQU. Heres an example of the expression I had, value_1 = value_2, both are strings. And yet still no luck turning my output on. Am I missing something? Any help would be appreciated!! Thank you for reading!
 
Please supply which PLC, a data table print of each string and a screen capture of each command attempted while online and running. The last two items ( online and running may be the root of your problem.
 
The PLC is a CompactLogix 2MB ENet Controller, 1769-L33ER SER A
 

Attachments

  • image.jpg
    image.jpg
    8.4 KB · Views: 62
  • image (1).jpg
    image (1).jpg
    20.3 KB · Views: 58
To get the actual fault data into the string holder tag I have. I copied what the actual fault was and pasted it into the holder. Everything should be the same in that regard, right?
 
Just to give you a bit of confidence, you are using the EQU instruction correctly. No need for CMP.

What happens if you COP the fault string to the holder string right before the EQU? Does the boolean still not turn on?

Can you change the bool to a test bit that you newly created? Just to avoid duplicate destructive issue.
 
The code is not moving the string value (length + data), it is COPYing the bits from somewhere (a SINT array, perhaps?) into the string object, and in so doing it is copying the first four characters, which are 'SRVO' and presumably the prefix before the hypen, into the string's four-byte .LEN attribute. Am I the only person who noticed the unreasonably-long .LENgth (1331057235) of those strings?
 
Also maybe helpful: What firmware are you running? There is a big difference in the older and newer firmwares in rockwell land when you're dealing with string literals.
 

Similar Topics

Hi, I will be scanning in a barcode. Here I will compare the scanned string against a table (DB) of known barcodes. Has anyone used FC10...
2
Replies
5,534
Views
can anyone tell me how to compare strings that store in DBs?thanks
6
Replies
3,576
Views
Hello all. I am having trouble finding a way (if one exists) to compare/evaluate a string tag. I have looked at the instruction help with what I...
9
Replies
795
Views
I have had an issue a couple of times where data updates or logging that should have been done once at the beginning of a new month or a new year...
5
Replies
877
Views
Hello! I want to compare three integers to see id they are the same number. How is this accomplished the best. I want like a three legged CMP ==...
10
Replies
1,254
Views
Top