barcode and plc5

bernie

Member
Join Date
Dec 2005
Location
michigan
Posts
18
help!!!!
using a 1734 232asc point i/o module over devicenet back to a sdn module in the plc5 rack....
reading barcode back to a plc 5 (sdn to plc5)
have 1734 configured and mapped as best as i can
mapped back to a block xfer in the plc5 but to a n9 file which when i scan it reads all messed up unless i tab on ascii in rslogix than it looks o.k.
so whats the trick to getting the barcode to look right in the data table so i can move it to a "temp b" file which later will tie two barcodes together
right now all this is done by a business system and its being removed (sql server)
need help desperatly!!!!!
project is due and i am stressing
any and all help is greatly appreciated
hope everyone had a nice holiday
thanks
bernie
 
It may be a little clunky but, you should be able to copy 'n' words from N9:xx to a string file, ie. ST15:0. If this doesn't work, you can move the words to the string piecemeal via:

MOV N9:X ST15:0.DATA[Y] - MOV N9:X+1 ST15:0.DATA[Y+2] - and so on

Let Y=0 to start at the head of the string and keep in mind that each string word holds two characters (16 bits).

You'll also have to:

a. make some program logic to append a carriage return (read termination character) after the last data character. This may take a little doing since the carriage return may appear in either the upper or lower byte depending on the number of characters received from the scanner. This is necessary because the data didn't get there by 'natural' means. If the string were read directly from, say CH0 in ASCII mode, the data would be placed into the string by the PLC and the length value would be automatically set.

Caveat: This construction - .DATA[Y+2] - is undocumented in A-B literature (to my knowledge anyway) but it does work. One thing which will not work is using a variable for the offset Y+2, you must use a literal (constant) value. Therefore, you need to have a separate MOV for each two characters coming from N9:x plus one MOV for the leftover odd character (if any) at the end of the string.

b. Determine the number of characters and then move this value into the string length parameter by -

MOV [length of data] ST15:0.LEN

If the data length is fixed, you can use a constant, otherwise you'll need logic to work out how many characters are involved.

Once the data is correctly appearing in ST15:X, you can use the ASCII instructions to manipulate it in different ways. One of the available instructions will concatenate two strings.
 
Your data comes in INT - because this is devicenet.

If you need convert it to String, I would try COP instead of MOV:
COP copies a bit pattern, MOV copies the value. You need COP here.

Let say your barcode is 10 byte long.

COP N9:0 ST15:0.DATA[0] 10
MOV 10 ST15:0.LEN

This will cereate a string 10 bytes long.
 
bar code

thanks for your replies i will try the cop tech. first since it seems that i may have gone a difficult route to get this info. to the plc5
i hope all goes well any other suggestions or posts are greatly appreciated
this is a very important roject as thet all are and i am under the gun to get this off the ground this week
thanks again and please keep the replies coming
too much help is never enough
thanks
bernie
 
Curious. How long is the barcode and what format is it in? And we still don't know what scanner you're using. Let us in on that if you can.
 
scanner

bar code length is max 10 for tote which starts with a t and i only need the last three digits
the other pick tickett number is max 3 but min 1 digit
the scanner is a datalogic dragon om series
the barcode is standard 39
the 1734 232 asc module when minitored displays the barcode correctely but when it goes from there to the scanner to the plc5 n9 file it bit flips the last two digits and the only way i can view it is to set the display to ascii
still muddling my way through this
help
thanks
bernie
 
Last edited:
So you only need the last three characters--are you truncating the rest in the PLC (which you can do) or in the scanner. Also, are there a finite number of barcodes you will ever read in this scenario? Or is the number infinite?

A look at your current logic might shed a little light on the last two digits being transposed. Is it possible for you to zip up the logic and pdf it here? We can likely get you where you want to go.
 
trying to do everything in the plc

i dont have a way of getting the file to a zip at the present time
what happens is the present logic looks for two places b11:1 which is the first barcode that is scanned (contains ten char. all start with T sample T000000810) than it looks for a second scan to be done (1 to three digits) and that scan is placed in b11:2 once both are greater than 0 they are both sent of to b20 and b21 respectivly and are "married" up till the tote is at the end of the line which when there it is already set-up to clear that nuber from the datatable so the tote can get re-used
hope this helps
???????when i look at the asc module and view the serial input from the scanner the number is fine what changes it around from there to the plc???????
tried the cop instruction and the st15 file is giving me errors
dont know if its a set-up issue or what??
need help
trying
all responses helpful
thanks
 
