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