you might take a look at this example... (located in the wiki section under projects/temperature)

http://www.picbasic.co.uk/forum/cont...r-nine-of-them

you can also search on "ds18b20" for other examples.
I would suggest you go through your code and add lots of comments to help you trouble shoot and for others to follow what you are trying to do.