You have to make sure that you are producing barcodes compliant with the
standard the barcode scanner is able to detect (e.g. EAN-13, see this
Wikipedia page for a list). You may refer to the barcode device documentation or compare your output to one your device is able to recognize.