Tektronix logoSimplifying Test
Automation nrog
tm_devices thiab Python
YUAV UA LI CAS Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python

Simplifying Test Automation Nrog tm_ Devices Thiab Python

YUAV UA LI CAS
Simplifying Test Automation nrog tm_devices thiab Python
Cov engineers thoob plaws ntau qhov kev lag luam siv automation los txuas ntxiv lub peev xwm ntawm lawv cov cuab yeej ntsuas. Ntau tus engineers xaiv cov lus programming dawb Python kom ua tiav qhov no. Muaj ntau yam tseem ceeb advantages uas ua rau Python yog ib hom lus zoo rau kev ua haujlwm automation:

  • Ntau yam
  • Yooj yim qhia thiab kawm
  • Code nyeem tau
  • Muaj dav muaj kev paub hauv paus thiab modules

Muaj ob qhov tseem ceeb siv rau automation:

  • Cov txheej txheem uas ua rau tib neeg tus cwj pwm coj mus rau lub vaj huam sib luag pem hauv ntej thiab txuag lub sijhawm xws li kev sim ua raws li kev ua raws li kev ua haujlwm.
    Tsis yog zaum ntawm qhov peev txheej, ntxiv cov kev ntsuas tsim nyog, thiab sau cov txiaj ntsig txhua zaus koj xav tau sim ib feem tshiab, tus kws ua haujlwm tsim ib tsab ntawv uas ua txhua yam thiab qhia qhov tshwm sim.
  • Siv uas txuas ntxiv kev ua haujlwm ntawm qhov ntsuas; rau example: ntsuas ntsuas, validation, los yog zoo.
    Automation tso cai rau tus engineer los ua cov kev sim nyuaj yam tsis muaj ntau qhov kev poob qis hauv qhov kev sim no. Tsis tas yuav tsum muaj tus neeg teb xov tooj los teeb tsa lub peev xwm thiab manually sau cov txiaj ntsig, thiab qhov kev sim tuaj yeem ua tau zoo ib yam li txhua lub sijhawm.
    Qhov kev qhia yuav ua li cas yuav npog qhov koj xav tau los pib qhov programming scopes hauv Python, suav nrog cov hauv paus ntawm programmatic interfaces thiab yuav ua li cas rub tawm thiab khiav tus example.

Programmatic Interface yog dab tsi?

Lub programmatic interface (PI) yog ib thaj tsam lossis thaj tsam ntawm ob lub khoos phis tawj uas tuaj yeem ua haujlwm los ua tus cwj pwm tshwj xeeb. Rau peb lub hom phiaj, nws yog tus choj ntawm lub khoos phis tawj uas khiav txhua daim ntawm Tektronix cov cuab yeej kuaj, thiab daim ntawv thov sau los ntawm tus neeg siv kawg. Txhawm rau nqaim qhov no ntxiv, nws yog sof commands uas tuaj yeem xa mus rau qhov ntsuas qhov ntsuas uas tom qab ntawd ua cov lus txib thiab ua tiav cov haujlwm sib xws. PI pawg (Daim duab 1) qhia txog qhov ntws ntawm cov ntaub ntawv los ntawm tus tswv tswj hwm mus rau qhov ntsuas. Daim ntawv thov code sau los ntawm tus neeg siv kawg txhais tus cwj pwm ntawm lub hom phiaj ntsuas. Qhov no feem ntau yog sau rau hauv ib qho ntawm cov kev loj hlob platforms popula hauv kev lag luam xws li Python, MATLAB, LabVIEW, C++, lossis C#. Daim ntawv thov no yuav xa cov ntaub ntawv uas siv cov Standard Commands for Programmable Instrumentation (SCPI) hom ntawv, uas yog tus qauv txhawb nqa los ntawm cov khoom siv ntsuas thiab ntsuas feem ntau. SCPI cov lus txib feem ntau xa los ntawm Virtual Instrument Software Architecture (VISA) txheej, uas yog siv los pab txhawb kev hloov pauv ntawm cov ntaub ntawv los ntawm kev suav nrog ntxiv robustness (piv txwv li, kev kuaj yuam kev) rau kev sib txuas lus raws tu qauv. Qee zaum, cov ntawv thov tuaj yeem hu rau tus tsav tsheb uas yuav xa ib lossis ntau dua SCPI cov lus txib mus rau VISA txheej.Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - InterfaceDaim duab 1. Lub programmatic interface (PI) pawg qhia txog kev khiav ntawm cov ntaub ntawv ntawm tus tswv tswj thiab ntsuas.