What is b11:1?
Are you using Boolean file (B) or integer (N)?

Lets look at you logic step by step:

Devicenet brings 10 bytes - these bytes come as 5 INTEGERs to Nxx:yy. Right? What addresses (N) it's mapped?

Let say N30:21 - N30:25.
T000000810 will look like this in decimal:
N30:21 - 21552
N30:22 - 12336
N30:23 - 12336
N30:24 - 12344
N30:25 - 12592

Please confirm up to this point, so I can give you other steps.
 
I think he's mapping the values to B11:1 which is legal, but can be confusing. From his post, it looks like, if he's copying "two places" to a 16 bit integer (B11:01), he may be overwriting part of it later when he "looks for a second scan" at address B11:02. If "two places" means two 16 bit integers, then it would occupy B11:1 and B11:2, and the later scan of "1 to three digits" mapped to B11:2 would overwrite it.

bernie, can you be more specific about the "places" and "digits" terms you used. Are these Ints, double ints, a bit for bit copy of a string or ascii file, or what?
 
What I Have Mapped Is This

1734 232ascii To Sdn Type Cos
Size 24
Mapped N9:48.0 (input)
Mapped For Block Xfer 62
Word 48
Bit 0
Bit Length 192
(these Were All The Defaults)
Right Now With Every Scan N9:48 Increments By One

Keeping With T000000810 Scan

N9:49=2816
N9:50=21544
N9:51=12336
N9:52=12336
N9:53=12336
N9:54=12600
N9:55=48

Thats All The Info I Have
Thanks For The Reply
Await Yours
 
Ok I see, let me try. I will have to remotely connect to my test bench at work first ;)

What is in N9:49 and a first byte of N9:50?

I see "CtrlK" and "(" . Do you nee it?

In any case, you should try to shift DNET mapping one byte down, so all 10 bytes alinged with 5 integers.

Let me know if you do it, this will simplify logic.
 
Previous Working Ladder Is Like This Only A Sql Server Was Placing The Integer There

Equ--source A B20:[n7:29]
00000001000
Source B 0
0
Than......
Mov-------------b11:1 (16 Bit)
Dest. B20:[n7:29] (16 Bit)

Branch Down

Mov-------------b11:2 (16 Bit)
Dest. B21:[n7:29]


Hope This Helps
 
int hex ASCII
------------------------------
N9:49=2816 0b00 vt00
N9:50=21544 5428 T(
N9:51=12336 3030 00
N9:52=12336 3030 00
N9:53=12336 3030 00
N9:54=12600 3138 18
N9:55=48 30 0



Since the data was given as "T000000810", is it possible that EACH byte is getting reversed with its mate in all the words? I ask because of the placement of the "T(" characters.
 
I CAN RE-MAP I WILL DO SO BUT WILL HAVE TO FIND ROOM EXHISTING MAPPING PRETTY FULL JUST ALLOWED IT TO AUTO MAP TO FILL SPACE LEFT BY OTHERS

N9:48 IN ASCII RADIX IS \00c
FIRST BYTE OF N9:50 IN BINARY RADIX IS 0
IN ASCII RADIX IS T^J
HOPE THIS HELPS
 

Similar Topics

I am a student at Utah State University and am working on a project that involves a PLC-5. I am hoping some of you won't mind offering some...
Replies
5
Views
6,345
I need to link a PLC5/30, Panelview Plus 700 and a barcode scanner (currently RS232). My original plan was to use RMTIO between the PLC & PVP...
Replies
8
Views
8,764
does anyone know a simple way to allow a barcode scanner to introduce ascii to a plc5/80 e currently it is done using a sql server trying to make...
Replies
0
Views
3,666
Hello, I am trying to read a barcode scanner input using a cognex dataman 280 barcode reader, store it another string, the compare with another...
Replies
0
Views
21
Hi to everybody. I need to read the first 12 characters of the message that a barcode reader sends to the ascii card (1734-rs232 ascii) and I...
Replies
8
Views
732
Back
Top Bottom