To correct the beam orbit in the storage ring, it is required to measure offset of every quadrupole's megnetic center relative to electrical center of its adjacent beam position monitor (BPM). By varying individual quadrupole maganet strength, the offsets could be calculated from the corresponding effects on the beam orbit.A program,which based on the hardware of BBA in HLS storage ring and EPICS, was developed with Lab View 6.1 on Windows system to control the measurement. The program manages quadrupole magnet strength, and performs a least squares fit of the result data points to a parabola, which indicates the offset, i.e. position of quadrupole magnetic center. These offsets were measured with an accuracy of better than 100 μm.