A new programming method has been used for building a computer-based Mössbauer spectrometer. Data acquisition is realized via two commercially available PXI/Compact-PCI modules or PCI devices which are supported by relevant software drivers. Both modules, the digital oscilloscope NI 5102 and the function generator NI 5401 (National Instruments Inc.), can be used in the PXI or PC standard. The synchronization between the velocity signal generation and the impulse detection is controlled by a RTSI (Real-Time System Integration) bus. A virtual Mössbauer spectrometer is implemented by the graphical programming language called LabVIEW 7 Express. The amplitude selection of impulses from the detector output is realized with an assistance of the Waveform Peak Detection.vi function. The sampling rate of the detector output signal and the frequency of the velocity signal determinate the number of registration channels of measured Mössbauer spectrum. The Mössbauer spectra can be accumulated in the constant or variable velocity modes; moreover, there is a possibility to register gamma-ray spectra in the multichannel analyzer mode.