We use cookies to ensure that we give you the best user experience on our website.If you want to find out more about the cookies we use, you can access to our Privacy Policy here.By continuing your visit to our website, we'll assume you consent to our use of cookies.

DENSO DENSO WAVE

Close

Technical Information

Application Development Manual | Reading bar codes

Function

Read and display bar codes.

Sample Program

'+===========================================================================+
'|  Declaration variables                                                    |
'+===========================================================================+
    const FileBar = 1

 
'+===========================================================================+
'|  Initial Settings                                                         |
'+===========================================================================+
    out &h6080,1                                      ' Set to small-size font

 
'+===========================================================================+
'|  User defined function                                                    |
'+===========================================================================+
'+---------------------------------------------------------------------------+
'|                                                                           |
'|  Function:   Wait for reading bar code                                    |
'|     None                                                               |
'|     bar code data                                                   |
'|                                                                           |
'|  Description:                                                             |
'|    Wait for reading barcode.                               |
'|    When a bar code is read, returns the bar code data.                    |
'|                                                                           |
'+---------------------------------------------------------------------------+
function readbar$[255]
private barlen%
open "BAR:B" as #FileBar code "A"   'Open bar code device
' for reading EAN/UPC
'      -open "BAR:B" as #FileBar code "K"   ' for CODE128
'      -open "BAR:B" as #FileBar code "Q"   ' for QR code
wait 0,&h02                         'Wait for bar code input
barlen% = loc(#FileBar)
if barlen% > 0 then                 'Check buffer for data
readbar$ = input$(barlen%, #FileBar)
'read bar code data
endif
close #FileBar
end function

 
'+===========================================================================+
'|  Main menu                                                                |
'+===========================================================================+
main:
private bardata$[255]       'Declare variable string for bar code data
private tempkey$
print "Read bar code!"
bardata$ = readbar$         'Call user-defined function
print bardata$
wait 0,&h01
tempkey$ = inkey$
power off

Contact us

QBdirect

If you have not registered

The services on this member site are available only for registered customers.

New member reg.