An apparatus for in situ measuring the hysteresis of magnetic materials by using pulsed magnetic field is structured. The samples were locally magnetized to saturation by the pulsed magnetic field. The pulsed field is generated by the discharge of a capacitor over the magnetizing coil. The measurement has been developed in LabView environment using National Instrument Data Acquisition Cards. The hysteresis loops of Q235 steel samples under various compressive stresses are presented.