The multimeter has a few options to control it remotely, the simplest way is using RS-232 interface with simple commands, sending ascii data to the serial port.
Command reference:
Python script on the github. It measures DC or AC voltage setting range and resolution of the voltmeter, writes data to CSV and PNG files and plots graph. Written with chatGPT help 🙂 :
https://github.com/enthru/hp34401a_control
Example of reading data of AC voltage in the socket for 360 measurements:
Supadupa RS-232 cable: