s7 help for barcode compare

adamplc

Member
Join Date
Dec 2009
Location
usa
Posts
92
Hello to all I have s7300-2dp plc and need to compare 20 different part# that are scanned into a cp340 card via a intermec scanner.
I have loaded the scanned data into a db and now need to do the compare to all the other barcodes never done this before, so I am thinking of using the IEC fc10 string eq block. I am a little lost as I seem to only be able to enter temp strings into s1 and s2 and not my actual string location db address. How do I set this up? do I have to move my db address to a temp variable if so how?
Or is there a better way to do this?
Thanks for any help
 
How have you declared the area in the DB containing the string(s) - an array of chars, bytes or a string or what ?
 
It is declared as a string [16]
I import the string and T into a DB100.DBD10
I am wondering if I can
L DB100.DBD10
T temp1
call EQ_STRING (
S1 :=temp1,
S2 :=? ,
RET_VAL := RESULT);

I am sure you have a much better way so please let me learn.
 
Last edited:
It is declared as a string [16]
I import the string and T into a DB100.DBD10
I am wondering if I can
L DB100.DBD10
T temp1
call EQ_STRING (
S1 :=temp1,
S2 :=? ,
RET_VAL := RESULT);

L DB100.DBD10 loads a double word (4 bytes) so you can see that this instruction is of no use for a string of length 16 bytes.
 
excellent I see so the s1 is entered as DB#.name i was entering the address db#.dbd# and it didn't like that at all.

Thanks for your help
 
Another question is I have a MP377 and was planning on not have the operator select the pt# to run but rather using the scanned barcode tell the machine what to run so what is the best way to use the array of lookuptableofpartnos
thanks again
 
Another question is I have a MP377 and was planning on not have the operator select the pt# to run but rather using the scanned barcode tell the machine what to run so what is the best way to use the array of lookuptableofpartnos
thanks again

Not enough information to form an opinion :)
 
If you stuck to a fixed length string then you could use multiple compare instructions to compare the strings.

This is my first use of strings and barcodes so sorry for this stupid question but how could I use multiple compare instructions to compare the strings? It is a fixed length of [16]
 
I would not advocate this method, but you could do it like this and you have to manually work through the DB to find the correct addresses for each of the comparison strings.

scsc.jpg
 
Hello to all I have s7300-2dp plc and need to compare 20 different part# that are scanned into a cp340 card via a intermec scanner.
I have loaded the scanned data into a db and now need to do the compare to all the other barcodes never done this before, so I am thinking of using the IEC fc10 string eq block. I am a little lost as I seem to only be able to enter temp strings into s1 and s2 and not my actual string location db address. How do I set this up? do I have to move my db address to a temp variable if so how?
Or is there a better way to do this?
Thanks for any help
Example
 
Last edited:

Similar Topics

hi, i try to connect sick clv490 barcode scanner to hyperterminal to send some command like "21" turn on laser beam. it work fine with sick...
Replies
0
Views
1,507
hi, i try to connect to sick clv490 barcode using controllogix serial port but i can get it to work. im using ascii read port 0 but nothing.
Replies
0
Views
1,219
hi, i try to capture barcode data using UDT with SINT ascii array. i have all the data i need but it in array format, how can i convert to 1...
Replies
5
Views
3,088
Hello all, I'm working with the 1734-232 ASC module in a barcode application. The scanner reads the barcode and gets stored in the...
Replies
6
Views
3,003
I need some advice people on a small modification I need to do to a process. I have a contrologix PLC running this process. I'm currently using a...
Replies
2
Views
1,445
Back
Top Bottom