AB Basic Module and Barcode Scanner

Coops

Member
Join Date
Dec 2004
Posts
103
Hiya,

Anyone got a BASIC program to read in barcodes from a Datamax scanner. The scanner is a gun tpe with trigger. The PLC is an SLC 5/03. Ive used the basic modules before but just for printing barcodes but now they want to read a barcode in on the port as well. Anyone got a simple program to read them in.....thanks
 
Coops, I can help you if you need it. PM me your email and I will send you the basic file and a help sheet on loading the program.

Have you ever loaded a program in a basic module before?
Do you have code in your PLC to read the registers and put them in a place you can manipulate?
There are commands to handshake and clear out the buffer if needed, how often will you be scanning the barcode.
Do you want one port to read a barcode and another to print a barcode (this has 2 ports and can be done, but I've never done it)?
If possible, I would also change the battery in this thing, it often gets overlooked and when it dies, it is a big pain since there isn't any diagnostics.
There is also a manual on the commands out on the net. I think someone here posted a link to it once so I will try to find it.
 
Ive got the manual and ive also loaded and worked on programs in basic modules before but it was with a printer (Zebra).

There is just one barcode scanner and its connected to port 2, leaving port 1 for programming.

The scanner is a trigger/gun type so im not sure if it sends a command to say its scanned or not. It will be used in part of a sequence where the operator has to confirm what part they have loaded into the machine. They scan the barcode and the PLC will check the right one is loaded by comparing the barcode scanned against a look up table.

I do have a scanner program from an older project but i think it was using a scanner that was triggered from the Basic module rather than a trigger/gun type.

Thanks

 
Bruce your awesome fella and thanks for the great help.

BUT i have one or two issues. I have the basic program now able to take the barcode scanners input and pass it back to a ST file in the PLC so one would think all is well.....well almost. The problem is that if we scan the barcodes that they are meant to scan then all works great but some idiot decided to scan his bottle of coke and basically threw all the numbers out in the basic module. So basically to me it seems that the basic module waits to get 9 bytes of data?? which is fine for the normal barcode but our customer wants it idiot proof so is there any way in which i can clear the buffers or only allow the correct barcodes to be passed as if i scan a test barcode say with 'TEST' on it then the PLC will do nothing the first time until it it scanned again effectivley filling there requirement of 9 bytes of data??

CODE:
2 MODE (PRT1,1200,N,8,1,S,R)
3 MODE (PRT2,9600,N,8,1,S,R)
6 PUSH 2 : PUSH 8 : PUSH 13 : PUSH 1 : PUSH 0 : PUSH 0: PUSH 1
8 CALL 22
10 DIM A(8)
20 PUSH 8 : PUSH 0 : PUSH 1 : PUSH 0 : PUSH 0
30 CALL 30
40 CALL 58 : POP S
45 IF (S<>1) THEN GOTO 40
50 PUSH 3 : CALL 56 : POP X
60 FOR I=100 TO 107
70 PUSH I : CALL 15 : J=I-99 : POP A(J)
80 NEXT I
85 PUSH 2 : CALL 37
120 PRINT #USING(#),A(0),
130 PRINT #USING(#),A(1),
140 PRINT #USING(#),A(2),
150 PRINT #USING(#),A(3),
160 PRINT #USING(#),A(4),
170 PRINT #USING(#),A(5),
180 PRINT #USING(#),A(6),
190 PRINT #USING(#),A(7),
260 GOTO 40
270 END

Thanks alot for the help
 
hmmmm seems the code i need to use is:


10 PUSH 3 : CALL 120 : REM Clear all M0/M1 Buffers

20 PUSH 2 : CALL 96 : REM CLEAR PRT1 BUFFERs

30 PUSH 2 : CALL 37 : REM CLEAR PRT2 BUFFERs

any ideas on the best place to insert it and im thinking that the current barcode scanner is setup as CRLF and I might need to change the setup on that to be just CR (Enter) as this is the delimiter the program is looking for.
 
We use Real Time Automation

http://www.rtaautomation.com/products/435/ASCIICompact.html

Works great for Bar code scanners, and ASCII printing to label printers.

We have done battle with ASCII printers and Bar Code Scanners for yaers. While it is rewarding to arrive at success with a hundred lines of ladder logic to read a simple barcode, it is more profitible to arrive at the soulution with less effort.

Check out "Real Time Automation" ASCII Gateways. No ladder required. The bar code scan dumps right into ASCII string target.

Printing out is just as easy, just dump a string, and the RTA sucks it up. Label printing made easy.

http://www.rtaautomation.com/product...IICompact.html
progress.gif
 

Similar Topics

I have 2 identical systems that have the AB SLC500 Basic card in them. I system stopped working and the issue was traced back to the card...
Replies
15
Views
3,030
Hi all I have a SLC 5/04 with a BAS module sending print data to a dot matrix printer. In the Basic program in this module, there are what...
Replies
4
Views
1,910
Hey all, I have a project in the works to replace an old Siemens 505 rack, unfortunately the rack contains a 386/ATM card and two BASIC modules...
Replies
5
Views
3,024
Please I need to know how to add an image into a paper label, Im using a 1746-BAS module to send the data to a printer. thanks
Replies
2
Views
1,820
Hi all, Great forum you have here !! I am not a programmer, but have some basic ability to work with PLC's. (Rudimentary use of RSLinx, RSLogix...
Replies
4
Views
2,729
Back
Top Bottom