Connecting to MHS 5200 A by Minghe in Python
Instrument Card
MHS-5200A series instruments using large scale integrated circuits andhigh-speed FPGA MCU microprocessor, the internal circuit to take surface mounttechnology has greatly enhanced the instrument’s noise immunity and service life.Display interface using LC1602 LCD display is divided into two lines, the top lineshows the current frequency, the following line displays additional parameters orfunction variable and flexible use of flip key setting, greatly enhances the operability.
Device Specification: here
Manufacturer card: MINGHE
Could not find
- Headquarters:
- Yearly Revenue (millions, USD):
- Vendor Website: here
Connect to the MHS 5200 A in Python
Read our guide for turning Python scripts into Flojoy nodes.
PROTOCOLS > SCPI
Here is an example Python script that uses Instrumentkit to connect to a MHS 5200 A Function Generator:
Explanation:
- The
import instrumentkit as ik
statement imports the Instrumentkit library and assigns it the aliasik
. - The
ik.minghe.MHS5200.open_serial()
function is used to connect to the MHS 5200 A Function Generator via serial communication. Thevid
,pid
,baud
, andtimeout
parameters specify the vendor ID, product ID, baud rate, and timeout for the serial connection. - The
mhs.channel[0]
andmhs.channel[1]
statements access the first and second channels of the MHS 5200 A Function Generator, respectively. - The
frequency
property is used to set the frequency of a channel. In this example, the frequency of channel 1 is set to 1 kHz and the frequency of channel 2 is set to 2 kHz. - The
amplitude
property is used to set the amplitude of a channel. In this example, the amplitude of channel 1 is set to 2 V peak-to-peak and the amplitude of channel 2 is set to 1 V rms. - The
enable
property is used to enable or disable a channel. In this example, both channel 1 and channel 2 are enabled. - The
mhs.close()
statement is used to disconnect from the MHS 5200 A Function Generator.