Jump to content

Recommended Posts

Posted
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!!
Posted (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 by Goody
Posted (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 by Paul Ked
Posted
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.
Posted (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 by cartduty

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...