Controlling measurement instruments via GPIB 通过GPIB控制仪器.docx

上传人:b****8 文档编号:29248247 上传时间:2023-07-21 格式:DOCX 页数:22 大小:390.51KB
下载 相关 举报
Controlling measurement instruments via GPIB 通过GPIB控制仪器.docx_第1页
第1页 / 共22页
Controlling measurement instruments via GPIB 通过GPIB控制仪器.docx_第2页
第2页 / 共22页
Controlling measurement instruments via GPIB 通过GPIB控制仪器.docx_第3页
第3页 / 共22页
Controlling measurement instruments via GPIB 通过GPIB控制仪器.docx_第4页
第4页 / 共22页
Controlling measurement instruments via GPIB 通过GPIB控制仪器.docx_第5页
第5页 / 共22页
点击查看更多>>
下载资源
资源描述

Controlling measurement instruments via GPIB 通过GPIB控制仪器.docx

《Controlling measurement instruments via GPIB 通过GPIB控制仪器.docx》由会员分享,可在线阅读,更多相关《Controlling measurement instruments via GPIB 通过GPIB控制仪器.docx(22页珍藏版)》请在冰豆网上搜索。

Controlling measurement instruments via GPIB 通过GPIB控制仪器.docx

ControllingmeasurementinstrumentsviaGPIB通过GPIB控制仪器

ControllingmeasurementinstrumentsviaGPIB

IntroductiontoGPIB

GPIB(GeneralPurposeInterfaceBus)isaninterfacestandardforconnectingcomputersandperipherals,whichsupportsthefollowinginternationalstandards:

IEEE488.1,IEC-625,IEEE488.2,andJIS-C1901.TheGPIBinterfaceallowsyoutocontrolvariousinstrumentsfromanexternalcomputer.ThecomputersendscommandsandinstructionstotheinstrumentsandreceivesdatasentfromtheinstrumentsviaGPIB.

Beforesettinguptheinstrumentforremotecommunicationsusingtheelectronic(physical)GPIBinterface,youshouldfamiliarizeyourselfwiththefollowingGPIBrequirements:

▪Auniquedeviceaddressmustbeassignedtoeachdeviceonthebus.

▪Notwodevicescansharethesamedeviceaddress.

▪Nomorethan15devicescanbeconnectedtoanyoneline.

▪Onedeviceshouldbeconnectedforevery6feet(2meters)ofcableused.

▪Nomorethan65feet(20meters)ofcableshouldbeusedtoconnectdevicestoabus.

▪Atleasttwo-thirdsofthedevicesonthenetworkshouldbepoweredonwhileusingthenetwork.

▪Connectthedevicesonthenetworkinastarorlinearconfiguration.Donotuselooporparallelconfigurations.

ThefollowingfigureillustratesatypicalGPIBinterfacesystem.

Figure1:

atypicalGPIBinterfacesystem

Ifnecessary,theGPIBconnectorscanbestackedasshowninthefollowingfigure:

Figure2:

stackofGPIBconnectors

IntroductiontoSCPI

SCPI(StandardCommandsforProgrammableInstruments)isaprogramminglanguageforcontrollinginstrumentfunctionsovertheGPIB(GeneralPurposeInterfaceBus,IEEE488)instrumentbus.SCPIisintendedtofunctionwithstandardGPIBhardwareandconformstotheIEEEStandardDigitalInterfaceforProgrammableInstrumentation.SCPIislayeredontopofthehardwareportionofIEEE488.2.

ThesameSCPIcommandsandparameterscontrolthesamefunctionsindifferentclassesofinstruments.Foreachinstrumentfunction,SCPIdefinesaspecificcommandset.TheadvantageofSCPIisthatprogramminganinstrumentisonlyfunctiondependentandnolongerinstrumentdependent.Severaldifferenttypesofinstruments,forexampleanoscilloscope,acounterandamultimeter,cancarryoutthesamefunction,suchasfrequencymeasurement.IftheseinstrumentsareSCPIcompatible,youcanusethesamecommandstomeasurethefrequencyonallthreeinstruments,althoughtheremaybedifferencesinaccuracy,resolution,speed,etc.

FunctionalityofaSCPIinstrument

