aboutsummaryrefslogtreecommitdiff
path: root/run.py
blob: 15a0dfa88ffa74e94c9063b965b827aa508b2ce6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from qolab.hardware.multimeter.hp3457a import HP3457A
from qolab.hardware.multimeter.bk_5491 import BK_5491
from qolab.hardware.multimeter.hp_34401 import HP_34401
from qolab.hardware.vacuum_gauge.mks390 import MKS390

from qolab.hardware.scope.sds800xhd import SDS800XHD

import pyvisa

# Example usage
if __name__ == "__main__":
    import matplotlib as mpl
    import matplotlib.pyplot as plt

    rm = pyvisa.ResourceManager()
    instruments_list = rm.list_resources()
    #----------------------------------------------
    # Open visa resources and initialize intruments
    dmm_hpa = HP3457A(
        rm.open_resource(instruments_list[6])
    )
    dmm_bk = BK_5491(
        rm.open_resource(instruments_list[4])
    )

    dmm_hp = HP_34401(
        rm.open_resource(instruments_list[3])
    )

    scope = SDS800XHD(
        rm.open_resource(instruments_list[8])
    )

    gauge = MKS390(
        rm.open_resource(instruments_list[5])
    )
    #-----------------------------------------------

    # Get DMM readings
    print(dmm_hpa.get_idn())
    print(f'HP4357A reading: {dmm_hpa.getAdc()}')
    print(f'BK5491 reading: {dmm_bk.getAdc()}')
    print(f'HP34401 reading: {dmm_hp.getAdc()}')
    print(f'MKS390 reading: {gauge.get_pressure()}')
    print(f'IG status: {gauge.get_ignition_status()}')
    gauge.enable_ignition(False)
    print(f'IG status: {gauge.get_ignition_status()}')

    trace = scope.getTrace(5)
    trace.plot()
    plt.show()