Device read function