add 0.1 rev
This commit is contained in:
parent
ec56d54461
commit
804e83be3e
43
__init__.py
Normal file
43
__init__.py
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def instrument(pyvisa_instrument_address, device_handle):
|
||||||
|
"""
|
||||||
|
Create an instance
|
||||||
|
|
||||||
|
Args:
|
||||||
|
instrument_handle (Pyvisa Object): Input Pyvisa Object linked to target device.
|
||||||
|
device_handle (String): Input String indicating the make of the instrument.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Object: Object of the device with bare essential interface commands.
|
||||||
|
"""
|
||||||
|
# load the known devices json
|
||||||
|
handle_exists_flag = 0
|
||||||
|
module_obj = []
|
||||||
|
|
||||||
|
f = open('supported_devices.json')
|
||||||
|
allowed_handles = json.load(f)
|
||||||
|
for handle in allowed_handles['supported_instruments']:
|
||||||
|
# If handle found, create object
|
||||||
|
if handle["make"] == device_handle:
|
||||||
|
handle_exists_flag = 1
|
||||||
|
# load the right instrument module and save as global import
|
||||||
|
try:
|
||||||
|
sys.path.append(f"equipment/{handle["type"]}/py_generated/")
|
||||||
|
module_obj = __import__(f'{handle["make"]}')
|
||||||
|
module_obj = eval(f'module_obj.{handle["make"]}("{pyvisa_instrument_address}","{device_handle}")')
|
||||||
|
except:
|
||||||
|
raise ValueError(f'[MeasKit] Invalid \"{device_handle}\" instrument class.')
|
||||||
|
break
|
||||||
|
# If similar handle, warn user
|
||||||
|
elif handle["make"].lower() == device_handle.lower():
|
||||||
|
tmp = handle["make"]
|
||||||
|
print(f'[MeasKit] Similarely capitalized device handle found. Handle \"{device_handle}\" was queried for but \"{tmp}\" was found.')
|
||||||
|
f.close()
|
||||||
|
# If no exactly matching handles found error
|
||||||
|
if not handle_exists_flag:
|
||||||
|
raise ValueError(f'[MeasKit] Device handle \"{device_handle}\" not supported yet.')
|
||||||
|
# waste some resources in the mem heap, investigate removing these
|
||||||
|
return module_obj
|
||||||
|
|
||||||
139
equipment/multimeter/md_sourcefiles/3458A.md
Normal file
139
equipment/multimeter/md_sourcefiles/3458A.md
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
# LIBRARY COMMANDS
|
||||||
|
|
||||||
|
- MEAS_MODE(input)
|
||||||
|
3. FUNC(input)
|
||||||
|
|
||||||
|
- MEAS_RANGE(input)
|
||||||
|
3. RANG(input)
|
||||||
|
|
||||||
|
- AUTO_ZERO(input)
|
||||||
|
3. AZERO(input)
|
||||||
|
|
||||||
|
- ACQUISITION_TIME(input)
|
||||||
|
3. NPLC(input)
|
||||||
|
|
||||||
|
- RESOLUTION(input)
|
||||||
|
3. NDIG(input)
|
||||||
|
|
||||||
|
- MEAS_CONF(func,range,nplc,azero)
|
||||||
|
1. sets basic measurement partameters
|
||||||
|
3. FUNC(func)
|
||||||
|
3. RANG(range)
|
||||||
|
3. AZERO(nplc)
|
||||||
|
3. NPLC(azero)
|
||||||
|
3. NDIG('MAX')
|
||||||
|
|
||||||
|
- MEASURE()
|
||||||
|
1. measures single sample
|
||||||
|
3. TARM('HOLD')
|
||||||
|
3. TARM('SGL')
|
||||||
|
3. PAUSE
|
||||||
|
3. READ
|
||||||
|
|
||||||
|
- MEASURE_NSAMPLES(nsamples)
|
||||||
|
1. measures samples in the background and store into memory
|
||||||
|
3. TARM('HOLD')
|
||||||
|
3. MEM('FIFO')
|
||||||
|
3. NRDGS(nsamples,'AUTO')
|
||||||
|
|
||||||
|
- RECALL_NSAMPLES(nsamples)
|
||||||
|
1. recalls measured samples in the background and recall from memory
|
||||||
|
3. RMEM(1,nsamples)
|
||||||
|
3. READ
|
||||||
|
|
||||||
|
# SETTEABLE PARAMETERS
|
||||||
|
- ACAL
|
||||||
|
- ACBAND
|
||||||
|
- ADDRESS
|
||||||
|
- APER
|
||||||
|
- ARANGE
|
||||||
|
- AZERO
|
||||||
|
- BEEP
|
||||||
|
- CAL
|
||||||
|
- CALL
|
||||||
|
- CALSTR
|
||||||
|
- COMPRESS
|
||||||
|
- CONT
|
||||||
|
- CSB
|
||||||
|
- DEFEAT
|
||||||
|
- DEFKEY
|
||||||
|
- DELAY
|
||||||
|
- DELSUB
|
||||||
|
- DIAGNOST
|
||||||
|
- DISP
|
||||||
|
- EMASK
|
||||||
|
- END
|
||||||
|
- EXTOUT
|
||||||
|
- FIXEDZ
|
||||||
|
- FREQ
|
||||||
|
- FSOURCE
|
||||||
|
- FUNC
|
||||||
|
1. sets the measurement mode to be used
|
||||||
|
2. DCV|ACV|ACDCV|OHM|OHMF|DCI|ACI|ACDCI|FREQ|PER|DSAC|DSDC|SSAC|SSDC
|
||||||
|
- INBUF
|
||||||
|
- LEVEL
|
||||||
|
- LFILTER
|
||||||
|
- LFREQ
|
||||||
|
- LOCK
|
||||||
|
- MATH
|
||||||
|
- MEM
|
||||||
|
1. sets the storage mode of the internal memory
|
||||||
|
2. LIFO|FIFO|OFF
|
||||||
|
- MENU
|
||||||
|
- MFORMAT
|
||||||
|
- MMATH
|
||||||
|
- MSIZE
|
||||||
|
- NDIG
|
||||||
|
- NPLC
|
||||||
|
- NRDGS
|
||||||
|
- OCOMP
|
||||||
|
- OFORMAT
|
||||||
|
- PAUSE
|
||||||
|
- PER
|
||||||
|
- PRESET
|
||||||
|
- PURGE
|
||||||
|
- QFORMAT
|
||||||
|
- R
|
||||||
|
- RANG
|
||||||
|
1. sets the range
|
||||||
|
2. 0.1|1|10|100|1000|10000|100000|1000000|10000000|100000000|1000000000|AUTO
|
||||||
|
- RATIO
|
||||||
|
- RES
|
||||||
|
- RESET
|
||||||
|
- RMATH
|
||||||
|
- RQS
|
||||||
|
- RSTATE
|
||||||
|
- SCAL
|
||||||
|
- SCRATCH
|
||||||
|
- SECURE
|
||||||
|
- SETACV
|
||||||
|
- SLOPE
|
||||||
|
- SMATH
|
||||||
|
- SRQ
|
||||||
|
- SSTATE
|
||||||
|
- SUB
|
||||||
|
- SUBEND
|
||||||
|
- SWEEP
|
||||||
|
- T
|
||||||
|
- TARM
|
||||||
|
- TBUFF
|
||||||
|
- TERM
|
||||||
|
- TEST
|
||||||
|
- TIMER
|
||||||
|
- TONE
|
||||||
|
- TRIG
|
||||||
|
|
||||||
|
# GETTEABLE PARAMETERS
|
||||||
|
- AUXERR?
|
||||||
|
- CALNUM?
|
||||||
|
- ERR?
|
||||||
|
- ERRSTR?
|
||||||
|
- ID?
|
||||||
|
- ISCALE?
|
||||||
|
- LINE?
|
||||||
|
- MCOUNT?
|
||||||
|
- OPT?
|
||||||
|
- REV?
|
||||||
|
- SSPARAM?
|
||||||
|
- STB?
|
||||||
|
- TEMP?
|
||||||
284
equipment/oscilloscope/md_sourcefiles/DS1054Z.md
Normal file
284
equipment/oscilloscope/md_sourcefiles/DS1054Z.md
Normal file
@ -0,0 +1,284 @@
|
|||||||
|
# LIBRARY COMMANDS
|
||||||
|
|
||||||
|
- CONF_CHANNEL(channel,state,range,bandwidth,coupling)
|
||||||
|
1. recalls measured samples in the background and recall from memory
|
||||||
|
2. RMEM(1,nsamples)
|
||||||
|
3. READ
|
||||||
|
|
||||||
|
- CONF_TRIGGER(channel,state,range,bandwidth,coupling)
|
||||||
|
1. recalls measured samples in the background and recall from memory
|
||||||
|
2. RMEM(1,nsamples)
|
||||||
|
3. READ
|
||||||
|
|
||||||
|
# SETTEABLE PARAMETERS
|
||||||
|
- :AUToscale
|
||||||
|
- :CLEar
|
||||||
|
- :RUN
|
||||||
|
- :STOP
|
||||||
|
- :SINGle
|
||||||
|
- :TFORce
|
||||||
|
- :ACQuire:AVERages
|
||||||
|
- :ACQuire:MDEPth
|
||||||
|
- :ACQuire:TYPE
|
||||||
|
- :CALibrate:QUIT
|
||||||
|
- :CALibrate:STARt
|
||||||
|
- :CHANnel<n>:BWLimit
|
||||||
|
- :CHANnel<n>:COUPling
|
||||||
|
- :CHANnel<n>:DISPlay
|
||||||
|
- :CHANnel<n>:INVert
|
||||||
|
- :CHANnel<n>:OFFSet
|
||||||
|
- :CHANnel<n>:RANGe
|
||||||
|
- :CHANnel<n>:TCAL
|
||||||
|
- :CHANnel<n>:SCALe
|
||||||
|
- :CHANnel<n>:PROBe
|
||||||
|
- :CHANnel<n>:UNITs
|
||||||
|
- :CHANnel<n>:VERNier
|
||||||
|
- :CURSor:MODE
|
||||||
|
- :CURSor:MANual
|
||||||
|
- :CURSor:TRACk
|
||||||
|
- :CURSor:AUTO
|
||||||
|
- :CURSor:XY
|
||||||
|
- :DECoder<n>:MODE
|
||||||
|
- :DECoder<n>:DISPlay
|
||||||
|
- :DECoder<n>:FORMat
|
||||||
|
- :DECoder<n>:POSition
|
||||||
|
- :DECoder<n>:THREshold:CHANnel1
|
||||||
|
- :DECoder<n>:THREshold:CHANnel2
|
||||||
|
- :DECoder<n>:THREshold:CHANnel3
|
||||||
|
- :DECoder<n>:THREshold:CHANnel4
|
||||||
|
- :DECoder<n>:THREshold:AUTO
|
||||||
|
- :DECoder<n>:CONFig:LABel
|
||||||
|
- :DECoder<n>:CONFig:LINE
|
||||||
|
- :DECoder<n>:CONFig:FORMat
|
||||||
|
- :DECoder<n>:CONFig:ENDian
|
||||||
|
- :DECoder<n>:CONFig:WIDth
|
||||||
|
- :DECoder<n>:UART
|
||||||
|
- :DECoder<n>:IIC
|
||||||
|
- :DECoder<n>:SPI
|
||||||
|
- :DECoder<n>:PARallel
|
||||||
|
- :DISPlay:CLEar
|
||||||
|
- :DISPlay:TYPE
|
||||||
|
- :DISPlay:GRADing:TIME
|
||||||
|
- :DISPlay:WBRightness
|
||||||
|
- :DISPlay:GRID
|
||||||
|
- :DISPlay:GBRightness
|
||||||
|
- :ETABle Commands
|
||||||
|
- :ETABle<n>:DISP
|
||||||
|
- :ETABle<n>:FORMat
|
||||||
|
- :ETABle<n>:VIEW
|
||||||
|
- :ETABle<n>:COLumn
|
||||||
|
- :ETABle<n>:ROW
|
||||||
|
- :ETABle<n>:SORT
|
||||||
|
- :FUNCtion:WRECord:FEND
|
||||||
|
- :FUNCtion:WRECord:FINTerval
|
||||||
|
- :FUNCtion:WRECord:PROMpt
|
||||||
|
- :FUNCtion:WRECord:OPERate
|
||||||
|
- :FUNCtion:WRECord:ENABle
|
||||||
|
- :FUNCtion:WREPlay:FSTart
|
||||||
|
- :FUNCtion:WREPlay:FEND
|
||||||
|
- :FUNCtion:WREPlay:FMAX?
|
||||||
|
- :FUNCtion:WREPlay:FINTerval
|
||||||
|
- :FUNCtion:WREPlay:MODE
|
||||||
|
- :FUNCtion:WREPlay:DIRection
|
||||||
|
- :FUNCtion:WREPlay:OPERate
|
||||||
|
- :FUNCtion:WREPlay:FCURrent
|
||||||
|
- *CLS
|
||||||
|
- *ESE
|
||||||
|
- *OPC
|
||||||
|
- *RST
|
||||||
|
- *SRE
|
||||||
|
- *WAI
|
||||||
|
- :LA:ACTive
|
||||||
|
- :LA:AUTosort
|
||||||
|
- :LA:DIGital<n>:DISPlay
|
||||||
|
- :LA:DIGital<n>:POSition
|
||||||
|
- :LA:DIGital<n>:LABel
|
||||||
|
- :LA:DISPlay
|
||||||
|
- :LA:POD<n>:DISPlay
|
||||||
|
- :LA:POD<n>:THReshold
|
||||||
|
- :LA:SIZE
|
||||||
|
- :LA:STATe
|
||||||
|
- :LA:TCALibrate
|
||||||
|
- :LAN:DHCP
|
||||||
|
- :LAN:AUToip
|
||||||
|
- :LAN:GATeway
|
||||||
|
- :LAN:DNS
|
||||||
|
- :LAN:MANual
|
||||||
|
- :LAN:INITiate
|
||||||
|
- :LAN:IPADdress
|
||||||
|
- :LAN:SMASk
|
||||||
|
- :LAN:APPLy
|
||||||
|
- :MATH:DISPlay
|
||||||
|
- :MATH:OPERator
|
||||||
|
- :MATH:SOURce1
|
||||||
|
- :MATH:SOURce2
|
||||||
|
- :MATH:LSOUrce1
|
||||||
|
- :MATH:LSOUrce2
|
||||||
|
- :MATH:SCALe
|
||||||
|
- :MATH:OFFSet
|
||||||
|
- :MATH:INVert
|
||||||
|
- :MATH:RESet
|
||||||
|
- :MATH:FFT:SOURce
|
||||||
|
- :MATH:FFT:WINDow
|
||||||
|
- :MATH:FFT:SPLit
|
||||||
|
- :MATH:FFT:UNIT
|
||||||
|
- :MATH:FFT:HSCale
|
||||||
|
- :MATH:FFT:HCENter
|
||||||
|
- :MATH:FFT:MODE
|
||||||
|
- :MATH:FILTer:TYPE
|
||||||
|
- :MATH:FILTer:W1
|
||||||
|
- :MATH:FILTer:W2
|
||||||
|
- :MATH:OPTion:STARt
|
||||||
|
- :MATH:OPTion:END
|
||||||
|
- :MATH:OPTion:INVert
|
||||||
|
- :MATH:OPTion:SENSitivity
|
||||||
|
- :MATH:OPTion:DIStance
|
||||||
|
- :MATH:OPTion:ASCale
|
||||||
|
- :MATH:OPTion:THReshold1
|
||||||
|
- :MATH:OPTion:THReshold2
|
||||||
|
- :MATH:OPTion:FX:SOURce1
|
||||||
|
- :MATH:OPTion:FX:SOURce2
|
||||||
|
- :MATH:OPTion:FX:OPERator
|
||||||
|
- :MASK:ENABle
|
||||||
|
- :MASK:SOURce
|
||||||
|
- :MASK:OPERate
|
||||||
|
- :MASK:MDISplay
|
||||||
|
- :MASK:SOOutput
|
||||||
|
- :MASK:OUTPut
|
||||||
|
- :MASK:X
|
||||||
|
- :MASK:Y
|
||||||
|
- :MASK:CREate
|
||||||
|
- :MASK:RESet
|
||||||
|
- :MEASure:SOURce
|
||||||
|
- :MEASure:COUNter:SOURce
|
||||||
|
- :MEASure:CLEar
|
||||||
|
- :MEASure:RECover
|
||||||
|
- :MEASure:ADISplay
|
||||||
|
- :MEASure:AMSource
|
||||||
|
- :MEASure:SETup:MAX
|
||||||
|
- :MEASure:SETup:MID
|
||||||
|
- :MEASure:SETup:MIN
|
||||||
|
- :MEASure:SETup:PSA
|
||||||
|
- :MEASure:SETup:PSB
|
||||||
|
- :MEASure:SETup:DSA
|
||||||
|
- :MEASure:SETup:DSB
|
||||||
|
- :MEASure:STATistic:DISPlay
|
||||||
|
- :MEASure:STATistic:MODE
|
||||||
|
- :MEASure:STATistic:RESet
|
||||||
|
- :MEASure:STATistic:ITEM
|
||||||
|
- :MEASure:ITEM
|
||||||
|
- :REFerence:DISPlay
|
||||||
|
- :REFerence<n>:ENABle
|
||||||
|
- :REFerence<n>:SOURce
|
||||||
|
- :REFerence<n>:VSCale
|
||||||
|
- :REFerence<n>:VOFFset
|
||||||
|
- :REFerence<n>:RESet
|
||||||
|
- :REFerence<n>:CURRent
|
||||||
|
- :REFerence<n>:SAVe
|
||||||
|
- :REFerence<n>:COLor
|
||||||
|
- :SOURce[<n>]:OUTPut[<n>][:STATe]
|
||||||
|
- :SOURce[<n>]:OUTPut[<n>]:IMPedance
|
||||||
|
- :SOURce[<n>]:FREQuency[:FIXed]
|
||||||
|
- :SOURce[<n>]:PHASe[:ADJust]
|
||||||
|
- :SOURce[<n>]:PHASe:INITiate
|
||||||
|
- :SOURce[<n>]:FUNCtion[:SHAPe]
|
||||||
|
- :SOURce[<n>]:FUNCtion:RAMP:SYMMetry
|
||||||
|
- :SOURce[<n>]:VOLTage[:LEVel][:IMMediate][:AMPLitude]
|
||||||
|
- :SOURce[<n>]:VOLTage[:LEVel][:IMMediate]:OFFSet
|
||||||
|
- :SOURce[<n>]:PULSe:DCYCle
|
||||||
|
- :SOURce[<n>]:MOD[:STATe]
|
||||||
|
- :SOURce[<n>]:MOD:TYPe
|
||||||
|
- :SOURce[<n>]:MOD:AM[:DEPTh]
|
||||||
|
- :SOURce[<n>]:MOD:AM:INTernal:FREQuency
|
||||||
|
- :SOURce[<n>]:MOD:FM:INTernal:FREQuency
|
||||||
|
- :SOURce[<n>]:MOD:AM:INTernal:FUNCtion
|
||||||
|
- :SOURce[<n>]:MOD:FM:INTernal:FUNCtion
|
||||||
|
- :SOURce[<n>]:MOD:FM[:DEVIation]
|
||||||
|
- :SOURce[<n>]:APPLy:NOISe
|
||||||
|
- :SOURce[<n>]:APPLy:PULSe
|
||||||
|
- :SOURce[<n>]:APPLy:RAMP
|
||||||
|
- :SOURce[<n>]:APPLy:SINusoid
|
||||||
|
- :SOURce[<n>]:APPLy:SQUare
|
||||||
|
- :SOURce[<n>]:APPLy:USER
|
||||||
|
- :STORage
|
||||||
|
- :STORage:IMAGe:TYPE
|
||||||
|
- :STORage:IMAGe:INVERT
|
||||||
|
- :STORage:IMAGe:COLor
|
||||||
|
- :SYSTem
|
||||||
|
- :SYSTem:AUToscale
|
||||||
|
- :SYSTem:GAM?
|
||||||
|
- :SYSTem:LANGuage
|
||||||
|
- :SYSTem:LOCKed
|
||||||
|
- :SYSTem:PON
|
||||||
|
- :SYSTem:OPTion:INSTall
|
||||||
|
- :SYSTem:OPTion:UNINSTall
|
||||||
|
- :SYSTem:RAM?
|
||||||
|
- :SYSTem:SETup
|
||||||
|
- :TRACe[<n>]
|
||||||
|
- :TRACe[<n>]:DATA
|
||||||
|
- :TRACe[<n>]:DATA:DAC16
|
||||||
|
- :TRACe[<n>]:DATA:DAC
|
||||||
|
- :TRACe[<n>]:DATA:POINts
|
||||||
|
- :TRACe[<n>]:DATA:POINts:INTerpolate
|
||||||
|
- :TRACe[<n>]:DATA:VALue
|
||||||
|
- :TRACe[<n>]:DATA:LOAD?
|
||||||
|
- :TIMebase:DELay:ENABle
|
||||||
|
- :TIMebase:DELay:OFFSet
|
||||||
|
- :TIMebase:DELay:SCALe
|
||||||
|
- :TIMebase[:MAIN]:OFFSet
|
||||||
|
- :TIMebase[:MAIN]:SCALe
|
||||||
|
- :TIMebase:MODE
|
||||||
|
- :TRIGger:MODE
|
||||||
|
- :TRIGger:COUPling
|
||||||
|
- :TRIGger:SWEep
|
||||||
|
- :TRIGger:HOLDoff
|
||||||
|
- :TRIGger:NREJect
|
||||||
|
- :TRIGger:EDGe
|
||||||
|
- :TRIGger:PULSe
|
||||||
|
- :TRIGger:SLOPe
|
||||||
|
- :TRIGger:VIDeo
|
||||||
|
- :TRIGger:PATTern
|
||||||
|
- :TRIGger:DURATion
|
||||||
|
- :TRIGger:TIMeout
|
||||||
|
- :TRIGger:RUNT
|
||||||
|
- :TRIGger:WINDows
|
||||||
|
- :TRIGger:DELay
|
||||||
|
- :TRIGger:SHOLd
|
||||||
|
- :TRIGger:NEDGe
|
||||||
|
- :TRIGger:RS232
|
||||||
|
- :TRIGger:IIC
|
||||||
|
- :TRIGger:SPI
|
||||||
|
- :WAVeform:STARt
|
||||||
|
- :WAVeform:STOP
|
||||||
|
- :WAVeform:SOURce
|
||||||
|
- :WAVeform:MODE
|
||||||
|
- :WAVeform:FORMat
|
||||||
|
|
||||||
|
# GETTEABLE PARAMETERS
|
||||||
|
- :LAN:STATus?
|
||||||
|
- :LAN:VISA?
|
||||||
|
- :WAVeform:DATA?
|
||||||
|
- :WAVeform:XINCrement?
|
||||||
|
- :WAVeform:XORigin?
|
||||||
|
- :WAVeform:XREFerence?
|
||||||
|
- :WAVeform:YINCrement?
|
||||||
|
- :WAVeform:YORigin?
|
||||||
|
- :WAVeform:YREFerence?
|
||||||
|
- :WAVeform:PREamble?
|
||||||
|
- :TRIGger:POSition?
|
||||||
|
- :SYSTem:ERRor[:NEXT]?
|
||||||
|
- [:SOURce[<n>]]:APPLy?
|
||||||
|
- :FUNCtion:WRECord:FMAX?
|
||||||
|
- *ESR?
|
||||||
|
- *IDN?
|
||||||
|
- *STB?
|
||||||
|
- *TST?
|
||||||
|
- :LAN:MAC?
|
||||||
|
- :MASK:PASSed?
|
||||||
|
- :MASK:FAILed?
|
||||||
|
- :MASK:TOTal?
|
||||||
|
- :MEASure:COUNter:VALue?
|
||||||
|
- :ACQuire:SRATe?
|
||||||
|
- :ETABle<n>:DATA?
|
||||||
|
- :DISPlay:DATA?
|
||||||
|
- :DECoder<n>:CONFig:SRATe?
|
||||||
541
equipment/oscilloscope/py_generated/DS1054Z.py
Normal file
541
equipment/oscilloscope/py_generated/DS1054Z.py
Normal file
@ -0,0 +1,541 @@
|
|||||||
|
import pyvisa
|
||||||
|
|
||||||
|
class DS1054Z(object):
|
||||||
|
def __init__(self, pyvisa_instrument_address, device_handle):
|
||||||
|
# initiate correct device class and pass pyvisa handle
|
||||||
|
self.pyvisa_instrument_address = pyvisa_instrument_address
|
||||||
|
self.pyvisa_instrument_manager = pyvisa.ResourceManager()
|
||||||
|
self.pyvisa_instrument_object = self.pyvisa_instrument_manager.open_resource(pyvisa_instrument_address)
|
||||||
|
self.pyvisa_instrument_object = self.pyvisa_instrument_object
|
||||||
|
self.device_handle = device_handle
|
||||||
|
print(f"[MeasKit] started control class instance for {device_handle} at {pyvisa_instrument_address}.")
|
||||||
|
def conf_channel(self,channel,state,range,bandwidth,coupling):
|
||||||
|
'''Configures a singular Channel'''
|
||||||
|
self.CHANneln_DISPlay(channel, state)
|
||||||
|
self.CHANneln_RANGe(channel, range)
|
||||||
|
self.CHANneln_BWLimit(channel, range)
|
||||||
|
self.CHANneln_COUPling(channel, coupling)
|
||||||
|
def conf_trigger(self,mode,level,pos_neg,n_edge = 1):
|
||||||
|
'''sets up trigger on nth falling/rising edge'''
|
||||||
|
self.TRIGger_MODE('NEDG')
|
||||||
|
self.TRIGger_NEDGe_LEVel(level)
|
||||||
|
self.TRIGger_NEDGe_EDGE(n_edge)
|
||||||
|
self.TRIGger_NEDGe_SLOPe(pos_neg)
|
||||||
|
def conf_timebase(self,time_div,timebase_skew):
|
||||||
|
'''sets up timebase'''
|
||||||
|
self.TIMebase_MAIN_SCALe(time_div)
|
||||||
|
self.TIMebase_MAIN_OFFSet(timebase_skew)
|
||||||
|
def send_trigger(self,single_force = "SINGle"):
|
||||||
|
'''send trig'''
|
||||||
|
if "FOR" in single_force.upper():
|
||||||
|
self.TFORce()
|
||||||
|
else:
|
||||||
|
self.SINGle()
|
||||||
|
def get_data(self,channel):
|
||||||
|
'''get data from channel'''
|
||||||
|
self.WAVeform_SOURce(channel)
|
||||||
|
self.WAVeform_MODE('RAW')
|
||||||
|
self.WAVeform_FORMat('ASCii')
|
||||||
|
return self.WAVeform_DATA()
|
||||||
|
|
||||||
|
def AUToscale(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':AUToscale {str(input)}')
|
||||||
|
def CLEar(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CLEar {str(input)}')
|
||||||
|
def RUN(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':RUN {str(input)}')
|
||||||
|
def STOP(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':STOP {str(input)}')
|
||||||
|
def SINGle(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SINGle {str(input)}')
|
||||||
|
def TFORce(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TFORce {str(input)}')
|
||||||
|
def ACQuire_AVERages(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':ACQuire:AVERages {str(input)}')
|
||||||
|
def ACQuire_MDEPth(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':ACQuire:MDEPth {str(input)}')
|
||||||
|
def ACQuire_TYPE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':ACQuire:TYPE {str(input)}')
|
||||||
|
def CALibrate_QUIT(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CALibrate:QUIT {str(input)}')
|
||||||
|
def CALibrate_STARt(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CALibrate:STARt {str(input)}')
|
||||||
|
def CHANneln_BWLimit(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:BWLimit {str(input)}')
|
||||||
|
def CHANneln_COUPling(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:COUPling {str(input)}')
|
||||||
|
def CHANneln_DISPlay(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:DISPlay {str(input)}')
|
||||||
|
def CHANneln_INVert(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:INVert {str(input)}')
|
||||||
|
def CHANneln_OFFSet(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:OFFSet {str(input)}')
|
||||||
|
def CHANneln_RANGe(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:RANGe {str(input)}')
|
||||||
|
def CHANneln_TCAL(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:TCAL {str(input)}')
|
||||||
|
def CHANneln_SCALe(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:SCALe {str(input)}')
|
||||||
|
def CHANneln_PROBe(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:PROBe {str(input)}')
|
||||||
|
def CHANneln_UNITs(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:UNITs {str(input)}')
|
||||||
|
def CHANneln_VERNier(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CHANnel{str(channel)}:VERNier {str(input)}')
|
||||||
|
def CURSor_MODE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CURSor:MODE {str(input)}')
|
||||||
|
def CURSor_MANual(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CURSor:MANual {str(input)}')
|
||||||
|
def CURSor_TRACk(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CURSor:TRACk {str(input)}')
|
||||||
|
def CURSor_AUTO(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CURSor:AUTO {str(input)}')
|
||||||
|
def CURSor_XY(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':CURSor:XY {str(input)}')
|
||||||
|
def DECodern_MODE(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:MODE {str(input)}')
|
||||||
|
def DECodern_DISPlay(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:DISPlay {str(input)}')
|
||||||
|
def DECodern_FORMat(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:FORMat {str(input)}')
|
||||||
|
def DECodern_POSition(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:POSition {str(input)}')
|
||||||
|
def DECodern_THREshold_CHANnel1(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:THREshold:CHANnel1 {str(input)}')
|
||||||
|
def DECodern_THREshold_CHANnel2(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:THREshold:CHANnel2 {str(input)}')
|
||||||
|
def DECodern_THREshold_CHANnel3(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:THREshold:CHANnel3 {str(input)}')
|
||||||
|
def DECodern_THREshold_CHANnel4(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:THREshold:CHANnel4 {str(input)}')
|
||||||
|
def DECodern_THREshold_AUTO(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:THREshold:AUTO {str(input)}')
|
||||||
|
def DECodern_CONFig_LABel(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:CONFig:LABel {str(input)}')
|
||||||
|
def DECodern_CONFig_LINE(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:CONFig:LINE {str(input)}')
|
||||||
|
def DECodern_CONFig_FORMat(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:CONFig:FORMat {str(input)}')
|
||||||
|
def DECodern_CONFig_ENDian(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:CONFig:ENDian {str(input)}')
|
||||||
|
def DECodern_CONFig_WIDth(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:CONFig:WIDth {str(input)}')
|
||||||
|
def DECodern_UART(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:UART {str(input)}')
|
||||||
|
def DECodern_IIC(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:IIC {str(input)}')
|
||||||
|
def DECodern_SPI(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:SPI {str(input)}')
|
||||||
|
def DECodern_PARallel(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder{str(channel)}:PARallel {str(input)}')
|
||||||
|
def DISPlay_CLEar(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DISPlay:CLEar {str(input)}')
|
||||||
|
def DISPlay_TYPE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DISPlay:TYPE {str(input)}')
|
||||||
|
def DISPlay_GRADing_TIME(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DISPlay:GRADing:TIME {str(input)}')
|
||||||
|
def DISPlay_WBRightness(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DISPlay:WBRightness {str(input)}')
|
||||||
|
def DISPlay_GRID(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DISPlay:GRID {str(input)}')
|
||||||
|
def DISPlay_GBRightness(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':DISPlay:GBRightness {str(input)}')
|
||||||
|
def ETABleCommands(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':ETABle Commands {str(input)}')
|
||||||
|
def ETABlen_DISP(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':ETABle{str(channel)}:DISP {str(input)}')
|
||||||
|
def ETABlen_FORMat(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':ETABle{str(channel)}:FORMat {str(input)}')
|
||||||
|
def ETABlen_VIEW(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':ETABle{str(channel)}:VIEW {str(input)}')
|
||||||
|
def ETABlen_COLumn(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':ETABle{str(channel)}COLumn {str(input)}')
|
||||||
|
def ETABlen_ROW(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':ETABle{str(channel)}:ROW {str(input)}')
|
||||||
|
def ETABlen_SORT(self, channel = None, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':ETABle{str(channel)}:SORT {str(input)}')
|
||||||
|
def FUNCtion_WRECord_FEND(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WRECord:FEND {str(input)}')
|
||||||
|
def FUNCtion_WRECord_FINTerval(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WRECord:FINTerval {str(input)}')
|
||||||
|
def FUNCtion_WRECord_PROMpt(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WRECord:PROMpt {str(input)}')
|
||||||
|
def FUNCtion_WRECord_OPERate(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WRECord:OPERate {str(input)}')
|
||||||
|
def FUNCtion_WRECord_ENABle(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WRECord:ENABle {str(input)}')
|
||||||
|
def FUNCtion_WREPlay_FSTart(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WREPlay:FSTart {str(input)}')
|
||||||
|
def FUNCtion_WREPlay_FEND(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WREPlay:FEND {str(input)}')
|
||||||
|
def FUNCtion_WREPlay_FMAX(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WREPlay:FMAX? {str(input)}')
|
||||||
|
def FUNCtion_WREPlay_FINTerval(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WREPlay:FINTerval {str(input)}')
|
||||||
|
def FUNCtion_WREPlay_MODE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WREPlay:MODE {str(input)}')
|
||||||
|
def FUNCtion_WREPlay_DIRection(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WREPlay:DIRection {str(input)}')
|
||||||
|
def FUNCtion_WREPlay_OPERate(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WREPlay:OPERate {str(input)}')
|
||||||
|
def FUNCtion_WREPlay_FCURrent(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WREPlay:FCURrent {str(input)}')
|
||||||
|
def CLS(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f'*CLS {str(input)}')
|
||||||
|
def ESE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f'*ESE {str(input)}')
|
||||||
|
def OPC(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f'*OPC {str(input)}')
|
||||||
|
def RST(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f'*RST {str(input)}')
|
||||||
|
def SRE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f'*SRE {str(input)}')
|
||||||
|
def WAI(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f'*WAI {str(input)}')
|
||||||
|
def LAN_DHCP(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:DHCP {str(input)}')
|
||||||
|
def LAN_AUToip(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:AUToip {str(input)}')
|
||||||
|
def LAN_GATeway(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:GATeway {str(input)}')
|
||||||
|
def LAN_DNS(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:DNS {str(input)}')
|
||||||
|
def LAN_MANual(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:MANual {str(input)}')
|
||||||
|
def LAN_INITiate(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:INITiate {str(input)}')
|
||||||
|
def LAN_IPADdress(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:IPADdress {str(input)}')
|
||||||
|
def LAN_SMASk(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:SMASk {str(input)}')
|
||||||
|
def LAN_APPLy(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:APPLy {str(input)}')
|
||||||
|
def MATH_DISPlay(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:DISPlay {str(input)}')
|
||||||
|
def MATH_OPERator(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPERator {str(input)}')
|
||||||
|
def MATH_SOURce1(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:SOURce1 {str(input)}')
|
||||||
|
def MATH_SOURce2(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:SOURce2 {str(input)}')
|
||||||
|
def MATH_LSOUrce1(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:LSOUrce1 {str(input)}')
|
||||||
|
def MATH_LSOUrce2(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:LSOUrce2 {str(input)}')
|
||||||
|
def MATH_SCALe(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:SCALe {str(input)}')
|
||||||
|
def MATH_OFFSet(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OFFSet {str(input)}')
|
||||||
|
def MATH_INVert(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:INVert {str(input)}')
|
||||||
|
def MATH_RESet(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:RESet {str(input)}')
|
||||||
|
def MATH_FFT_SOURce(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:FFT:SOURce {str(input)}')
|
||||||
|
def MATH_FFT_WINDow(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:FFT:WINDow {str(input)}')
|
||||||
|
def MATH_FFT_SPLit(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:FFT:SPLit {str(input)}')
|
||||||
|
def MATH_FFT_UNIT(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:FFT:UNIT {str(input)}')
|
||||||
|
def MATH_FFT_HSCale(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:FFT:HSCale {str(input)}')
|
||||||
|
def MATH_FFT_HCENter(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:FFT:HCENter {str(input)}')
|
||||||
|
def MATH_FFT_MODE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:FFT:MODE {str(input)}')
|
||||||
|
def MATH_FILTer_TYPE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:FILTer:TYPE {str(input)}')
|
||||||
|
def MATH_FILTer_W1(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:FILTer:W1 {str(input)}')
|
||||||
|
def MATH_FILTer_W2(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:FILTer:W2 {str(input)}')
|
||||||
|
def MATH_OPTion_STARt(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:STARt {str(input)}')
|
||||||
|
def MATH_OPTion_END(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:END {str(input)}')
|
||||||
|
def MATH_OPTion_INVert(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:INVert {str(input)}')
|
||||||
|
def MATH_OPTion_SENSitivity(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:SENSitivity {str(input)}')
|
||||||
|
def MATH_OPTion_DIStance(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:DIStance {str(input)}')
|
||||||
|
def MATH_OPTion_ASCale(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:ASCale {str(input)}')
|
||||||
|
def MATH_OPTion_THReshold1(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:THReshold1 {str(input)}')
|
||||||
|
def MATH_OPTion_THReshold2(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:THReshold2 {str(input)}')
|
||||||
|
def MATH_OPTion_FX_SOURce1(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:FX:SOURce1 {str(input)}')
|
||||||
|
def MATH_OPTion_FX_SOURce2(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:FX:SOURce2 {str(input)}')
|
||||||
|
def MATH_OPTion_FX_OPERator(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MATH:OPTion:FX:OPERator {str(input)}')
|
||||||
|
def MASK_ENABle(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:ENABle {str(input)}')
|
||||||
|
def MASK_SOURce(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:SOURce {str(input)}')
|
||||||
|
def MASK_OPERate(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:OPERate {str(input)}')
|
||||||
|
def MASK_MDISplay(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:MDISplay {str(input)}')
|
||||||
|
def MASK_SOOutput(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:SOOutput {str(input)}')
|
||||||
|
def MASK_OUTPut(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:OUTPut {str(input)}')
|
||||||
|
def MASK_X(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:X {str(input)}')
|
||||||
|
def MASK_Y(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:Y {str(input)}')
|
||||||
|
def MASK_CREate(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:CREate {str(input)}')
|
||||||
|
def MASK_RESet(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:RESet {str(input)}')
|
||||||
|
def MEASure_SOURce(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:SOURce {str(input)}')
|
||||||
|
def MEASure_COUNter_SOURce(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:COUNter:SOURce {str(input)}')
|
||||||
|
def MEASure_CLEar(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:CLEar {str(input)}')
|
||||||
|
def MEASure_RECover(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:RECover {str(input)}')
|
||||||
|
def MEASure_ADISplay(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:ADISplay {str(input)}')
|
||||||
|
def MEASure_AMSource(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:AMSource {str(input)}')
|
||||||
|
def MEASure_SETup_MAX(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:SETup:MAX {str(input)}')
|
||||||
|
def MEASure_SETup_MID(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:SETup:MID {str(input)}')
|
||||||
|
def MEASure_SETup_MIN(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:SETup:MIN {str(input)}')
|
||||||
|
def MEASure_SETup_PSA(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:SETup:PSA {str(input)}')
|
||||||
|
def MEASure_SETup_PSB(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:SETup:PSB {str(input)}')
|
||||||
|
def MEASure_SETup_DSA(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:SETup:DSA {str(input)}')
|
||||||
|
def MEASure_SETup_DSB(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:SETup:DSB {str(input)}')
|
||||||
|
def MEASure_STATistic_DISPlay(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:STATistic:DISPlay {str(input)}')
|
||||||
|
def MEASure_STATistic_MODE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:STATistic:MODE {str(input)}')
|
||||||
|
def MEASure_STATistic_RESet(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:STATistic:RESet {str(input)}')
|
||||||
|
def MEASure_STATistic_ITEM(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:STATistic:ITEM {str(input)}')
|
||||||
|
def MEASure_ITEM(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:ITEM {str(input)}')
|
||||||
|
def REFerence_DISPlay(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':REFerence:DISPlay {str(input)}')
|
||||||
|
def REFerencen_ENABle(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':REFerence<n>:ENABle {str(input)}')
|
||||||
|
def REFerencen_SOURce(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':REFerence<n>:SOURce {str(input)}')
|
||||||
|
def REFerencen_VSCale(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':REFerence<n>:VSCale {str(input)}')
|
||||||
|
def REFerencen_VOFFset(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':REFerence<n>:VOFFset {str(input)}')
|
||||||
|
def REFerencen_RESet(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':REFerence<n>:RESet {str(input)}')
|
||||||
|
def REFerencen_CURRent(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':REFerence<n>:CURRent {str(input)}')
|
||||||
|
def REFerencen_SAVe(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':REFerence<n>:SAVe {str(input)}')
|
||||||
|
def REFerencen_COLor(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':REFerence<n>:COLor {str(input)}')
|
||||||
|
def STORage(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':STORage {str(input)}')
|
||||||
|
def STORage_IMAGe_TYPE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':STORage:IMAGe:TYPE {str(input)}')
|
||||||
|
def STORage_IMAGe_INVERT(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':STORage:IMAGe:INVERT {str(input)}')
|
||||||
|
def STORage_IMAGe_COLor(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':STORage:IMAGe:COLor {str(input)}')
|
||||||
|
def SYSTem(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem {str(input)}')
|
||||||
|
def SYSTem_AUToscale(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem:AUToscale {str(input)}')
|
||||||
|
def SYSTem_GAM(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem:GAM? {str(input)}')
|
||||||
|
def SYSTem_LANGuage(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem:LANGuage {str(input)}')
|
||||||
|
def SYSTem_LOCKed(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem:LOCKed {str(input)}')
|
||||||
|
def SYSTem_PON(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem:PON {str(input)}')
|
||||||
|
def SYSTem_OPTion_INSTall(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem:OPTion:INSTall {str(input)}')
|
||||||
|
def SYSTem_OPTion_UNINSTall(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem:OPTion:UNINSTall {str(input)}')
|
||||||
|
def SYSTem_RAM(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem:RAM? {str(input)}')
|
||||||
|
def SYSTem_SETup(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem:SETup {str(input)}')
|
||||||
|
def TRACen(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRACe[<n>] {str(input)}')
|
||||||
|
def TRACen_DATA(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRACe[<n>]:DATA {str(input)}')
|
||||||
|
def TRACen_DATA_DAC16(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRACe[<n>]:DATA:DAC16 {str(input)}')
|
||||||
|
def TRACen_DATA_DAC(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRACe[<n>]:DATA:DAC {str(input)}')
|
||||||
|
def TRACen_DATA_POINts(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRACe[<n>]:DATA:POINts {str(input)}')
|
||||||
|
def TRACen_DATA_POINts_INTerpolate(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRACe[<n>]:DATA:POINts:INTerpolate {str(input)}')
|
||||||
|
def TRACen_DATA_VALue(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRACe[<n>]:DATA:VALue {str(input)}')
|
||||||
|
def TRACen_DATA_LOAD(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRACe[<n>]:DATA:LOAD? {str(input)}')
|
||||||
|
def TIMebase_DELay_ENABle(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TIMebase:DELay:ENABle {str(input)}')
|
||||||
|
def TIMebase_DELay_OFFSet(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TIMebase:DELay:OFFSet {str(input)}')
|
||||||
|
def TIMebase_DELay_SCALe(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TIMebase:DELay:SCALe {str(input)}')
|
||||||
|
def TIMebase_MAIN_OFFSet(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TIMebase[:MAIN]:OFFSet {str(input)}')
|
||||||
|
def TIMebase_MAIN_SCALe(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TIMebase[:MAIN]:SCALe {str(input)}')
|
||||||
|
def TIMebase_MODE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TIMebase:MODE {str(input)}')
|
||||||
|
def TRIGger_MODE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:MODE {str(input)}')
|
||||||
|
def TRIGger_COUPling(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:COUPling {str(input)}')
|
||||||
|
def TRIGger_SWEep(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:SWEep {str(input)}')
|
||||||
|
def TRIGger_HOLDoff(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:HOLDoff {str(input)}')
|
||||||
|
def TRIGger_NREJect(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:NREJect {str(input)}')
|
||||||
|
def TRIGger_EDGe(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:EDGe {str(input)}')
|
||||||
|
def TRIGger_PULSe(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:PULSe {str(input)}')
|
||||||
|
def TRIGger_SLOPe(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:SLOPe {str(input)}')
|
||||||
|
def TRIGger_VIDeo(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:VIDeo {str(input)}')
|
||||||
|
def TRIGger_PATTern(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:PATTern {str(input)}')
|
||||||
|
def TRIGger_DURATion(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:DURATion {str(input)}')
|
||||||
|
def TRIGger_TIMeout(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:TIMeout {str(input)}')
|
||||||
|
def TRIGger_RUNT(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:RUNT {str(input)}')
|
||||||
|
def TRIGger_WINDows(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:WINDows {str(input)}')
|
||||||
|
def TRIGger_DELay(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:DELay {str(input)}')
|
||||||
|
def TRIGger_SHOLd(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:SHOLd {str(input)}')
|
||||||
|
def TRIGger_NEDGe(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:NEDGe {str(input)}')
|
||||||
|
def TRIGger_NEDGe_SLOPe(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:NEDGe:SLOPe {str(input)}')
|
||||||
|
def TRIGger_NEDGe_EDGE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:NEDGe:EDGE {str(input)}')
|
||||||
|
def TRIGger_NEDGe_LEVel(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:NEDGe:LEVel {str(input)}')
|
||||||
|
def TRIGger_RS232(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:RS232 {str(input)}')
|
||||||
|
def TRIGger_IIC(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:IIC {str(input)}')
|
||||||
|
def TRIGger_SPI(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:SPI {str(input)}')
|
||||||
|
def WAVeform_STARt(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:STARt {str(input)}')
|
||||||
|
def WAVeform_STOP(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:STOP {str(input)}')
|
||||||
|
def WAVeform_SOURce(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:SOURce {str(input)}')
|
||||||
|
def WAVeform_MODE(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:MODE {str(input)}')
|
||||||
|
def WAVeform_FORMat(self, input = None):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:FORMat {str(input)}')
|
||||||
|
def LAN_STATus(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:STATus? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def LAN_VISA(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:VISA? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def WAVeform_DATA(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:DATA? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def WAVeform_XINCrement(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:XINCrement? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def WAVeform_XORigin(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:XORigin? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def WAVeform_XREFerence(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:XREFerence? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def WAVeform_YINCrement(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:YINCrement? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def WAVeform_YORigin(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:YORigin? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def WAVeform_YREFerence(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:YREFerence? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def WAVeform_PREamble(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':WAVeform:PREamble? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def TRIGger_POSition(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':TRIGger:POSition? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def SYSTem_ERRor_NEXT(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':SYSTem:ERRor[:NEXT]? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def _SOURcen_APPLy(self):
|
||||||
|
self.pyvisa_instrument_object.write(f'[:SOURce[<n>]]:APPLy? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def FUNCtion_WRECord_FMAX(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':FUNCtion:WRECord:FMAX? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def ESR(self):
|
||||||
|
self.pyvisa_instrument_object.write(f'*ESR? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def IDN(self):
|
||||||
|
self.pyvisa_instrument_object.write(f'*IDN? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def STB(self):
|
||||||
|
self.pyvisa_instrument_object.write(f'*STB? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def TST(self):
|
||||||
|
self.pyvisa_instrument_object.write(f'*TST? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def LAN_MAC(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':LAN:MAC? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def MASK_PASSed(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:PASSed? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def MASK_FAILed(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:FAILed? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def MASK_TOTal(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':MASK:TOTal? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def MEASure_COUNter_VALue(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':MEASure:COUNter:VALue? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def ACQuire_SRATe(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':ACQuire:SRATe? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def ETABlen_DATA(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':ETABle<n>:DATA? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def DISPlay_DATA(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':DISPlay:DATA? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
|
def DECodern_CONFig_SRATe(self):
|
||||||
|
self.pyvisa_instrument_object.write(f':DECoder<n>:CONFig:SRATe? {str(input)}')
|
||||||
|
return self.pyvisa_instrument_object.read()
|
||||||
Binary file not shown.
88
generator.py
Normal file
88
generator.py
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
|
functionBuffer = []
|
||||||
|
writeBuffer = []
|
||||||
|
with open(f'equipment/multimeter/md_sourcefiles/3458A.md') as file:
|
||||||
|
current_block = ''
|
||||||
|
command_block = ''
|
||||||
|
for line in file:
|
||||||
|
line = line.lstrip(' ')
|
||||||
|
line = line.replace('\n', '')
|
||||||
|
# check if descriptor block
|
||||||
|
try:
|
||||||
|
sub_block = line.split(' ', 1)[0]
|
||||||
|
if sub_block == '#':
|
||||||
|
command_block = line.split(' ', 1)[1]
|
||||||
|
writeBuffer.append(line)
|
||||||
|
if 'LIBRARY COMMANDS' in command_block:
|
||||||
|
current_block = 'FUNCTION'
|
||||||
|
if 'SETTEABLE PARAMETERS' in command_block:
|
||||||
|
current_block = 'SETTER'
|
||||||
|
if 'GETTEABLE PARAMETERS' in command_block:
|
||||||
|
current_block = 'GETTER'
|
||||||
|
if 'GETSETTEABLE PARAMETERS' in command_block:
|
||||||
|
current_block = 'GETSETTER'
|
||||||
|
# if sub_block a getter/setter make it
|
||||||
|
if sub_block == '-':
|
||||||
|
functionBuffer.append({"NAME":line.split(' ', 1)[1],"TYPE":current_block})
|
||||||
|
# if sub_block make a function/parameter
|
||||||
|
if sub_block == '1.':
|
||||||
|
functionBuffer[-1].update({"DESCRIPTION":line.split(' ', 1)[1]})
|
||||||
|
if sub_block == '2.':
|
||||||
|
functionBuffer[-1].update({"DEVICE_COMMAND":line.split(' ', 1)[1]})
|
||||||
|
if sub_block == '3.':
|
||||||
|
functionBuffer[-1].update({"FUNCTION_CALL":line.split(' ', 1)[1]})
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
writeBuffer = ''
|
||||||
|
for functionality in functionBuffer:
|
||||||
|
tmpFunc = ''
|
||||||
|
# check what kind of function is needed
|
||||||
|
print(functionality)
|
||||||
|
try:
|
||||||
|
tmp = functionality["NAME"]
|
||||||
|
tmp_cmd_name = tmp.lstrip(':')
|
||||||
|
tmp_cmd_name = tmp_cmd_name.replace(':', '_')
|
||||||
|
tmp_cmd_name = re.sub(r'[^a-zA-Z0-9_]', '', tmp_cmd_name)
|
||||||
|
if functionality["TYPE"] == "FUNCTION":
|
||||||
|
tmpFunc += (f'\tdef out = {tmp_cmd_name}:\n')
|
||||||
|
if functionality["TYPE"] == "SETTER":
|
||||||
|
tmpFunc += (f'\tdef {tmp_cmd_name}(self, input = None):\n')
|
||||||
|
if functionality["TYPE"] == "GETTER":
|
||||||
|
tmpFunc += (f'\tdef {tmp_cmd_name}(self):\n')
|
||||||
|
if functionality["TYPE"] == "GETSETTER":
|
||||||
|
tmpFunc += (f'\tdef {tmp_cmd_name}(self, input = None):\n')
|
||||||
|
# add description
|
||||||
|
if "DESCRIPTION" in functionality:
|
||||||
|
tmp = functionality["DESCRIPTION"]
|
||||||
|
tmpFunc += (f'\t\t\'\'\'{tmp}\'\'\'\n')
|
||||||
|
# add command if not function
|
||||||
|
if not "DEVICE_COMMAND" in functionality:
|
||||||
|
tmp = functionality["NAME"]
|
||||||
|
tmpFunc += (f'\t\tself.pyvisa_instrument_object.write(f\'{tmp} ' + '{str(input)}\')\n')
|
||||||
|
else:
|
||||||
|
tmp = functionality["DEVICE_COMMAND"]
|
||||||
|
tmpFunc += (f'\t\t{tmp}\n')
|
||||||
|
# add return to getters
|
||||||
|
if functionality["TYPE"] == "GETTER":
|
||||||
|
tmpFunc += (f'\t\treturn self.pyvisa_instrument_object.read()\n')
|
||||||
|
if functionality["TYPE"] == "GETSETTER":
|
||||||
|
tmpFunc += (f'\t\treturn self.pyvisa_instrument_object.read()\n')
|
||||||
|
writeBuffer += (tmpFunc+'\n')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
with open("demofile.py", "a") as f:
|
||||||
|
# add base constructor stuff
|
||||||
|
f.write('import pyvisa\n\n')
|
||||||
|
f.write('class DS1054Z(object):\n')
|
||||||
|
f.write('\tdef __init__(self, pyvisa_instrument_address, device_handle):\n')
|
||||||
|
f.write('\t\t# initiate correct device class and pass pyvisa handle\n')
|
||||||
|
f.write('\t\tself.pyvisa_instrument_address = pyvisa_instrument_address\n')
|
||||||
|
f.write('\t\tself.pyvisa_instrument_manager = pyvisa.ResourceManager()\n')
|
||||||
|
f.write('\t\tself.pyvisa_instrument_object = self.pyvisa_instrument_manager.open_resource(pyvisa_instrument_address)\n')
|
||||||
|
f.write('\t\tself.pyvisa_instrument_object = self.pyvisa_instrument_object\n')
|
||||||
|
f.write('\t\tself.device_handle = device_handle\n')
|
||||||
|
f.write('\t\tprint(f"[MeasKit] started control class instance for {device_handle} at {pyvisa_instrument_address}.")\n')
|
||||||
|
f.write(writeBuffer)
|
||||||
7
supported_devices.json
Normal file
7
supported_devices.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"supported_instruments": [
|
||||||
|
{ "make": "TEMPLATE", "type": "TEMPLATE" , "source": "TEMPLATE.py" },
|
||||||
|
{ "make": "3458A" , "type": "multimeter", "source": "3458A.py" },
|
||||||
|
{ "make": "DS1054Z" , "type": "oscilloscope", "source": "DS1054Z.py" }
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user