tm_devices pob yog dab tsi?

tm_devices yog pob khoom tswj hwm tsim los ntawm Tektronix uas suav nrog ntau cov lus txib thiab kev ua haujlwm los pab cov neeg siv yooj yim automate cov kev sim ntawm Tektronix thiab Keithley cov khoom siv cov lus programming Python. Nws tuaj yeem siv rau hauv IDEs nrov tshaj plaws rau Python thiab txhawb nqa cov lej ua tiav. Cov pob no ua rau coding thiab xeem automation yooj yim thiab yooj yim rau engineers nrog software txawj ntse ntawm txhua qib. Kev teeb tsa kuj tseem yooj yim thiab siv pip, Python's pob-tswj system.

Kev teeb tsa koj ib puag ncig

Tshooj lus no yuav coj koj mus txog qhov yuav tsum tau ua ua ntej thiab kev teeb tsa los npaj koj los ua txoj haujlwm txhim kho nrog tm_devices. Nws kuj suav nrog cov lus qhia uas txhawb nqa ib puag ncig virtual hauv Python (venvs) kom ua rau koj cov haujlwm yooj yim los tswj thiab tswj, tshwj xeeb tshaj yog tias koj tsuas yog sim cov pob no tawm ua ntej cog lus rau nws kev siv.
Nco tseg: Yog tias koj muaj ib puag ncig yam tsis muaj kev nkag ncaj qha rau hauv internet koj yuav tau hloov kho koj cov kauj ruam siv cov lus txib hauv cov ntawv ntxiv. Yog tias koj muaj teeb meem thov xa mus rau hauv lub github sib tham rau kev pab.

Installation thiab Prerequisites dhauview

  1. Nruab Python
    ib. Python ≥ 3.8
  2. PyCharm – PyCharm Installation, Pib ib qhov project, thiab tm_devices installation
  3. VSCode – VSCode Installation, Pib ib qhov project, thiab tm_devices installation

PyCharm Community (dawb) tsab
PyCharm yog ib qho nrov Python IDE siv los ntawm software tsim tawm thoob plaws txhua qhov kev lag luam. PyCharm muaj kev sib koom ua ke tester uas tso cai rau cov neeg siv los khiav kev xeem los ntawm file, chav kawm, txoj kev, los yog tag nrho cov kev xeem nyob rau hauv ib daim ntawv tais ceev tseg. Zoo li niaj hnub IDE feem ntau nws muaj ib hom kev ua tiav code uas ua rau koj txoj kev loj hlob zoo heev dhau ntawm cov ntawv nyeem yooj yim.
Peb yuav taug kev los ntawm kev teeb tsa PyCharm zej zog tsab (dawb), ua raws li kev txhim kho tm_devices hauv IDE thiab teeb tsa ib puag ncig virtual los txhim kho hauv.

  1. Mus rau https://www.jetbrains.com/pycharm/
  2. Scroll dhau los PyCharm Professional rau PyCharm Community Edition, nyem downloadTektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - PyCharm Community
  3. Koj yuav tsum muaj peev xwm mus txuas ntxiv nrog tsuas yog cov kauj ruam ua ntej installation. Peb tsis tas yuav muaj dab tsi tshwj xeeb.
  4. Txais tos rau PyCharm!Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - PyCharm Community 1
  5. Tam sim no koj yuav tsum tau tsim ib qhov project tshiab thiab xyuas kom tseeb tias yuav teeb tsa ib puag ncig virtual. Nyem "New Project"
  6. Paub meej txoj hauv kev rau qhov project, xyuas kom meej tias "Virtualenv" raug xaivTektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - PyCharm Community 2
  7. Qhib lub davhlau ya nyob twg. Yog koj view tsis suav nrog lub khawm sau npe hauv qab saib rau qhov no:Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - PyCharm Community 3
  8. Paub meej tias ib puag ncig virtual tau teeb tsa los ntawm kev kuaj xyuas (venv) ua ntej qhov kev ceeb toom hauv koj lub davhlau ya nyob twgTektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - PyCharm Community 4
  9. Nruab tus tsav tsheb los ntawm lub davhlau ya nyob twg
    Hom: pip nruab tm_devicesTektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - PyCharm Community 5
  10. Koj lub davhlau ya nyob twg yuav tsum tsis muaj qhov yuam kev! Zoo siab hacking!