ThefunctionsinsideaninstrumentthatcontroltheoperationprovideSCPIcompatibility.

Figure3showsasimplifiedlogicalmodelofthemessageflowinsideaSCPIinstrument.

WhenthecontrollersendsamessagetoaSCPIinstrument,roughlythefollowinghappens:

–TheGPIBcontrolleraddressestheinstrumentaslistener.

–TheGPIBinterfacefunctionplacesthemessageintheInputBuffer.

–TheParserfetchesthemessagefromtheInputBuffer,parses(decodes)themessage,andchecksforthecorrectsyntax.Theinstrumentreportsincorrectsyntaxbysendingcommanderrorsviathestatussystemtothecontroller.Moreover,theparserwilldetectifthecontrollerrequiresaresponse.Thisisthecasewhentheinputmessageisaquery(commandwitha“?

”appended).

TheParserwilltransfertheexecutablemessagestotheExecutionControlblockintokenform(internalcodes).TheExecutionControlblockwillgathertheinformationrequiredforadeviceactionandwillinitiatetherequestedtaskattheappropriatetime.TheinstrumentreportsexecutionerrorsviathestatussystemovertheGPIBandplacesthemintheErrorQueue.

–Whenthecontrolleraddressestheinstrumentastalker,theinstrumenttakesdatafromtheOutputQueueandsendsitovertheGPIBtothecontroller.

SCPIcommandsaresentasASCIIoutputstringswithintheprogramminglanguagestatements,theSCPIsyntaxisindependentofbothprogramminglanguageandinterface.

Figure3:

OverviewofthefirmwareinaSCPIinstrument

TypesofSCPICommands

SCPIhastwotypesofcommands,commonandsubsystem.

CommonCommands

Commoncommandsgenerallyarenotrelatedtospecificoperationbuttocontrollingoverallinstrumentfunctions,suchasreset,status,andsynchronization.Allcommoncommandsconsistofathree-lettermnemonicprecededbyanasterisk:

*RST*IDN?

*SRE8

Figure4:

CommonCommandsSyntaxDiagram

*Fordetails,referto“Agilent_DSA90604A_Infiniiumoscilloscope_programmingguide.pdf”,page26-33

SubsystemCommands

Subsystemcommandsperformspecificinstrumentfunctions.

SCPIisanASCII-basedinstrumentcommandlanguagedesignedfortestandmeasurementinstruments.SCPIcommandsarebasedonahierarchicalstructure,alsoknownasatreesystem.Inthissystem,associatedcommandsaregroupedtogetherunderacommonnodeorroot,thusformingsubsystems.Subsystemcommandsperformspecificpowersupplyfunctions.AportionoftheSOURcesubsystemisshownbelowtoillustratethetreesystem.

SOURceistherootkeywordofthecommand,CURRentisasecond-levelkeyword,LEVelandPROTectionarethird-levelkeywords,andIMMediate,TRIGgeredandSTATearefourth-levelkeywords.Colons(:

)separatehigher-levelfromlower-levelkeywords.

Figure5isatreediagramofthesubsystemcommandsforDCpowersupply6674A.Commandsfollowedbyaquestionmark(?

)takeonlythequeryform.Exceptasnotedinthesyntaxdescriptions,allothercommandstakeboththecommandandqueryform.Thecommandsarelistedinalphabeticalorderandthecommandswithineachsubsystemaregroupedalphabeticallyunderthesubsystem.

Figure5:

SubsystemCommandsTreeDiagram

StructureofaSCPIMessage

SCPImessagesconsistofoneormoremessageunitsendinginamessageterminator.Theterminatorisnotpartofthesyntax,butimplicitinthewayyourprogramminglanguageindicatestheendofaline(suchasanewlineorend-of-linecharacter).

TheMessageUnit

ThesimplestSCPIcommandisasinglemessageunitconsistingofacommandheader(orkeyword)followedbyamessageterminator.

ABOR

VOLT?

Themessageunitmayincludeaparameteraftertheheader.Theparameterusuallyisnumeric,butitcanbeastring:

VOLT20

VOLTMAX

CombiningMessageUnits

