Novel fluorescent pyrido[1',2':1,2]imidazo[4,5-b]pyrazine derivatives having a crown ether side-arm, 1a, b, recognise alkaline earth metal cations and thiocyanate anions coincidentally, making a function as an AND logic gate which has fluorescence quenching output.