Visual Studio Code
Visual Studio Code yog lwm qhov nrov dawb IDE uas software tsim tawm thoob plaws txhua qhov kev lag luam siv. Nws yog qhov zoo rau ntau hom lus thiab muaj kev txuas ntxiv rau ntau hom lus uas ua rau coding hauv IDE no yooj yim heev thiab ua haujlwm tau zoo. Visual Studio Code muab IntelliSense uas yog ib qho cuab yeej muaj txiaj ntsig zoo thaum tsim kho raws li nws pab hauv kev ua tiav code, cov ntaub ntawv parameter, thiab lwm yam ntaub ntawv hais txog cov khoom thiab cov chav kawm. Yooj yim, tm_devices txhawb kev ua tiav code uas piav qhia txog tsob ntoo hais kom ua ntawm cov khoom thiab cov chav kawm.
Peb muaj cov lus qhia zoo heev rau kev teeb tsa ntawm Python thiab Visual Studio Code, suav nrog cov ntaub ntawv ntawm kev teeb tsa ib puag ncig virtual ntawm no.

Exampua Code

Hauv seem no peb yuav los ntawm cov khoom ntawm ib qho yooj yim code example thiab qhia txog qee yam tsim nyog siv tm_ li zoo.
NtshuamTektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - NtshuamOb kab no tseem ceeb heev rau kev siv tau zoo ntawm tm_devices. Hauv thawj kab peb import DeviceManager. Qhov no yuav ua rau lub boilerplate txuas thiab disconnecting ntawm ntau chav kawm ntaus ntawv.
Hauv kab thib ob peb import tus tsav tsheb tshwj xeeb, hauv qhov no MSO5B.
Peb teeb tsa tus thawj tswj ntsiab lus nrog DeviceManager:Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - Ntshuam 1Thiab tom qab ntawd thaum peb siv tus tswj ntaus ntawv thiab tus tsav tsheb ua ke:Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - Ntshuam 2

Peb tuaj yeem instantiate ib qho cuab yeej nrog cov lus txib tshwj xeeb uas phim nws cov qauv. Tsuas yog nkag rau koj lub cuab yeej tus IP chaw nyob (lwm qhov chaw nyob VISA ua haujlwm ib yam nkaus).
Nrog rau plaub kab no tiav, peb muaj peev xwm pib sau cov ntsiab lus thiab tshwj xeeb automation rau MSO5B!
Cov ntaub ntawv Code
Cia peb saib ob peb yam yooj yim ua –
Teem lub Trigger hom rau EdgeTektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - Ntshuam 3Nov yog li cas koj yuav ntxiv thiab nug qhov ntsuas peak-rau-peak ntawm CH1:Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - Ntshuam 4Yog tias koj xav tau ib qho ampLitude ntsuas ntawm CH2:Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - Ntshuam 5

Siv IntelliSense/Code tiav

