Hi Regis188, sad to hear about your bike. So there are a number of things, what bike and year? When was it ok last? Under the seat in a red sheath is a usb data logger. Remove this temporarily and copy off the last few .drv and .chg entries. Then load from this site onto a computer the Empulse datareader program to convert it to Excel. Look through the data to see what's causing the issue. Or attach one of each file on here and we'll tell you what it says.
B40 fault code usually has a major issue sadly. Not easy to return from historically.