Sign in to follow this  
Followers 0
cartduty

FX2N concatenate

5 posts in this topic

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!!

Share this post


Link to post
Share on other sites
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 by Goody

Share this post


Link to post
Share on other sites
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 by Paul Ked

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 by cartduty

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0