IntelliSense - Microsoft lub npe rau Code Ua tiav yog qhov muaj zog heev ntawm IDE's peb tau sim siv ntau li ntau tau.
Ib qho ntawm cov teeb meem tseem ceeb rau automation nrog kev ntsuas thiab ntsuas cov cuab yeej yog SCPI cov lus txib. Nws yog cov qauv sau hnub tim nrog syntax tsis tau txais kev txhawb nqa dav hauv zej zog kev loj hlob.
Peb tau ua dab tsi nrog tm_devices yog tsim cov Python cov lus txib rau txhua qhov SCPI cov lus txib. Qhov no tso cai rau peb los tsim Python code los ntawm cov lus txib uas twb muaj lawm kom tsis txhob muaj kev txhim kho ntawm cov tsav tsheb, nrog rau tsim cov qauv uas paub txog cov neeg siv SCPI uas twb muaj lawm. Nws kuj tseem qhia txog cov lej qis dua uas yuav xav tau kev sim debugging thaum koj tsim qhov program. Cov qauv ntawm Python cov lus txib ua raws li SCPI (lossis qee qhov Keithley rooj plaub TSP) cov qauv lus txib yog li yog tias koj paub txog SCPI koj yuav paub txog cov no.
Qhov no yog example ntawm yuav ua li cas IntelliSense qhia tag nrho cov lus txib muaj nrog rau cov lus txib uas tau sau ua ntej:
Nyob rau hauv daim ntawv teev scrollable uas tshwm tom qab lub teev ntawm qhov peb tuaj yeem pom cov npe ntawm cov tsiaj ntawv ntawm cov kab lus hais kom ua:Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - Code tiavXaiv afg peb tuaj yeem pom cov npe ntawm AFG pawg:Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - Code tiav 1Cov lus txib kawg sau nrog kev pab ntawm IntelliSense:Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - Fig

Docstring Pab

Raws li koj code, lossis thaum koj nyeem lwm tus tus lej, koj tuaj yeem hla ntau qhov sib txawv ntawm cov syntax kom tau txais cov ntaub ntawv pab tshwj xeeb. Qhov ze koj mus rau tag nrho cov lus txib syntax qhov tshwj xeeb nws yuav tau txais.Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - Docstring PabNyob ntawm koj qhov xwm txheej IDE koj tuaj yeem tso saib ob qho tib si IntelliSense thiab docstring pab tib lub sijhawm.Tektronix Simplifying Test Automation With tm_ Devices And Python - Docstring Help 1Nrog rau cov lus qhia no koj tau pom qee qhov txiaj ntsig ntawm Tek 's python tsav pob tm_devices thiab tuaj yeem pib koj txoj kev mus rau automation. Nrog rau kev teeb tsa yooj yim, kev ua tiav cov lej, thiab cov kev pabcuam built-in koj yuav tuaj yeem kawm yam tsis tau tawm hauv koj lub IDE, ua kom koj lub sijhawm txhim kho, thiab cov lej muaj kev ntseeg siab dua.
Muaj cov lus qhia txhawb nqa hauv Github repo yog tias koj xav txhim kho pob. Muaj ntau ntau tshaj examples highlighted nyob rau hauv cov ntaub ntawv thiab nyob rau hauv lub pob txheem nyob rau hauv lub Examples folder.

Cov peev txheej ntxiv

tm_devices · PyPI – Pob ntawv tsav tsheb rub tawm thiab cov ntaub ntawv
tm_devices Github – Qhov chaw code, qhov teeb meem taug qab, pab txhawb
tm_devices Github - Cov ntaub ntawv online

Kev daws teeb meem

Upgrading pip feem ntau yog thawj kauj ruam zoo rau kev daws teeb meem:
Hauv koj lub davhlau ya nyob twg: Python.exe -m pip nruab -upgrade pip
yuam kev: whl zoo li ib filenpe, mas file tsis muaj LOSSIS .whl tsis yog lub log txhawb nqa ntawm lub platform no.Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python - Troubleshooting

Kev daws: Pip txhim kho lub log kom nws paub txog qhov file hom ntawv.
Hauv koj lub davhlau ya nyob twg hom: pip nruab log
Yog tias koj xav tau nruab lub log offline koj tuaj yeem ua raws li cov lus qhia zoo ib yam li Cov Ntawv Ntxiv A, tab sis nws yuav tsum tau rub tawm tar.gz es tsis txhob siv .whl file.

