Post a pic perhaps. Few of us are familiar with M40s, u might get a better response on an e36 forum as 518s are Europe only. Search online for procedures that test temperature sensors on M40 engines, that will let you know the resistances they should test at and where the connectors fit.