Coil for magnetic valve