Thefollowingcommandmessage(seeFigure6)isbrieflydescribedhere,withmoredetailsinsubsequentparagraphs.

VOLT:

LEV4.5;PROT4.8;:

CURR?

 

Figure6:

CommandMessageStructure

ThebasicpartsofthemessageinFigure6are:

MessageComponentExample

HeadersVOLTLEVPROTCURR

HeaderSeparatorThecoloninVOLT:

LEV

Data4.54.8

DataSeparatorThespaceinVOLT4.5andPROT4.8

MessageUnitsVOLT:

LEV4.5PROT4.8CURR?

MessageUnitSeparatorThesemicolonsinVOLT:

LEV4.5;andPROT4.8;

RootSpecifierThecoloninPROT4.8;:

CURR?

QueryIndicatorThequestionmarkinCURR?

MessageTerminatorThe(newline)indicator.Terminatorsarenot

partoftheSCPIsyntax.

GPIBsettingandSCPIcommandsforinstruments

GPIBAddressSettingforinstruments

FortheGPIBinterface,messagesareplacedonthebususinganoutputcommandandpassingthedeviceaddress,programmessage,andaterminator.PassingthedeviceaddressensuresthattheprogrammessageissenttothecorrectGPIBinterfaceandGPIBdevice.

ProcessforsettingGPIBaddressforinstrumentsis:

Oscilloscope

−TectronixDSA73304D

oThedefaultsettingsfortheGPIBconfigurationare:

GPIBAddress1.

oTochangeeitheroftheGPIBsettings,dothefollowing:

SelectGPIBConfigurationfromtheUtilitiesmenuonfrontpanel.

−AgilentDSA90604A

oDeviceAddress=(InterfaceSelectCode*100)+OscilloscopeAddress

oEachinterfacecardhasauniqueinterfaceselectcode.Thiscodeisusedbythecomputertodirectcommandsandcommunicationstotheproperinterface.Thedefaultistypically"7"fortheGPIBinterfacecards

oEachoscilloscopeontheGPIBmusthaveauniqueoscilloscopeaddressbetweendecimal0and30.Thisoscilloscopeaddressisusedbythecomputertodirectcommandsandcommunicationstotheproperoscilloscopeonaninterface.Thedefaultistypically"7"forthisoscilloscope.YoucanchangetheoscilloscopeaddressintheUtilities,RemoteInterfacedialogbox.

oDoNotUseAddress21foranOscilloscopeAddress,Address21isusuallyreservedfortheComputerinterfaceTalk/Listenaddress,andshouldnotbeusedasanoscilloscopeaddress.

Signalsourceanalyzer

−AgilentE5052B

oPressSystem>MiscSetup>GPIBSetup>Talker/ListenerAddress.

oEntertheaddressusingtheENTRYblockkeysonthefrontpanel.

DCpowersupply

−AgilentN5745A

oThepowersupplyisshippedwithitsGPIBaddresssetto5.UsethefrontpanelmenuifyouneedtochangetheGPIBaddress.

aPressandholdtheOCP/488buttonforaboutthreeseconds.TheDCVOLTSdisplaywillshowthepresentGPIBaddress.

bTochangetheGPIBaddress,turnthevoltageknobuntilthedesiredGPIBaddressappearsinthedisplay.ValidGPIBaddressesareintherangeof0to30.

 

−HPAgilent6674A(HPIB)

oThepowersupplyaddresscannotbesetremotely;itmustbesetfromthefrontpanel.Oncetheaddressisset,youcanassignitinsideprograms.

oUsetheADDRESSkeyandnumericalkeypadforenteringaddresses.Thepowersupplyisshippedwitha5stand-aloneaddressasthedefault.Thegeneralprocedureforsettinganaddressis:

Frequencycalibrator/analyzer

−PendulumCNT-91R

oTheaddressofthecounterissetto10whenitisdelivered

oSetGPIBAddressviathefrontpanelUSEROPTmenu

onumberbetween0and30

Warmbox

−VotschWEISSTECHNIKC7-600

oNOTAVEAIIBLE!

!

oUseGPIB-RS232converter(forexampleFT7130GPIB-RS232)

 

SCPICommandsforinstruments

Osc

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 自然科学 > 物理

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1