The invention relates to a method for determining inter alia the stopper position of a medicament cartridge in a medical apparatus by means of a light source and photosensitive sensor surface, and a device for carrying out the method.本發明係關於一種用以在一醫療設備中使用一光源與感光面以判定一藥匣塞止件位置之方法,以及一種用以實行該方法之裝置。