To test any barcode scanner you can connect the scanner to USB port of PC & Open NOTEPAD or Microsoft WORD.
Scan any barcode to see the code printed on notepad window.
As you connect BARCODE SCANNER to PC it is considered as HID device (like mouse or keyboard) and any result from device will be printed on Notepad.
For connecting the scanner with Arduino you need an USB HOST Module.
CONNECTIONS BETWEEN SCANNER MODULE WITH ARDUINO:-
RXD of host connected to Tx of Arduino
TXD of host connected to Rx of Arduino
Power to scanner taken from Arduino 5v pin
Gnd to Gnd
HOW TO UPLOAD PROGRAM:-
While uploading code , remove connections at Rx/Tx pins.After upload successful connect back the pins.
int count = 0;
count = 0;
char input = Serial.read();