You need to say the model of the barcode scanner and the PIC microcontroller that you are using. I have one barcode scanner here that uses serial (UART) interface, but other interfaces (I2C/SPI) are possibile too. And instead of posting the entire homework or project description on the forum, try to post only the relevant bits - that may attract more replies to your topic.