cartduty Posted June 16, 2007 Report Posted June 16, 2007 Hello all! I was wondering if anyone knows an easy way to concatenate 5 Data registers into 1 Register. I am reading in a barcode, as it is currently setup each character is put into a single data register. I would like to move them all into one register for easy comparison. Any ideas? Thanks in advance!! Quote
Goody Posted June 16, 2007 Report Posted June 16, 2007 (edited) There is a good reason why the seperate characters were put in one register But more impressive was that word - never heard it before :) Main Entry: 1con·cat·e·nate Pronunciation: kän-'ka-t&-n&t, k&n- Function: adjective Etymology: Middle English, from Late Latin concatenatus, past participle of concatenare to link together, from Latin com- + catena chain : linked together Edited June 16, 2007 by Goody Quote
Paul Ked Posted June 17, 2007 Report Posted June 17, 2007 (edited) There is no way you can concatenate three (you want five?) registers into one. For example: 1001100010010101 & 1110010010010011 & 1000010000101010 could only be stored as a maximum of 32 bits (10011000100101011110010010010011) This would leave 100001000101010 outstanding in its' own field of glory and never to be recognised! Simplest way would be to have a bar code reader that can put the ID into the PLC (as Integer)! Best Regards Paul Ked Edited June 17, 2007 by Paul Ked Quote
Crossbow Posted June 17, 2007 Report Posted June 17, 2007 Typically bar codes are received as a string of ASCII text characters. Each character takes 8 bits to store, so each data register would typically get 2 characters, not one. And there is no way to store 5 characters in a single word. Quote
cartduty Posted June 19, 2007 Author Report Posted June 19, 2007 (edited) Hello All, Just replying about my problem. It turns out we can get by with just looking at four digits. There is a HEX command that will put four ascii characters into one register in a hex value. And inversely there is an ASCI command that will take a four digit hex value and put it into four seperate registers in ASCI command. Thanks for all the input!! Edited June 19, 2007 by cartduty Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.