Cov Ntawv Ntxiv A – Offline Installation ntawm tm_devices

  1. Nyob rau hauv ib lub computer nrog internet, download tau lub pob nrog rau tag nrho cov dependencies mus rau lub teev txoj kev qhov chaw siv:
    pib download -dest log setuptools tm_devices
  2. Luam the files rau koj lub computer uas tsis muaj internet nkag tau
  3. Tom qab ntawd, ua raws cov lus qhia los ntawm cov lus qhia tseem ceeb rau qhov twg IDE koj siv tab sis sib pauv cov lus txib rau cov hauv qab no:
    pip nruab -no-index -find-links files> tm_cov

Tiv tauj xov tooj:
Australia 1
Austria * 00800 2255 4835
Balkans, Israel, South Africa thiab lwm lub tebchaws ISE +41 52 675 3777
Belgium * 00800 2255 4835
Brazil +55 (11) 3530-8901
Canada 1
Central East Europe / Baltics +41 52 675 3777
Central Europe / Greece +41 52 675 3777
Denmark +45 80 88 1401
Finland +41 52 675 3777
France* 00800 2255 4835
Lub teb chaws Yelemees * 00800 2255 4835
Hong koob 400 820 5835
Is Nrias teb 000 800 650 1835
Indonesia 007 803 601 5249
Ltalis 00800 2255 4835
Nyiv 81 (3) 6714 3086
Luxembourg +41 52 675 3777
Malaysia 1 800 22
Mexico, Central/South America thiab Caribbean 52 (55) 88 69 35 25
Middle East, Asia, thiab North Africa +41 52 675 3777
Lub Netherlands * 00800 2255 4835
New Zealand 0800 800 238
Norway 800
Cov neeg koom pheej ntawm Tuam Tshoj 400 820 5835
Philippines 1 800 1601 0077
Poland +41 52 675 3777
Portugal 80 08 12370
Koom pheej ntawm Kaus Lim Kauslim +82 2 565 1455
Russia / CIS +7 (495) 6647564
Singapore 800 6011 473
South Africa +41 52 675 3777
Spain * 00800 2255 4835
Sweden * 00800 2255 4835
Switzerland * 00800 2255 4835
Taiwan 886 (2) 2656 6688
Thaib teb 1 800 011
United Kingdom / Ireland * 00800 2255 4835
USA 1 800 833
Vietnam 12060128
* Tus lej xov tooj hu dawb European. Yog tsis yog
hu rau: +41 52 675 3777
Rev. 02.2022

Nrhiav cov peev txheej muaj txiaj ntsig ntau ntawm TEK.COM
Copyright © Tektronix. Txhua txoj cai qhaib. Tektronix cov khoom lag luam tau npog los ntawm Asmeskas thiab txawv teb chaws patents, muab tawm thiab tseem tos. Cov ntaub ntawv hauv cov ntawv tshaj tawm no hloov pauv hauv txhua yam ntaub ntawv tshaj tawm yav dhau los. Tshwj xeeb thiab tus nqi hloov pauv txoj cai tshwj tseg. TEKTRONIX thiab TEK tau sau npe ua lag luam ntawm Tektronix, Inc. Tag nrho lwm cov npe lag luam uas tau hais txog yog cov cim kev pabcuam, cov cim lag luam lossis cov npe lag luam ntawm lawv cov tuam txhab.
052124 SWB 46W-74037-1

Tektronix logo

Cov ntaub ntawv / Cov ntaub ntawv

Tektronix Simplifying Test Automation Nrog tm_ Devices Thiab Python [ua pdf] Cov neeg siv phau ntawv qhia
48W-73878-1, Simplifying Test Automation With tm_ Devices And Python, Test Automation With tm_ Devices Thiab Python, Automation With tm_ Devices And Python, tm_ Devices And Python, Devices And Python, Python

Cov ntaub ntawv

Cia ib saib

Koj email chaw nyob yuav tsis raug luam tawm. Cov teb uas yuav tsum tau muaj yog cim *