linux-gpib.sgml 158 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611
  1. <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
  2. [
  3. <!ENTITY version SYSTEM "gpib_version.txt">
  4. <!ENTITY license SYSTEM "fdl.xml">
  5. ]>
  6. <article>
  7. <articleinfo>
  8. <title>
  9. Linux-GPIB &version Documentation
  10. </title>
  11. <author>
  12. <firstname>Frank</firstname>
  13. <othername>Mori</othername>
  14. <surname>Hess</surname>
  15. <affiliation>
  16. <address>
  17. fmhess@users.sourceforge.net
  18. </address>
  19. </affiliation>
  20. </author>
  21. <copyright>
  22. <year>2003-2006, 2008</year>
  23. <holder>Frank Mori Hess</holder>
  24. </copyright>
  25. </articleinfo>
  26. <section>
  27. <title>
  28. Copying
  29. </title>
  30. <para>
  31. Permission is granted to copy, distribute and/or modify this document
  32. under the terms of the GNU Free Documentation License, Version 1.2
  33. or any later version published by the Free Software Foundation;
  34. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
  35. A copy of the license is included in the section entitled
  36. <link LINKEND="gfdl">"GNU Free Documentation License"</link>.
  37. </para>
  38. <para>
  39. Alternatively, you may redistribute and/or modify this document under the
  40. terms of the GNU General Public License as published by the Free Software
  41. Foundation; either version 2 of the License, or (at your option) any later
  42. version.
  43. </para>
  44. </section>
  45. <section ID="configuration">
  46. <title>
  47. Configuration
  48. </title>
  49. <para>
  50. Configuration of the GPIB library is accomplished through the
  51. configuration file
  52. <link LINKEND="configuration-gpib-conf">/etc/gpib.conf</link>,
  53. and the administration program
  54. <link LINKEND="configuration-gpib-config">gpib_config</link>.
  55. </para>
  56. <refentry ID="configuration-gpib-conf">
  57. <refmeta>
  58. <refentrytitle>gpib.conf</refentrytitle>
  59. <manvolnum>5</manvolnum>
  60. </refmeta>
  61. <refnamediv>
  62. <refname>gpib.conf</refname>
  63. <refpurpose>GPIB library configuration file</refpurpose>
  64. </refnamediv>
  65. <refsect1>
  66. <title>Description</title>
  67. <para>
  68. The library, and the administration tool
  69. <link LINKEND="configuration-gpib-config">gpib_config</link>
  70. read their configuration information from the
  71. file /etc/gpib.conf. A template gpib.conf
  72. file can be found in the util/templates/ subdirectory of the linux-gpib
  73. package.
  74. </para>
  75. <para>
  76. The configuration file must contain one or more 'interface' entries, and
  77. can contain zero or more 'device' entries. 'device' entries are only
  78. required if you wish to open device descriptors with
  79. <link LINKEND="reference-function-ibfind">ibfind()</link> instead
  80. of using <link LINKEND="reference-function-ibdev">ibdev()</link>.
  81. Several example entries, and a table summarizing the possible
  82. options follow.
  83. </para>
  84. <para>
  85. <programlisting>
  86. interface {
  87. minor = 0
  88. board_type = "ni_pci"
  89. pad = 0
  90. master = yes
  91. }
  92. interface {
  93. minor = 1
  94. board_type = "ines_pci"
  95. name = "joe"
  96. pad = 5
  97. sad = 0
  98. timeout = T10s
  99. pci_bus = 0
  100. pci_slot = 0xd
  101. master = no
  102. }
  103. interface {
  104. minor = 2
  105. board_type = "pcII"
  106. pad = 3
  107. sad = 0x62
  108. eos = 0x0d
  109. set-reos = yes
  110. set-bin = no
  111. set-xeos = no
  112. set-eot = yes
  113. base = 0x300
  114. irq = 5
  115. dma = 0
  116. master = no
  117. }
  118. device {
  119. minor = 0
  120. name = "counter"
  121. pad = 24
  122. }
  123. device {
  124. minor = 0
  125. name = "voltmeter"
  126. pad = 7
  127. sad = 110
  128. eos = 0xa
  129. set-reos = yes
  130. set-bin = no
  131. set-xeos = yes
  132. set-eot = no
  133. timeout = T1s
  134. }
  135. </programlisting>
  136. </para>
  137. <para>
  138. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="1">
  139. <title>configuration options</title>
  140. <tgroup COLS="3" ALIGN="left" >
  141. <thead>
  142. <row>
  143. <entry>option name</entry>
  144. <entry>description</entry>
  145. <entry>used by interface or device entries</entry>
  146. <entry>required or optional</entry>
  147. </row>
  148. </thead>
  149. <tbody>
  150. <row>
  151. <entry>base</entry>
  152. <entry>Specifies the base ioport or io memory address for a
  153. board that lacks plug-and-play capability.</entry>
  154. <entry>interface</entry>
  155. <entry>optional</entry>
  156. </row>
  157. <row>
  158. <entry>board_type</entry>
  159. <entry>Specifies the type of interface board. See the drivers.txt
  160. file for a list of possible board types, and the kernel driver
  161. module that supports them.</entry>
  162. <entry>interface</entry>
  163. <entry>required</entry>
  164. </row>
  165. <row>
  166. <entry>dma</entry>
  167. <entry>Specifies the dma channel for a board that lacks plug-and-play
  168. capability.</entry>
  169. <entry>interface</entry>
  170. <entry>optional</entry>
  171. </row>
  172. <row>
  173. <entry>eos</entry>
  174. <entry>Sets the end-of-string byte for board or device descriptors
  175. obtained with ibfind(). See also the set-reos, set-bin, and set-xeos
  176. options.</entry>
  177. <entry>interface or device</entry>
  178. <entry>optional</entry>
  179. </row>
  180. <row>
  181. <entry>irq</entry>
  182. <entry>Specifies the interrupt level for a board that lacks
  183. plug-and-play capability.</entry>
  184. <entry>interface</entry>
  185. <entry>optional</entry>
  186. </row>
  187. <row>
  188. <entry>master</entry>
  189. <entry>Set to 'yes' if you want the interface board to
  190. be the system controller of the bus. There can only
  191. be one system controller on a bus.</entry>
  192. <entry>interface</entry>
  193. <entry>required</entry>
  194. </row>
  195. <row>
  196. <entry>minor</entry>
  197. <entry>'minor' specifies the minor number of the device file this
  198. interface board will use. A 'minor' of 0 corresponds
  199. to /dev/gpib0, 1 is /dev/gpib1, etc. The minor number is also
  200. equal to the 'board index' which can be used as a board descriptor,
  201. and is passed as one of the arguments of <link LINKEND="reference-function-ibdev">
  202. ibdev()</link>
  203. </entry>
  204. <entry>interface</entry>
  205. <entry>required</entry>
  206. </row>
  207. <row>
  208. <entry>name</entry>
  209. <entry>The 'name' specifies the name which can be used with ibfind()
  210. to get a descriptor for the board or device associated with this entry.</entry>
  211. <entry>interface or device</entry>
  212. <entry>optional</entry>
  213. </row>
  214. <row>
  215. <entry>pad</entry>
  216. <entry>Specifies the primary GPIB address (valid addresses are 0 to 30).
  217. For interfaces, this is the primary address that the board will be
  218. assigned when it is first brought online. For devices, this is address
  219. that will be used by device descriptors obtained with ibfind().</entry>
  220. <entry>interface or device</entry>
  221. <entry>required</entry>
  222. </row>
  223. <row>
  224. <entry>pci_bus</entry>
  225. <entry>Useful for distinguishing between multiple PCI cards. If
  226. you have more than one PCI card that with the same 'board_type', you can
  227. use the 'pci_bus' and 'pci_slot' options to specify the particular
  228. card you are interested in. </entry>
  229. <entry>interface</entry>
  230. <entry>optional</entry>
  231. </row>
  232. <row>
  233. <entry>pci_slot</entry>
  234. <entry>Can be used in conjunction with 'pci_bus' to specify
  235. a particular pci card.</entry>
  236. <entry>interface</entry>
  237. <entry>optional</entry>
  238. </row>
  239. <row>
  240. <entry>sad</entry>
  241. <entry>Specifies the secondary GPIB address. Valid values are 0, or
  242. 0x60 to 0x7e hexadecimal (96 to 126 decimal). A value of 0 means
  243. secondary addressing is disabled (the default). Secondary addresses
  244. from 0 to 30
  245. are specified by the library's convention of adding an offset of 0x60.
  246. </entry>
  247. <entry>interface or device</entry>
  248. <entry>optional</entry>
  249. </row>
  250. <row>
  251. <entry>set-bin</entry>
  252. <entry>Enables 8-bit comparisons when matching the
  253. end-of-string byte, instead of only comparing the
  254. 7 least significant bits. Only affects descriptors
  255. returned by ibfind(), and has same effect as setting
  256. the BIN bit in a
  257. <link LINKEND="reference-function-ibeos">ibeos()</link>
  258. call.</entry>
  259. <entry>interface or device</entry>
  260. <entry>optional</entry>
  261. </row>
  262. <row>
  263. <entry>set-eot</entry>
  264. <entry>Enables assertion of the EOI line at the
  265. end of writes, for descriptors
  266. returned by ibfind(). See
  267. <link LINKEND="reference-function-ibeot">ibeot()</link>.</entry>
  268. <entry>interface or device</entry>
  269. <entry>optional</entry>
  270. </row>
  271. <row>
  272. <entry>set-reos</entry>
  273. <entry>Enables the termination of reads on reception of the
  274. end-of-string byte for descriptors returned by ibfind().
  275. Same as setting the REOS bit in a
  276. <link LINKEND="reference-function-ibeos">ibeos()</link>
  277. call.</entry>
  278. <entry>interface or device</entry>
  279. <entry>optional</entry>
  280. </row>
  281. <row>
  282. <entry>set-xeos</entry>
  283. <entry>Enables the assertion of EOI on transmission of the
  284. end-of-string byte for descriptors returned by ibfind().
  285. Same as setting the XEOS bit in a
  286. <link LINKEND="reference-function-ibeos">ibeos()</link>
  287. call.</entry>
  288. <entry>interface or device</entry>
  289. <entry>optional</entry>
  290. </row>
  291. <row>
  292. <entry>timeout</entry>
  293. <entry>Sets the io timeout for a board or device descriptor opened through
  294. ibfind(). The possible settings are the same as the constants
  295. used by <link LINKEND="reference-function-ibtmo">ibtmo()</link>.</entry>
  296. <entry>interface or device</entry>
  297. <entry>optional</entry>
  298. </row>
  299. </tbody>
  300. </tgroup>
  301. </table>
  302. </para>
  303. </refsect1>
  304. </refentry>
  305. <refentry ID="configuration-gpib-config">
  306. <refmeta>
  307. <refentrytitle>gpib_config</refentrytitle>
  308. <manvolnum>8</manvolnum>
  309. </refmeta>
  310. <refnamediv>
  311. <refname>gpib_config</refname>
  312. <refpurpose>GPIB administration program</refpurpose>
  313. </refnamediv>
  314. <refsynopsisdiv>
  315. <cmdsynopsis>
  316. <command>gpib_config</command>
  317. <arg>--minor <replaceable>number</replaceable></arg>
  318. </cmdsynopsis>
  319. <cmdsynopsis>
  320. <command>gpib_config</command>
  321. <arg>--board-type <replaceable>board_type</replaceable></arg>
  322. <arg>--dma <replaceable>number</replaceable></arg>
  323. <arg>--file <replaceable>file_path</replaceable></arg>
  324. <arg>--iobase <replaceable>number</replaceable></arg>
  325. <arg>--ifc</arg>
  326. <arg>--no-ifc</arg>
  327. <arg>--irq <replaceable>number</replaceable></arg>
  328. <arg>--minor <replaceable>number</replaceable></arg>
  329. <arg>--pad <replaceable>number</replaceable></arg>
  330. <arg>--pci-bus <replaceable>number</replaceable></arg>
  331. <arg>--pci-slot <replaceable>number</replaceable></arg>
  332. <arg>--sad <replaceable>number</replaceable></arg>
  333. <arg>--sre</arg>
  334. <arg>--no-sre</arg>
  335. <arg>--system-controller</arg>
  336. <arg>--no-system-controller</arg>
  337. </cmdsynopsis>
  338. </refsynopsisdiv>
  339. <refsect1>
  340. <title>Description</title>
  341. <para>gpib_config must be run after the kernel driver module for
  342. a GPIB interface board is loaded. It performs configuration of
  343. driver settings
  344. that cannot be performed by libgpib at runtime. This includes
  345. configuration which requires root privilege (for example, setting the
  346. base address or irq of a board), and configuration which should only
  347. be performed once and not automatically redone every time a program
  348. using libgpib is run (for example, setting the board's GPIB address).
  349. </para>
  350. <para>
  351. The board to be configured by gpib_config is selected by the
  352. <option>--minor</option> option. By default, the board settings
  353. are read from the
  354. <link LINKEND="configuration-gpib-conf">gpib.conf</link>
  355. configuration file. However, individual settings can be
  356. overiden by use of command-line options (see below).
  357. </para>
  358. </refsect1>
  359. <refsect1>
  360. <title>Options</title>
  361. <para><option>-b, --iobase <replaceable>number</replaceable></option></para>
  362. <para>Set io base address to <replaceable>number</replaceable> for boards
  363. without plug-and-play cabability.</para>
  364. <para><option>-d, --dma <replaceable>number</replaceable></option></para>
  365. <para>Specify isa dma channel <replaceable>number</replaceable> for boards
  366. without plug-and-play cabability.</para>
  367. <para><option>-I, --init-data <replaceable>file_path</replaceable></option></para>
  368. <para>Upload binary initialization data (firmware) from <replaceable>file_path</replaceable>
  369. to board.</para>
  370. <para><option>-i, --irq <replaceable>number</replaceable></option></para>
  371. <para>Specify irq line <replaceable>number</replaceable> for boards without
  372. plug-and-play cabability.</para>
  373. <para><option>-f, --file <replaceable>file_path</replaceable></option></para>
  374. <para>Specify file path for configuration file. The values in the configuration
  375. file will be used as defaults for unspecified options. The default configuration
  376. file is "/etc/gpib.conf".</para>
  377. <para><option>-h, --help</option></para>
  378. <para>Print help on options and exit.</para>
  379. <para><option>-l, --pci-slot <replaceable>number</replaceable></option></para>
  380. <para>Specify pci slot <replaceable>number</replaceable> to select a specific
  381. pci board. If used, you must also specify the pci bus with <option>--pci-bus</option>.
  382. </para>
  383. <para><option>-m, --minor <replaceable>number</replaceable></option></para>
  384. <para>
  385. Configure gpib device file with minor number <replaceable>number</replaceable>
  386. (default is 0).</para>
  387. <para><option>-p, --pad <replaceable>number</replaceable></option></para>
  388. <para>
  389. Specify primary gpib address. <replaceable>number</replaceable> should be in
  390. the range 0 through 30.
  391. </para>
  392. <para><option>-s, --sad <replaceable>number</replaceable></option></para>
  393. <para>
  394. Specify secondary gpib address. <replaceable>number</replaceable>
  395. should be 0 (disabled) or in the range 96 through 126 (0x60 through 0x7e hexadecimal).
  396. </para>
  397. <para><option>-t, --board-type <replaceable>board_type</replaceable></option></para>
  398. <para>Set board type to <replaceable>board_type</replaceable>.</para>
  399. <para><option>-u, --pci-bus <replaceable>number</replaceable></option></para>
  400. <para>Specify pci bus <replaceable>number</replaceable> to select a specific
  401. pci board. If used, you must also specify the pci slot with <option>--pci-slot</option>.
  402. </para>
  403. <para><option>--[no-]ifc</option></para>
  404. <para> Perform (or not) interface clear after bringing board online.
  405. Default is <option>--ifc</option>.</para>
  406. <para><option>--[no-]sre</option></para>
  407. <para>Assert (or not) remote enable line after bringing board online.
  408. Default is <option>--sre</option>.</para>
  409. <para><option>--[no-]system-controller</option></para>
  410. <para>Configure board as system controller (or not).</para>
  411. </refsect1>
  412. </refentry>
  413. </section>
  414. <section ID="supported-hardware">
  415. <title>
  416. Supported Hardware
  417. </title>
  418. <section ID="hardware-matrix">
  419. <title>
  420. Supported Hardware Matrix
  421. </title>
  422. <para>
  423. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="1">
  424. <title>Linux-GPIB Supported Hardware Matrix</title>
  425. <tgroup COLS="4" ALIGN="left" >
  426. <thead>
  427. <row>
  428. <entry>make</entry>
  429. <entry>model</entry>
  430. <entry>kernel driver module</entry>
  431. <entry>board_type (for /etc/gpib.conf)</entry>
  432. </row>
  433. </thead>
  434. <tbody>
  435. <row>
  436. <entry>Agilent (HP)</entry>
  437. <entry><link LINKEND="hp-82341">82341C</link></entry>
  438. <entry>hp_82341.ko</entry>
  439. <entry>hp_82341</entry>
  440. </row>
  441. <row>
  442. <entry>Agilent (HP)</entry>
  443. <entry><link LINKEND="hp-82341">82341D</link></entry>
  444. <entry>hp_82341.ko</entry>
  445. <entry>hp_82341</entry>
  446. </row>
  447. <row>
  448. <entry>Agilent (HP)</entry>
  449. <entry><link LINKEND="agilent-82350b">82350A</link></entry>
  450. <entry>agilent_82350b.ko</entry>
  451. <entry>agilent_82350b</entry>
  452. </row>
  453. <row>
  454. <entry>Agilent</entry>
  455. <entry><link LINKEND="agilent-82350b">82350B</link></entry>
  456. <entry>agilent_82350b.ko</entry>
  457. <entry>agilent_82350b</entry>
  458. </row>
  459. <row>
  460. <entry>Agilent</entry>
  461. <entry><link LINKEND="agilent-82357a">82357A</link></entry>
  462. <entry>agilent_82357a.ko</entry>
  463. <entry>agilent_82357a</entry>
  464. </row>
  465. <row>
  466. <entry>Agilent</entry>
  467. <entry><link LINKEND="agilent-82357a">82357B</link></entry>
  468. <entry>agilent_82357a.ko</entry>
  469. <entry>agilent_82357a</entry>
  470. </row>
  471. <row>
  472. <entry>Capital Equipment Corporation</entry>
  473. <entry>PC-488</entry>
  474. <entry>pc2_gpib.ko</entry>
  475. <entry>pcII</entry>
  476. </row>
  477. <row>
  478. <entry>Capital Equipment Corporation</entry>
  479. <entry>PCI-488</entry>
  480. <entry>cec_gpib.ko</entry>
  481. <entry>cec_pci</entry>
  482. </row>
  483. <row>
  484. <entry>CONTEC</entry>
  485. <entry>GP-IB(PC)</entry>
  486. <entry>pc2_gpib.ko</entry>
  487. <entry>pcIIa</entry>
  488. </row>
  489. <row>
  490. <entry>Hameg</entry>
  491. <entry>HO80</entry>
  492. <entry>pc2_gpib.ko</entry>
  493. <entry>pcII</entry>
  494. </row>
  495. <row>
  496. <entry>Hameg</entry>
  497. <entry>HO80-2</entry>
  498. <entry>ines_gpib.ko</entry>
  499. <entry>ines_isa</entry>
  500. </row>
  501. <row>
  502. <entry>Hewlett Packard</entry>
  503. <entry>HP82335</entry>
  504. <entry>hp82335.ko</entry>
  505. <entry>hp82335</entry>
  506. </row>
  507. <row>
  508. <entry>Hewlett Packard</entry>
  509. <entry>HP27209</entry>
  510. <entry>hp82335.ko</entry>
  511. <entry>hp82335</entry>
  512. </row>
  513. <row>
  514. <entry>Ines</entry>
  515. <entry>GPIB-HS-NT</entry>
  516. <entry>ines_gpib.ko</entry>
  517. <entry>ines_isa</entry>
  518. </row>
  519. <row>
  520. <entry>Ines</entry>
  521. <entry>GPIB for Compact PCI</entry>
  522. <entry>ines_gpib.ko</entry>
  523. <entry>ines_pci, ines_pci_unaccel</entry>
  524. </row>
  525. <row>
  526. <entry>Ines</entry>
  527. <entry>GPIB for PCI</entry>
  528. <entry>ines_gpib.ko</entry>
  529. <entry>ines_pci, ines_pci_unaccel</entry>
  530. </row>
  531. <row>
  532. <entry>Ines</entry>
  533. <entry>GPIB for PCMCIA</entry>
  534. <entry>ines_gpib.ko</entry>
  535. <entry>ines_pcmcia, ines_pcmcia_unaccel</entry>
  536. </row>
  537. <row>
  538. <entry>Ines</entry>
  539. <entry>GPIB PC/104</entry>
  540. <entry>ines_gpib.ko</entry>
  541. <entry>ines_isa</entry>
  542. </row>
  543. <row>
  544. <entry>Iotech</entry>
  545. <entry>GP488B</entry>
  546. <entry>pc2_gpib.ko</entry>
  547. <entry>pcIIa</entry>
  548. </row>
  549. <row>
  550. <entry>Keithley</entry>
  551. <entry>KPCI-488</entry>
  552. <entry>cec_gpib.ko</entry>
  553. <entry>cec_pci</entry>
  554. </row>
  555. <row>
  556. <entry>Keithley</entry>
  557. <entry>MBC-488</entry>
  558. <entry>pc2_gpib.ko</entry>
  559. <entry>pcII</entry>
  560. </row>
  561. <row>
  562. <entry>Measurement Computing (Computer Boards)</entry>
  563. <entry>CPCI-GPIB</entry>
  564. <entry>cb7210.ko</entry>
  565. <entry>cbi_pci, cbi_pci_unaccel</entry>
  566. </row>
  567. <row>
  568. <entry>Measurement Computing (Computer Boards)</entry>
  569. <entry>ISA-GPIB</entry>
  570. <entry>cb7210.ko</entry>
  571. <entry>cbi_isa, cbi_isa_unaccel</entry>
  572. </row>
  573. <row>
  574. <entry>Measurement Computing (Computer Boards)</entry>
  575. <entry>ISA-GPIB/LC</entry>
  576. <entry>cb7210.ko</entry>
  577. <entry>cbi_isa_unaccel</entry>
  578. </row>
  579. <row>
  580. <entry>Measurement Computing (Computer Boards)</entry>
  581. <entry>ISA-GPIB-PC2A</entry>
  582. <entry>pc2_gpib.ko</entry>
  583. <entry>pcIIa (nec7210 chip), pcIIa_cb7210 (cb7210 chip)</entry>
  584. </row>
  585. <row>
  586. <entry>Measurement Computing (Computer Boards)</entry>
  587. <entry>PCI-GPIB/1M</entry>
  588. <entry>cb7210.ko</entry>
  589. <entry>cbi_pci, cbi_pci_unaccel</entry>
  590. </row>
  591. <row>
  592. <entry>Measurement Computing (Computer Boards)</entry>
  593. <entry>PCI-GPIB/300K</entry>
  594. <entry>cb7210.ko</entry>
  595. <entry>cbi_pci_unaccel</entry>
  596. </row>
  597. <row>
  598. <entry>Measurement Computing (Computer Boards)</entry>
  599. <entry>PCMCIA-GPIB</entry>
  600. <entry>cb7210.ko</entry>
  601. <entry>cbi_pcmcia, cbi_pcmcia_unaccel</entry>
  602. </row>
  603. <row>
  604. <entry>Measurement Computing (Computer Boards)</entry>
  605. <entry>USB-488</entry>
  606. <entry>ni_usb_gpib.ko</entry>
  607. <entry>ni_usb_b</entry>
  608. </row>
  609. <row>
  610. <entry>National Instruments</entry>
  611. <entry>AT-GPIB (with NAT4882 chip)</entry>
  612. <entry>tnt4882.ko</entry>
  613. <entry>ni_nat4882_isa, ni_nat4882_isa_accel</entry>
  614. </row>
  615. <row>
  616. <entry>National Instruments</entry>
  617. <entry>AT-GPIB (with NEC7210 chip)</entry>
  618. <entry>tnt4882.ko</entry>
  619. <entry>ni_nec_isa, ni_nec_isa_accel</entry>
  620. </row>
  621. <row>
  622. <entry>National Instruments</entry>
  623. <entry>AT-GPIB/TNT</entry>
  624. <entry>tnt4882.ko</entry>
  625. <entry>ni_isa, ni_isa_accel</entry>
  626. </row>
  627. <row>
  628. <entry>National Instruments</entry>
  629. <entry><link LINKEND="ni-usb-b">GPIB-USB-B</link></entry>
  630. <entry>ni_usb_gpib.ko</entry>
  631. <entry>ni_usb_b</entry>
  632. </row>
  633. <row>
  634. <entry>National Instruments</entry>
  635. <entry><link LINKEND="ni-usb-hs">GPIB-USB-HS</link></entry>
  636. <entry>ni_usb_gpib.ko</entry>
  637. <entry>ni_usb_b</entry>
  638. </row>
  639. <row>
  640. <entry>National Instruments</entry>
  641. <entry>PCI-GPIB</entry>
  642. <entry>tnt4882.ko</entry>
  643. <entry>ni_pci</entry>
  644. </row>
  645. <row>
  646. <entry>National Instruments</entry>
  647. <entry>PCI-GPIB+</entry>
  648. <entry>tnt4882.ko</entry>
  649. <entry>ni_pci</entry>
  650. </row>
  651. <row>
  652. <entry>National Instruments</entry>
  653. <entry>PCM-GPIB</entry>
  654. <entry>tnt4882.ko</entry>
  655. <entry>ni_pci</entry>
  656. </row>
  657. <row>
  658. <entry>National Instruments</entry>
  659. <entry>PXI-GPIB</entry>
  660. <entry>tnt4882.ko</entry>
  661. <entry>ni_pci</entry>
  662. </row>
  663. <row>
  664. <entry>National Instruments</entry>
  665. <entry>PCII</entry>
  666. <entry>pc2_gpib.ko</entry>
  667. <entry>pcII</entry>
  668. </row>
  669. <row>
  670. <entry>National Instruments</entry>
  671. <entry>PCIIa</entry>
  672. <entry>pc2_gpib.ko</entry>
  673. <entry>pcIIa</entry>
  674. </row>
  675. <row>
  676. <entry>National Instruments</entry>
  677. <entry>PCII/IIa</entry>
  678. <entry>pc2_gpib.ko</entry>
  679. <entry>pcII or pcII_IIa (depending on board switch)</entry>
  680. </row>
  681. <row>
  682. <entry>National Instruments</entry>
  683. <entry>PCMCIA-GPIB</entry>
  684. <entry>tnt4882.ko</entry>
  685. <entry>ni_pcmcia, ni_pcmcia_accel</entry>
  686. </row>
  687. <row>
  688. <entry>Quancom</entry>
  689. <entry>PCIGPIB-1</entry>
  690. <entry>ines_gpib.ko (Ines iGPIB 72010 chip) or cb7210.ko (Measurement Computing cb7210 chip)</entry>
  691. <entry>ines_pci or ines_pci_unaccel (Ines iGPIB 72010 chip),
  692. cbi_pci_unaccel (Measurement Computing cb7210 chip)</entry>
  693. </row>
  694. </tbody>
  695. </tgroup>
  696. </table>
  697. </para>
  698. </section>
  699. <section ID="board-specific-notes">
  700. <title>Board-Specific Notes</title>
  701. <section ID="hp-82341">
  702. <title>Agilent (HP) 82341</title>
  703. <para>
  704. After power-up, the Agilent 82341 boards require a firmware upload before they
  705. can be used. This can be accomplished using the "--init-data" option of
  706. <link LINKEND="configuration-gpib-config">gpib_config</link>. The
  707. firmware data can be found in the gpib_firmware
  708. tarball available from the
  709. <ulink URL="http://linux-gpib.sourceforge.net/">Linux-GPIB home page</ulink>.
  710. Note the C and D versions use different firmware data.
  711. </para>
  712. <para>
  713. If you specify a non-zero base address in /etc/gpib.conf, the driver will
  714. assume you are trying to configure a 82341C. Otherwise, the driver will
  715. use the kernel's ISAPNP support to attempt to configure an 82341D.
  716. </para>
  717. <para>
  718. The 82341 does not support detection of an end-of-string character
  719. in hardware, it only automatically detects the when the EOI
  720. line is asserted. Thus if you use the REOS
  721. flag for a read, the board's fifos will
  722. not be used for the transfer. This will greatly reduce the maximum transfer
  723. rate for your board (which may or may not be noticeable depending on the
  724. device you are talking to).
  725. </para>
  726. </section>
  727. <section ID="agilent-82350b">
  728. <title>Agilent 82350A/B</title>
  729. <para>
  730. The Agilent 82350A and 82350B do not support detection of an end-of-string character
  731. during reads in hardware, they can only detect assertion of the EOI
  732. line. Thus if you use the REOS
  733. flag for a read, the boards' fifos will
  734. not be used for the transfer. This will greatly reduce the maximum transfer
  735. rate for your board (which may or may not be noticeable depending on the
  736. device you are talking to).
  737. </para>
  738. <para>
  739. After power-up, the 82350A boards require a firmware upload before they
  740. can be used. This can be accomplished using the "--init-data" option of
  741. <link LINKEND="configuration-gpib-config">gpib_config</link>. The
  742. firmware data can be found in the gpib_firmware
  743. tarball available from the
  744. <ulink URL="http://linux-gpib.sourceforge.net/">Linux-GPIB home page</ulink>.
  745. The 82350B does not require a firmware upload.
  746. </para>
  747. </section>
  748. <section ID="agilent-82357a">
  749. <title>Agilent 82357A/B</title>
  750. <para>
  751. The Agilent 82357A and 82357B require a firmware upload
  752. (before gpib_config is run) to become functional
  753. after being plugged in. The linux-gpib tarball contains hotplug scripts
  754. for automatically running the fxload program to upload the firmware (and
  755. to run gpib_config after the firmware is uploaded).
  756. However, the actual firmware
  757. data itself must be obtained seperately, as part of the gpib_firmware
  758. tarball available from the
  759. <ulink URL="http://linux-gpib.sourceforge.net/">Linux-GPIB home page</ulink>.
  760. </para>
  761. <para>
  762. The 82357A/B have a few limitation due to their firmware code:
  763. <itemizedlist>
  764. <listitem>
  765. <para>
  766. They cannot be run as a device, but must be the system controller.
  767. </para>
  768. </listitem>
  769. <listitem>
  770. <para>
  771. They cannot be assigned a secondary address.
  772. </para>
  773. </listitem>
  774. <listitem>
  775. <para>
  776. They cannot do 7 bit compares when looking for an end-of-string character (they always
  777. compare all 8 bits).
  778. </para>
  779. </listitem>
  780. </itemizedList>
  781. </para>
  782. </section>
  783. <section ID="ni-usb-b">
  784. <title>National Instruments GPIB-USB-B</title>
  785. <para>
  786. The USB-B requires a firmware upload (before gpib_config is
  787. run) to become functional
  788. after being plugged in. The linux-gpib tarball contains hotplug scripts
  789. for automatically running the fxload program to upload the firmware (and
  790. to run gpib_config after the firmware is uploaded).
  791. However, the actual firmware
  792. data itself must be obtained seperately, as part of the gpib_firmware
  793. tarball available from the
  794. <ulink URL="http://linux-gpib.sourceforge.net/">Linux-GPIB home page</ulink>.
  795. </para>
  796. </section>
  797. <section ID="ni-usb-hs">
  798. <title>National Instruments GPIB-USB-HS</title>
  799. <para>
  800. Unlike the USB-B, the USB-HS does not require a firmware upload to become
  801. functional
  802. after being plugged in. The linux-gpib tarball contains hotplug scripts
  803. which will automatically run gpib_config after the device is plugged in.
  804. </para>
  805. </section>
  806. </section>
  807. </section>
  808. <section ID="reference">
  809. <title>
  810. Linux-GPIB Reference
  811. </title>
  812. <para>
  813. Reference for libgpib functions, macros, and constants.
  814. </para>
  815. <section>
  816. <title>Global Variables</title>
  817. <refentry ID="reference-globals-ibcnt">
  818. <refmeta>
  819. <refentrytitle>ibcnt and ibcntl</refentrytitle>
  820. <manvolnum>3</manvolnum>
  821. </refmeta>
  822. <refnamediv>
  823. <refname>ibcnt and ibcntl</refname>
  824. <refpurpose>hold number of bytes transferred, or errno</refpurpose>
  825. </refnamediv>
  826. <refsynopsisdiv>
  827. <programlisting>
  828. #include &lt;gpib/ib.h&gt;
  829. volatile int ibcnt;
  830. volatile long ibcntl;
  831. </programlisting>
  832. </refsynopsisdiv>
  833. <refsect1>
  834. <title>
  835. Description
  836. </title>
  837. <para>
  838. ibcnt and ibcntl are set after IO operations to the the the number of
  839. bytes sent or received. They are also set to the value of errno after
  840. EDVR or EFSO errors.
  841. </para>
  842. <para>
  843. If you wish to avoid using a global variable, you may instead use
  844. <link LINKEND="reference-function-thread-ibcnt">ThreadIbcnt()
  845. or ThreadIbcntl()</link>
  846. which return thread-specific values.
  847. </para>
  848. </refsect1>
  849. </refentry>
  850. <refentry ID="reference-globals-iberr">
  851. <refmeta>
  852. <refentrytitle>iberr</refentrytitle>
  853. <manvolnum>3</manvolnum>
  854. </refmeta>
  855. <refnamediv>
  856. <refname>iberr</refname>
  857. <refpurpose>holds error code</refpurpose>
  858. </refnamediv>
  859. <refsynopsisdiv>
  860. <programlisting>
  861. #include &lt;gpib/ib.h&gt;
  862. volatile int iberr;
  863. </programlisting>
  864. </refsynopsisdiv>
  865. <refsect1>
  866. <title>
  867. Description
  868. </title>
  869. <para>
  870. iberr is set whenever a function from the 'traditional' or 'multidevice'
  871. API fails with an error. The meaning of each possible value of iberr
  872. is summarized
  873. in the following table:
  874. </para>
  875. <para>
  876. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="1">
  877. <title>iberr error codes</title>
  878. <tgroup COLS="3" ALIGN="left" >
  879. <thead>
  880. <row>
  881. <entry>constant</entry>
  882. <entry>value</entry>
  883. <entry>meaning</entry>
  884. </row>
  885. </thead>
  886. <tbody>
  887. <row>
  888. <entry>EDVR</entry>
  889. <entry>0</entry>
  890. <entry>A system call has failed. ibcnt/ibcntl will be set to the
  891. value of errno.</entry>
  892. </row>
  893. <row>
  894. <entry>ECIC</entry>
  895. <entry>1</entry>
  896. <entry>Your interface board needs to be controller-in-charge, but
  897. is not.</entry>
  898. </row>
  899. <row>
  900. <entry>ENOL</entry>
  901. <entry>2</entry>
  902. <entry>You have attempted to write data or command bytes, but
  903. there are no listeners currently addressed.</entry>
  904. </row>
  905. <row>
  906. <entry>EADR</entry>
  907. <entry>3</entry>
  908. <entry>The interface board has failed to address itself properly
  909. before starting an io operation.</entry>
  910. </row>
  911. <row>
  912. <entry>EARG</entry>
  913. <entry>4</entry>
  914. <entry>One or more arguments to the function call were invalid.</entry>
  915. </row>
  916. <row>
  917. <entry>ESAC</entry>
  918. <entry>5</entry>
  919. <entry>The interface board needs to be system controller, but is not.
  920. </entry>
  921. </row>
  922. <row>
  923. <entry>EABO</entry>
  924. <entry>6</entry>
  925. <entry>A read or write of data bytes has been aborted, possibly due
  926. to a timeout or reception of a device clear command.</entry>
  927. </row>
  928. <row>
  929. <entry>ENEB</entry>
  930. <entry>7</entry>
  931. <entry>The GPIB interface board does not exist, its driver is not
  932. loaded, or it is not configured properly.</entry>
  933. </row>
  934. <row>
  935. <entry>EDMA</entry>
  936. <entry>8</entry>
  937. <entry>Not used (DMA error), included for compatibility purposes.</entry>
  938. </row>
  939. <row>
  940. <entry>EOIP</entry>
  941. <entry>10</entry>
  942. <entry>Function call can not proceed due to an asynchronous IO operation
  943. (ibrda(), ibwrta(), or ibcmda()) in progress.</entry>
  944. </row>
  945. <row>
  946. <entry>ECAP</entry>
  947. <entry>11</entry>
  948. <entry>Incapable of executing function call, due the GPIB board lacking
  949. the capability, or
  950. the capability being disabled in software.</entry>
  951. </row>
  952. <row>
  953. <entry>EFSO</entry>
  954. <entry>12</entry>
  955. <entry>File system error. ibcnt/ibcntl will be set to the value of errno.</entry>
  956. </row>
  957. <row>
  958. <entry>EBUS</entry>
  959. <entry>14</entry>
  960. <entry>An attempt to write command bytes to the bus has timed out.</entry>
  961. </row>
  962. <row>
  963. <entry>ESTB</entry>
  964. <entry>15</entry>
  965. <entry>One or more serial poll status bytes have been lost. This can
  966. occur due to
  967. too many status bytes accumulating (through automatic serial polling)
  968. without being read.</entry>
  969. </row>
  970. <row>
  971. <entry>ESRQ</entry>
  972. <entry>16</entry>
  973. <entry>The serial poll request service line is stuck on. This can occur
  974. if a physical device on the bus requests service, but its GPIB address has
  975. not been opened
  976. (via ibdev() for example) by any process. Thus the automatic serial
  977. polling routines are unaware of the device's existence and will never
  978. serial poll it.
  979. </entry>
  980. </row>
  981. <row>
  982. <entry>ETAB</entry>
  983. <entry>20</entry>
  984. <entry>This error can be returned by
  985. <link LINKEND="reference-function-ibevent">ibevent()</link>, FindLstn(), or
  986. FindRQS(). See their descriptions for more information.</entry>
  987. </row>
  988. </tbody>
  989. </tgroup>
  990. </table>
  991. </para>
  992. <para>
  993. If you wish to avoid using a global variable, you may instead use
  994. <link LINKEND="reference-function-thread-iberr">ThreadIberr()</link>
  995. which returns a thread-specific value.
  996. </para>
  997. </refsect1>
  998. </refentry>
  999. <refentry ID="reference-globals-ibsta">
  1000. <refmeta>
  1001. <refentrytitle>ibsta</refentrytitle>
  1002. <manvolnum>3</manvolnum>
  1003. </refmeta>
  1004. <refnamediv>
  1005. <refname>ibsta</refname>
  1006. <refpurpose>holds status</refpurpose>
  1007. </refnamediv>
  1008. <refsynopsisdiv>
  1009. <programlisting>
  1010. #include &lt;gpib/ib.h&gt;
  1011. volatile int ibsta;
  1012. </programlisting>
  1013. </refsynopsisdiv>
  1014. <refsect1>
  1015. <title>
  1016. Description
  1017. </title>
  1018. <para>
  1019. ibsta is set whenever a function from the 'traditional' or 'multidevice'
  1020. API is called. Each of the bits in ibsta has a different meaning, summarized
  1021. in the following table:
  1022. </para>
  1023. <para>
  1024. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="1">
  1025. <title>ibsta Bits</title>
  1026. <tgroup COLS="4" ALIGN="left" >
  1027. <thead>
  1028. <row>
  1029. <entry>bit</entry>
  1030. <entry>value (hexadecimal)</entry>
  1031. <entry>meaning</entry>
  1032. <entry>used for board/device</entry>
  1033. </row>
  1034. </thead>
  1035. <tbody>
  1036. <row>
  1037. <entry>DCAS</entry>
  1038. <entry>0x1</entry>
  1039. <entry>DCAS is set when a board receives the device clear command
  1040. (that is, the
  1041. SDC or DCL <link LINKEND="reference-command-bytes">command byte</link>).
  1042. It is cleared on the next 'traditional' or
  1043. 'multidevice' function call following ibwait() (with DCAS set in the
  1044. wait mask), or following a read
  1045. or write (ibrd(), ibwrt(), Receive(), etc.).
  1046. The DCAS and DTAS bits will only be set if the event queue is disabled.
  1047. The event queue may be disabled with
  1048. <link LINKEND="reference-function-ibconfig">ibconfig()</link>.</entry>
  1049. <entry>board</entry>
  1050. </row>
  1051. <row>
  1052. <entry>DTAS</entry>
  1053. <entry>0x2</entry>
  1054. <entry>DTAS is set when a board has received a device trigger command
  1055. (that is,
  1056. the GET <link LINKEND="reference-command-bytes">command byte</link>).
  1057. It is cleared on the next 'traditional' or
  1058. 'multidevice' function call following ibwait() (with DTAS in the wait
  1059. mask).
  1060. The DCAS and DTAS bits will only be set if the event queue is disabled.
  1061. The event queue may be disabled with
  1062. <link LINKEND="reference-function-ibconfig">ibconfig()</link>.</entry>
  1063. <entry>board</entry>
  1064. </row>
  1065. <row>
  1066. <entry>LACS</entry>
  1067. <entry>0x4</entry>
  1068. <entry>Board is currently addressed as a listener.</entry>
  1069. <entry>board</entry>
  1070. </row>
  1071. <row>
  1072. <entry>TACS</entry>
  1073. <entry>0x8</entry>
  1074. <entry>Board is currently addressed as talker.</entry>
  1075. <entry>board</entry>
  1076. </row>
  1077. <row>
  1078. <entry>ATN</entry>
  1079. <entry>0x10</entry>
  1080. <entry>The ATN line is asserted.</entry>
  1081. <entry>board</entry>
  1082. </row>
  1083. <row>
  1084. <entry>CIC</entry>
  1085. <entry>0x20</entry>
  1086. <entry>Board is controller-in-charge, so it is able to set the ATN line.</entry>
  1087. <entry>board</entry>
  1088. </row>
  1089. <row>
  1090. <entry>REM</entry>
  1091. <entry>0x40</entry>
  1092. <entry>Board is in 'remote' state.</entry>
  1093. <entry>board</entry>
  1094. </row>
  1095. <row>
  1096. <entry>LOK</entry>
  1097. <entry>0x80</entry>
  1098. <entry>Board is in 'lockout' state.</entry>
  1099. <entry>board</entry>
  1100. </row>
  1101. <row>
  1102. <entry>CMPL</entry>
  1103. <entry>0x100</entry>
  1104. <entry>I/O operation is complete. Useful for determining when
  1105. an asynchronous io operation (ibrda(), ibwrta(), etc) has
  1106. completed.</entry>
  1107. <entry>board or device</entry>
  1108. </row>
  1109. <row>
  1110. <entry>EVENT</entry>
  1111. <entry>0x200</entry>
  1112. <entry>One or more clear, trigger, or interface clear events have been received,
  1113. and are available in the event queue
  1114. (see <link LINKEND="reference-function-ibevent">ibevent()</link>).
  1115. The EVENT bit will only be set if the event queue is enabled. The
  1116. event queue may be enabled with
  1117. <link LINKEND="reference-function-ibconfig">ibconfig()</link>.</entry>
  1118. <entry>board</entry>
  1119. </row>
  1120. <row>
  1121. <entry>SPOLL</entry>
  1122. <entry>0x400</entry>
  1123. <entry>If this bit is enabled (see ibconfig()), it is set when the board is
  1124. serial polled. The SPOLL bit is cleared when the board requests service
  1125. (see ibrsv()) or you call ibwait() on the board with SPOLL in the wait mask.
  1126. </entry>
  1127. <entry>board</entry>
  1128. </row>
  1129. <row>
  1130. <entry>RQS</entry>
  1131. <entry>0x800</entry>
  1132. <entry>RQS indicates that the device has requested service, and one
  1133. or more status bytes are available for reading with ibrsp(). RQS will
  1134. only be set if you have automatic serial polling enabled (see
  1135. <link LINKEND="reference-function-ibconfig">ibconfig()</link>).</entry>
  1136. <entry>device</entry>
  1137. </row>
  1138. <row>
  1139. <entry>SRQI</entry>
  1140. <entry>0x1000</entry>
  1141. <entry>SRQI indicates that a device connected to the board is asserting
  1142. the SRQ line. It
  1143. is only set if the board is the controller-in-charge. If
  1144. automatic serial polling is enabled (see
  1145. <link LINKEND="reference-function-ibconfig">ibconfig()</link>),
  1146. SRQI will generally be cleared,
  1147. since when a device requests service it will be automatically
  1148. polled and then unassert SRQ.</entry>
  1149. <entry>board</entry>
  1150. </row>
  1151. <row>
  1152. <entry>END</entry>
  1153. <entry>0x2000</entry>
  1154. <entry>END is set if the last io operation ended with the EOI
  1155. line asserted, and may be set on reception of the end-of-string character.
  1156. The
  1157. IbcEndBitIsNormal option of ibconfig() can be used to configure
  1158. whether or not END should be set on reception of the eos character.
  1159. </entry>
  1160. <entry>board or device</entry>
  1161. </row>
  1162. <row>
  1163. <entry>TIMO</entry>
  1164. <entry>0x4000</entry>
  1165. <entry>TIMO indicates that the last io operation or ibwait() timed out.</entry>
  1166. <entry>board or device</entry>
  1167. </row>
  1168. <row>
  1169. <entry>ERR</entry>
  1170. <entry>0x8000</entry>
  1171. <entry>ERR is set if the last 'traditional' or 'multidevice' function
  1172. call failed. The global variable <link LINKEND="reference-globals-iberr">iberr</link>
  1173. will be set indicate the
  1174. cause of the error.</entry>
  1175. <entry>board or device</entry>
  1176. </row>
  1177. </tbody>
  1178. </tgroup>
  1179. </table>
  1180. </para>
  1181. <para>
  1182. If you wish to avoid using a global variable, you may instead use
  1183. <link LINKEND="reference-function-thread-ibsta">ThreadIbsta()</link>
  1184. which returns a thread-specific value.
  1185. </para>
  1186. </refsect1>
  1187. </refentry>
  1188. </section>
  1189. <section>
  1190. <title>
  1191. 'Traditional' API Functions
  1192. </title>
  1193. <refentry ID="reference-function-ibask">
  1194. <refmeta>
  1195. <refentrytitle>ibask</refentrytitle>
  1196. <manvolnum>3</manvolnum>
  1197. </refmeta>
  1198. <refnamediv>
  1199. <refname>ibask</refname>
  1200. <refpurpose>query configuration (board or device)</refpurpose>
  1201. </refnamediv>
  1202. <refsynopsisdiv>
  1203. <funcsynopsis>
  1204. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  1205. <funcprototype>
  1206. <funcdef>int <function>ibask</function></funcdef>
  1207. <paramdef>int <parameter>ud</parameter></paramdef>
  1208. <paramdef>int <parameter>option</parameter></paramdef>
  1209. <paramdef>int *<parameter>result</parameter></paramdef>
  1210. </funcprototype>
  1211. </funcsynopsis>
  1212. </refsynopsisdiv>
  1213. <refsect1>
  1214. <title>
  1215. Description
  1216. </title>
  1217. <para>
  1218. Queries various configuration settings associated with the
  1219. board or device descriptor <parameter>ud</parameter>. The
  1220. <parameter>option</parameter> argument specifies the particular
  1221. setting you wish to query. The result of the query is written
  1222. to the location specified by <parameter>result</parameter>.
  1223. To change the descriptor's configuration, see
  1224. <link LINKEND="reference-function-ibconfig">ibconfig()</link>.
  1225. </para>
  1226. <para>
  1227. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="1">
  1228. <title>ibask options</title>
  1229. <tgroup COLS="3" ALIGN="left" >
  1230. <thead>
  1231. <row>
  1232. <entry>option</entry>
  1233. <entry>value (hexadecimal)</entry>
  1234. <entry>result of query</entry>
  1235. <entry>used for board/device</entry>
  1236. </row>
  1237. </thead>
  1238. <tbody>
  1239. <row>
  1240. <entry>IbaPAD</entry>
  1241. <entry>0x1</entry>
  1242. <entry>GPIB primary address</entry>
  1243. <entry>board or device</entry>
  1244. </row>
  1245. <row>
  1246. <entry>IbaSAD</entry>
  1247. <entry>0x2</entry>
  1248. <entry>GPIB secondary address (0 for none, 0x60 to 0x7e for secondary
  1249. addresses 0 to 30)</entry>
  1250. <entry>board or device</entry>
  1251. </row>
  1252. <row>
  1253. <entry>IbaTMO</entry>
  1254. <entry>0x3</entry>
  1255. <entry>Timeout setting for io operations (a number from 0 to 17). See
  1256. <link LINKEND="reference-function-ibtmo">ibmto()</link>.
  1257. </entry>
  1258. <entry>board or device</entry>
  1259. </row>
  1260. <row>
  1261. <entry>IbaEOT</entry>
  1262. <entry>0x4</entry>
  1263. <entry>Nonzero if EOI is asserted with last byte on writes.
  1264. See <link LINKEND="reference-function-ibeot">ibeot()</link>.
  1265. </entry>
  1266. <entry></entry>
  1267. </row>
  1268. <row>
  1269. <entry>IbaPPC</entry>
  1270. <entry>0x5</entry>
  1271. <entry>Parallel poll configuration. See
  1272. <link LINKEND="reference-function-ibppc">ibppc()</link>.
  1273. </entry>
  1274. <entry>board</entry>
  1275. </row>
  1276. <row>
  1277. <entry>IbaREADDR</entry>
  1278. <entry>0x6</entry>
  1279. <entry>Useless, included for compatibility only.</entry>
  1280. <entry>device</entry>
  1281. </row>
  1282. <row>
  1283. <entry>IbaAUTOPOLL</entry>
  1284. <entry>0x7</entry>
  1285. <entry>Nonzero if automatic serial polling is enabled.</entry>
  1286. <entry>board</entry>
  1287. </row>
  1288. <row>
  1289. <entry>IbaCICPROT</entry>
  1290. <entry>0x8</entry>
  1291. <entry>Useless, included for compatibility only.</entry>
  1292. <entry>board</entry>
  1293. </row>
  1294. <row>
  1295. <entry>IbaSC</entry>
  1296. <entry>0xa</entry>
  1297. <entry>Nonzero if board is system controller.
  1298. See <link LINKEND="reference-function-ibrsc">ibrsc()</link>.
  1299. </entry>
  1300. <entry>board</entry>
  1301. </row>
  1302. <row>
  1303. <entry>IbaSRE</entry>
  1304. <entry>0xb</entry>
  1305. <entry>Nonzero if board autmatically asserts REN line when
  1306. it becomes the system controller. See
  1307. <link LINKEND="reference-function-ibsre">ibsre()</link>.
  1308. </entry>
  1309. <entry>board</entry>
  1310. </row>
  1311. <row>
  1312. <entry>IbaEOSrd</entry>
  1313. <entry>0xc</entry>
  1314. <entry>Nonzero if termination of reads on reception of the end-of-string
  1315. character is enabled. See <link LINKEND="reference-function-ibeos">ibeos()</link>,
  1316. in particular the REOS bit.
  1317. </entry>
  1318. <entry>board or device</entry>
  1319. </row>
  1320. <row>
  1321. <entry>IbaEOSwrt</entry>
  1322. <entry>0xd</entry>
  1323. <entry>Nonzero if EOI is asserted whenever end-of-string character is
  1324. sent. See <link LINKEND="reference-function-ibeos">ibeos()</link>,
  1325. in particular the XEOS bit.</entry>
  1326. <entry>board or device</entry>
  1327. </row>
  1328. <row>
  1329. <entry>IbaEOScmp</entry>
  1330. <entry>0xe</entry>
  1331. <entry>Nonzero if all 8 bits are used to match end-of-string
  1332. character. Zero if only least significant 7 bits are used.
  1333. See <link LINKEND="reference-function-ibeos">ibeos()</link>,
  1334. in particular the BIN bit.</entry>
  1335. <entry>board or device</entry>
  1336. </row>
  1337. <row>
  1338. <entry>IbaEOSchar</entry>
  1339. <entry>0xf</entry>
  1340. <entry>The end-of-string byte.</entry>
  1341. <entry>board or device</entry>
  1342. </row>
  1343. <row>
  1344. <entry>IbaPP2</entry>
  1345. <entry>0x10</entry>
  1346. <entry>Nonzero if in local parallel poll configure mode. Zero
  1347. if in remote parallel poll configure mode.</entry>
  1348. <entry>board</entry>
  1349. </row>
  1350. <row>
  1351. <entry>IbaTIMING</entry>
  1352. <entry>0x11</entry>
  1353. <entry>Number indicating T1 delay. 1 for 2 microseconds, 2 for 500
  1354. nanoseconds, 3 for 350 nanoseconds. The values are declared in
  1355. the header files as the constants T1_DELAY_2000ns, T1_DELAY_500ns,
  1356. and T1_DELAY_350ns.
  1357. </entry>
  1358. <entry>board</entry>
  1359. </row>
  1360. <row>
  1361. <entry>IbaReadAdjust</entry>
  1362. <entry>0x13</entry>
  1363. <entry>Nonzero if byte pairs are automatically swapped during
  1364. reads.</entry>
  1365. <entry>board or device</entry>
  1366. </row>
  1367. <row>
  1368. <entry>IbaWriteAdjust</entry>
  1369. <entry>0x14</entry>
  1370. <entry>Nonzero if byte pairs are automatically swapped during
  1371. writes.</entry>
  1372. <entry>board or device</entry>
  1373. </row>
  1374. <row>
  1375. <entry>IbaEventQueue</entry>
  1376. <entry>0x15</entry>
  1377. <entry>Nonzero if event queue is enabled.</entry>
  1378. <entry>board</entry>
  1379. </row>
  1380. <row>
  1381. <entry>IbaSPollBit</entry>
  1382. <entry>0x16</entry>
  1383. <entry>Nonzero if the use of the SPOLL bit in ibsta is enabled.</entry>
  1384. <entry>board</entry>
  1385. </row>
  1386. <row>
  1387. <entry>IbaSendLLO</entry>
  1388. <entry>0x17</entry>
  1389. <entry>Nonzero if devices connected to this board are automatically
  1390. put into local lockout
  1391. mode when brought online with ibfind() or ibdev().</entry>
  1392. <entry>board</entry>
  1393. </row>
  1394. <row>
  1395. <entry>IbaSPollTime</entry>
  1396. <entry>0x18</entry>
  1397. <entry>Timeout for serial polls. The value of the result
  1398. is between 0 and 17, and has the same meaning as in
  1399. <link LINKEND="reference-function-ibtmo">ibtmo()</link>.
  1400. </entry>
  1401. <entry>device</entry>
  1402. </row>
  1403. <row>
  1404. <entry>IbaPPollTime</entry>
  1405. <entry>0x18</entry>
  1406. <entry>Timeout for parallel polls. The value of the result
  1407. is between 0 and 17, and has the same meaning as in
  1408. <link LINKEND="reference-function-ibtmo">ibtmo()</link>.
  1409. </entry>
  1410. <entry>board</entry>
  1411. </row>
  1412. <row>
  1413. <entry>IbaEndBitIsNormal</entry>
  1414. <entry>0x1a</entry>
  1415. <entry>Nonzero if END bit of ibsta is set on reception of end-of-string
  1416. character or EOI. Zero if END bit is only set on EOI.</entry>
  1417. <entry>board or device</entry>
  1418. </row>
  1419. <row>
  1420. <entry>IbaUnAddr</entry>
  1421. <entry>0x1b</entry>
  1422. <entry>Nonzero if UNT (untalk) and UNL (unlisten) commands are automatically
  1423. sent after a completed io operation using this descriptor.</entry>
  1424. <entry>device</entry>
  1425. </row>
  1426. <row>
  1427. <entry>IbaHSCableLength</entry>
  1428. <entry>0x1f</entry>
  1429. <entry>Useless, included only for compatibility.</entry>
  1430. <entry>board</entry>
  1431. </row>
  1432. <row>
  1433. <entry>IbaIst</entry>
  1434. <entry>0x20</entry>
  1435. <entry>Individual status bit, a.k.a. 'ist'.</entry>
  1436. <entry>board</entry>
  1437. </row>
  1438. <row>
  1439. <entry>IbaRsv</entry>
  1440. <entry>0x21</entry>
  1441. <entry>The current status byte this board will use to respond to
  1442. serial polls.</entry>
  1443. <entry>board</entry>
  1444. </row>
  1445. <row>
  1446. <entry>IbaBNA</entry>
  1447. <entry>0x200</entry>
  1448. <entry>Board index (minor number) of interface board which is
  1449. the controller-in-charge of this device's GPIB bus.</entry>
  1450. <entry>device</entry>
  1451. </row>
  1452. <row>
  1453. <entry>Iba7BitEOS</entry>
  1454. <entry>0x1000</entry>
  1455. <entry>Nonzero if board supports 7 bit EOS comparisons.
  1456. See <link LINKEND="reference-function-ibeos">ibeos()</link>,
  1457. in particular the BIN bit. This is a Linux-GPIB extension.
  1458. </entry>
  1459. <entry>board</entry>
  1460. </row>
  1461. </tbody>
  1462. </tgroup>
  1463. </table>
  1464. </para>
  1465. </refsect1>
  1466. <refsect1>
  1467. <title>
  1468. Return value
  1469. </title>
  1470. <para>
  1471. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  1472. </para>
  1473. </refsect1>
  1474. </refentry>
  1475. <refentry ID="reference-function-ibbna">
  1476. <refmeta>
  1477. <refentrytitle>ibbna</refentrytitle>
  1478. <manvolnum>3</manvolnum>
  1479. </refmeta>
  1480. <refnamediv>
  1481. <refname>ibbna</refname>
  1482. <refpurpose>change access board (device)</refpurpose>
  1483. </refnamediv>
  1484. <refsynopsisdiv>
  1485. <funcsynopsis>
  1486. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  1487. <funcprototype>
  1488. <funcdef>int <function>ibbna</function></funcdef>
  1489. <paramdef>int <parameter>ud</parameter></paramdef>
  1490. <paramdef>const char *<parameter>name</parameter></paramdef>
  1491. </funcprototype>
  1492. </funcsynopsis>
  1493. </refsynopsisdiv>
  1494. <refsect1>
  1495. <title>
  1496. Description
  1497. </title>
  1498. <para>
  1499. ibbna() changes the GPIB interface board used to access the device
  1500. specified by <parameter>ud</parameter>. Subsequent device level
  1501. calls using the descriptor <parameter>ud</parameter> will assume
  1502. the device is connected to the interface board specified by
  1503. <parameter>name</parameter>. If you wish to specify a
  1504. device's new access board by board index instead
  1505. of name, you can use the IbcBNA option of ibconfig().
  1506. </para>
  1507. <para>
  1508. The name of a board can be specified
  1509. in the configuration file <link LINKEND="configuration">gpib.conf</link>.
  1510. </para>
  1511. <para>
  1512. On success, iberr is set to the board index of the device's old access board.
  1513. </para>
  1514. </refsect1>
  1515. <refsect1>
  1516. <title>
  1517. Return value
  1518. </title>
  1519. <para>
  1520. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  1521. </para>
  1522. </refsect1>
  1523. </refentry>
  1524. <refentry ID="reference-function-ibcac">
  1525. <refmeta>
  1526. <refentrytitle>ibcac</refentrytitle>
  1527. <manvolnum>3</manvolnum>
  1528. </refmeta>
  1529. <refnamediv>
  1530. <refname>ibcac</refname>
  1531. <refpurpose>assert ATN (board)</refpurpose>
  1532. </refnamediv>
  1533. <refsynopsisdiv>
  1534. <funcsynopsis>
  1535. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  1536. <funcprototype>
  1537. <funcdef>int <function>ibcac</function></funcdef>
  1538. <paramdef>int <parameter>ud</parameter></paramdef>
  1539. <paramdef>int <parameter>synchronous</parameter></paramdef>
  1540. </funcprototype>
  1541. </funcsynopsis>
  1542. </refsynopsisdiv>
  1543. <refsect1>
  1544. <title>
  1545. Description
  1546. </title>
  1547. <para>
  1548. ibcac() causes the board specified by the board descriptor <parameter>ud</parameter>
  1549. to become active controller by asserting the ATN line.
  1550. The board must be controller-in-change in order to assert ATN.
  1551. If <parameter>synchronous</parameter> is nonzero, then
  1552. the board will wait for a data
  1553. byte on the bus to complete its transfer before asserting ATN.
  1554. If the synchronous attempt times out, or <parameter>synchronous</parameter>
  1555. is zero, then ATN will be asserted immediately.
  1556. </para>
  1557. <para>
  1558. It is generally not necessary to call ibcac(). It is provided
  1559. for advanced users who want direct, low-level access to the GPIB bus.
  1560. </para>
  1561. </refsect1>
  1562. <refsect1>
  1563. <title>
  1564. Return value
  1565. </title>
  1566. <para>
  1567. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  1568. </para>
  1569. </refsect1>
  1570. </refentry>
  1571. <refentry ID="reference-function-ibclr">
  1572. <refmeta>
  1573. <refentrytitle>ibclr</refentrytitle>
  1574. <manvolnum>3</manvolnum>
  1575. </refmeta>
  1576. <refnamediv>
  1577. <refname>ibclr</refname>
  1578. <refpurpose>clear device (device)</refpurpose>
  1579. </refnamediv>
  1580. <refsynopsisdiv>
  1581. <funcsynopsis>
  1582. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  1583. <funcprototype>
  1584. <funcdef>int <function>ibclr</function></funcdef>
  1585. <paramdef>int <parameter>ud</parameter></paramdef>
  1586. </funcprototype>
  1587. </funcsynopsis>
  1588. </refsynopsisdiv>
  1589. <refsect1>
  1590. <title>
  1591. Description
  1592. </title>
  1593. <para>
  1594. ibclr() sends the clear command to the device specified by <parameter>ud</parameter>.
  1595. </para>
  1596. </refsect1>
  1597. <refsect1>
  1598. <title>
  1599. Return value
  1600. </title>
  1601. <para>
  1602. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  1603. </para>
  1604. </refsect1>
  1605. </refentry>
  1606. <refentry ID="reference-function-ibcmd">
  1607. <refmeta>
  1608. <refentrytitle>ibcmd</refentrytitle>
  1609. <manvolnum>3</manvolnum>
  1610. </refmeta>
  1611. <refnamediv>
  1612. <refname>ibcmd</refname>
  1613. <refpurpose>write command bytes (board)</refpurpose>
  1614. </refnamediv>
  1615. <refsynopsisdiv>
  1616. <funcsynopsis>
  1617. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  1618. <funcprototype>
  1619. <funcdef>int <function>ibcmd</function></funcdef>
  1620. <paramdef>int <parameter>ud</parameter></paramdef>
  1621. <paramdef>const void *<parameter>commands</parameter></paramdef>
  1622. <paramdef>long <parameter>num_bytes</parameter></paramdef>
  1623. </funcprototype>
  1624. </funcsynopsis>
  1625. </refsynopsisdiv>
  1626. <refsect1>
  1627. <title>
  1628. Description
  1629. </title>
  1630. <para>
  1631. ibcmd() writes the <link LINKEND="reference-command-bytes">command bytes</link>
  1632. contained
  1633. in the array <parameter>commands</parameter>
  1634. to the bus. The number of bytes written from the array is specified by
  1635. <parameter>num_bytes</parameter>. The <parameter>ud</parameter> argument is a
  1636. board descriptor, and the
  1637. board must be controller-in-charge. Most of the
  1638. possible command bytes are declared as constants in the header files.
  1639. In particular, the constants GTL, SDC, PPConfig, GET, TCT, LLO, DCL, PPU, SPE,
  1640. SPD, UNL, UNT,and PPD are available. Additionally, the inline functions
  1641. MTA(), MLA(), MSA(), and PPE_byte() are available for producing
  1642. 'my talk address', 'my listen address', 'my secondary address', and
  1643. 'parallel poll enable' command bytes respectively.
  1644. </para>
  1645. <para>
  1646. It is generally not necessary to call ibcmd(). It is provided
  1647. for advanced users who want direct, low-level access to the GPIB bus.
  1648. </para>
  1649. </refsect1>
  1650. <refsect1>
  1651. <title>
  1652. Return value
  1653. </title>
  1654. <para>
  1655. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  1656. </para>
  1657. </refsect1>
  1658. </refentry>
  1659. <refentry ID="reference-function-ibcmda">
  1660. <refmeta>
  1661. <refentrytitle>ibcmda</refentrytitle>
  1662. <manvolnum>3</manvolnum>
  1663. </refmeta>
  1664. <refnamediv>
  1665. <refname>ibcmda</refname>
  1666. <refpurpose>write command bytes asynchronously (board)</refpurpose>
  1667. </refnamediv>
  1668. <refsynopsisdiv>
  1669. <funcsynopsis>
  1670. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  1671. <funcprototype>
  1672. <funcdef>int <function>ibcmda</function></funcdef>
  1673. <paramdef>int <parameter>ud</parameter></paramdef>
  1674. <paramdef>const void *<parameter>commands</parameter></paramdef>
  1675. <paramdef>long <parameter>num_bytes</parameter></paramdef>
  1676. </funcprototype>
  1677. </funcsynopsis>
  1678. </refsynopsisdiv>
  1679. <refsect1>
  1680. <title>
  1681. Description
  1682. </title>
  1683. <para>
  1684. ibcmda() is similar to
  1685. <link LINKEND="reference-function-ibcmd">ibcmd()</link>
  1686. except it operates asynchronously. ibcmda() does not
  1687. wait for the sending of the command bytes to complete, but
  1688. rather returns immediately.
  1689. </para>
  1690. <para>
  1691. While an asynchronous
  1692. operation is in progress, most library functions will
  1693. fail with an EOIP error. In order to sucessfully
  1694. complete an
  1695. asynchronous operation, you must call
  1696. <link LINKEND="reference-function-ibwait">ibwait()</link>
  1697. until the CMPL bit is set ibsta. Asynchronous
  1698. operations
  1699. may also be aborted with an
  1700. <link LINKEND="reference-function-ibstop">ibstop()</link>
  1701. or
  1702. <link LINKEND="reference-function-ibonl">ibonl()</link>
  1703. call.
  1704. </para>
  1705. </refsect1>
  1706. <refsect1>
  1707. <title>
  1708. Return value
  1709. </title>
  1710. <para>
  1711. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  1712. </para>
  1713. </refsect1>
  1714. </refentry>
  1715. <refentry ID="reference-function-ibconfig">
  1716. <refmeta>
  1717. <refentrytitle>ibconfig</refentrytitle>
  1718. <manvolnum>3</manvolnum>
  1719. </refmeta>
  1720. <refnamediv>
  1721. <refname>ibconfig</refname>
  1722. <refpurpose>change configuration (board or device)</refpurpose>
  1723. </refnamediv>
  1724. <refsynopsisdiv>
  1725. <funcsynopsis>
  1726. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  1727. <funcprototype>
  1728. <funcdef>int <function>ibconfig</function></funcdef>
  1729. <paramdef>int <parameter>ud</parameter></paramdef>
  1730. <paramdef>int <parameter>option</parameter></paramdef>
  1731. <paramdef>int <parameter>setting</parameter></paramdef>
  1732. </funcprototype>
  1733. </funcsynopsis>
  1734. </refsynopsisdiv>
  1735. <refsect1>
  1736. <title>
  1737. Description
  1738. </title>
  1739. <para>
  1740. Changes various configuration settings associated with the
  1741. board or device descriptor <parameter>ud</parameter>. The
  1742. <parameter>option</parameter> argument specifies the particular
  1743. setting you wish to modify. The <parameter>setting</parameter>
  1744. argument specifies the option's new configuration.
  1745. To query the descriptor's configuration, see
  1746. <link LINKEND="reference-function-ibask">ibask()</link>.
  1747. </para>
  1748. <para>
  1749. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="1">
  1750. <title>ibconfig options</title>
  1751. <tgroup COLS="3" ALIGN="left" >
  1752. <thead>
  1753. <row>
  1754. <entry>option</entry>
  1755. <entry>value (hexadecimal)</entry>
  1756. <entry>effect</entry>
  1757. <entry>used for board/device</entry>
  1758. </row>
  1759. </thead>
  1760. <tbody>
  1761. <row>
  1762. <entry>IbcPAD</entry>
  1763. <entry>0x1</entry>
  1764. <entry>Sets GPIB primary address. Same as
  1765. <link LINKEND="reference-function-ibpad">ibpad()</link>
  1766. </entry>
  1767. <entry>board or device</entry>
  1768. </row>
  1769. <row>
  1770. <entry>IbcSAD</entry>
  1771. <entry>0x2</entry>
  1772. <entry>Sets GPIB secondary address. Same as
  1773. <link LINKEND="reference-function-ibsad">ibsad()</link>
  1774. </entry>
  1775. <entry>board or device</entry>
  1776. </row>
  1777. <row>
  1778. <entry>IbcTMO</entry>
  1779. <entry>0x3</entry>
  1780. <entry>Sets timeout for io operations. Same as
  1781. <link LINKEND="reference-function-ibtmo">ibmto()</link>.
  1782. </entry>
  1783. <entry>board or device</entry>
  1784. </row>
  1785. <row>
  1786. <entry>IbcEOT</entry>
  1787. <entry>0x4</entry>
  1788. <entry>If setting is nonzero, EOI is asserted with last byte on writes.
  1789. Same as <link LINKEND="reference-function-ibeot">ibeot()</link>.
  1790. </entry>
  1791. <entry></entry>
  1792. </row>
  1793. <row>
  1794. <entry>IbcPPC</entry>
  1795. <entry>0x5</entry>
  1796. <entry>Sets parallel poll configuration. Same as
  1797. <link LINKEND="reference-function-ibppc">ibppc()</link>.
  1798. </entry>
  1799. <entry>board</entry>
  1800. </row>
  1801. <row>
  1802. <entry>IbcREADDR</entry>
  1803. <entry>0x6</entry>
  1804. <entry>Useless, included for compatibility only.</entry>
  1805. <entry>device</entry>
  1806. </row>
  1807. <row>
  1808. <entry>IbcAUTOPOLL</entry>
  1809. <entry>0x7</entry>
  1810. <entry>If setting is nonzero then automatic serial polling is enabled.</entry>
  1811. <entry>board</entry>
  1812. </row>
  1813. <row>
  1814. <entry>IbcCICPROT</entry>
  1815. <entry>0x8</entry>
  1816. <entry>Useless, included for compatibility only.</entry>
  1817. <entry>board</entry>
  1818. </row>
  1819. <row>
  1820. <entry>IbcSC</entry>
  1821. <entry>0xa</entry>
  1822. <entry>If setting is nonzero, board becomes system controller.
  1823. Same as <link LINKEND="reference-function-ibrsc">ibrsc()</link>.
  1824. </entry>
  1825. <entry>board</entry>
  1826. </row>
  1827. <row>
  1828. <entry>IbcSRE</entry>
  1829. <entry>0xb</entry>
  1830. <entry>If setting is nonzero then board asserts REN line. Otherwise
  1831. REN is unasserted. Same as
  1832. <link LINKEND="reference-function-ibsre">ibsre()</link>.
  1833. </entry>
  1834. <entry>board</entry>
  1835. </row>
  1836. <row>
  1837. <entry>IbcEOSrd</entry>
  1838. <entry>0xc</entry>
  1839. <entry>If setting is nonzero then reads are terminated on reception
  1840. of the end-of-string character.
  1841. See <link LINKEND="reference-function-ibeos">ibeos()</link>,
  1842. in particular the REOS bit.
  1843. </entry>
  1844. <entry>board or device</entry>
  1845. </row>
  1846. <row>
  1847. <entry>IbcEOSwrt</entry>
  1848. <entry>0xd</entry>
  1849. <entry>If setting is nonzero then EOI is asserted whenever
  1850. the end-of-string character is
  1851. sent. See <link LINKEND="reference-function-ibeos">ibeos()</link>,
  1852. in particular the XEOS bit.</entry>
  1853. <entry>board or device</entry>
  1854. </row>
  1855. <row>
  1856. <entry>IbcEOScmp</entry>
  1857. <entry>0xe</entry>
  1858. <entry>If setting is nonzero then all 8 bits are used to match
  1859. the end-of-string
  1860. character. Otherwise only the least significant 7 bits are used.
  1861. See <link LINKEND="reference-function-ibeos">ibeos()</link>,
  1862. in particular the BIN bit.</entry>
  1863. <entry>board or device</entry>
  1864. </row>
  1865. <row>
  1866. <entry>IbcEOSchar</entry>
  1867. <entry>0xf</entry>
  1868. <entry>Sets the end-of-string byte.
  1869. See <link LINKEND="reference-function-ibeos">ibeos()</link>.
  1870. </entry>
  1871. <entry>board or device</entry>
  1872. </row>
  1873. <row>
  1874. <entry>IbcPP2</entry>
  1875. <entry>0x10</entry>
  1876. <entry>If setting is nonzero then the board is put into
  1877. local parallel poll configure mode, and will not change
  1878. its parallel poll configuration in response to receiving
  1879. 'parallel poll enable' command bytes from the controller-in-charge.
  1880. Otherwise the board is put in remote parallel poll configure mode.
  1881. Some older hardware does not support local parallel poll
  1882. configure mode.
  1883. </entry>
  1884. <entry>board</entry>
  1885. </row>
  1886. <row>
  1887. <entry>IbcTIMING</entry>
  1888. <entry>0x11</entry>
  1889. <entry>Sets the T1 delay. Use setting of 1 for 2 microseconds, 2 for 500
  1890. nanoseconds, or 3 for 350 nanoseconds. These values are declared in
  1891. the header files as the constants T1_DELAY_2000ns, T1_DELAY_500ns,
  1892. and T1_DELAY_350ns. A 2 microsecond T1 delay is safest, but
  1893. will limit maximum transfer speeds to a few hundred kilobytes
  1894. per second.
  1895. </entry>
  1896. <entry>board</entry>
  1897. </row>
  1898. <row>
  1899. <entry>IbcReadAdjust</entry>
  1900. <entry>0x13</entry>
  1901. <entry>If setting is nonzero then byte pairs are automatically swapped
  1902. during reads. Presently, this feature is unimplemented.
  1903. </entry>
  1904. <entry>board or device</entry>
  1905. </row>
  1906. <row>
  1907. <entry>IbcWriteAdjust</entry>
  1908. <entry>0x14</entry>
  1909. <entry>If setting is nonzero then byte pairs are automatically swapped
  1910. during writes. Presently, this feature is unimplemented.
  1911. </entry>
  1912. <entry>board or device</entry>
  1913. </row>
  1914. <row>
  1915. <entry>IbcEventQueue</entry>
  1916. <entry>0x15</entry>
  1917. <entry>If setting is nonzero then the event queue is enabled. The
  1918. event queue is disabled by default.</entry>
  1919. <entry>board</entry>
  1920. </row>
  1921. <row>
  1922. <entry>IbcSPollBit</entry>
  1923. <entry>0x16</entry>
  1924. <entry>If the setting is nonzero then the use of the SPOLL bit in ibsta is enabled.
  1925. </entry>
  1926. <entry>board</entry>
  1927. </row>
  1928. <row>
  1929. <entry>IbcSendLLO</entry>
  1930. <entry>0x17</entry>
  1931. <entry>If the setting is nonzero then devices connected to this board are automatically
  1932. put into local lockout
  1933. mode when brought online with ibfind() or ibdev().</entry>
  1934. <entry>board</entry>
  1935. </row>
  1936. <row>
  1937. <entry>IbcSPollTime</entry>
  1938. <entry>0x18</entry>
  1939. <entry>Sets timeout for serial polls. The setting must be
  1940. between 0 and 17, which correspond to the same time periods as in
  1941. <link LINKEND="reference-function-ibtmo">ibtmo()</link>.
  1942. </entry>
  1943. <entry>device</entry>
  1944. </row>
  1945. <row>
  1946. <entry>IbcPPollTime</entry>
  1947. <entry>0x18</entry>
  1948. <entry>Sets timeout for parallel polls. The setting must be
  1949. between 0 and 17, which correspond to the same time periods as in
  1950. <link LINKEND="reference-function-ibtmo">ibtmo()</link>.
  1951. </entry>
  1952. <entry>board</entry>
  1953. </row>
  1954. <row>
  1955. <entry>IbcEndBitIsNormal</entry>
  1956. <entry>0x1a</entry>
  1957. <entry>If setting is nonzero then the END bit of ibsta is set on
  1958. reception of the end-of-string character or EOI (default). Otherwise
  1959. END bit is only set on EOI.</entry>
  1960. <entry>board or device</entry>
  1961. </row>
  1962. <row>
  1963. <entry>IbcUnAddr</entry>
  1964. <entry>0x1b</entry>
  1965. <entry>If setting is nonzero then UNT (untalk) and UNL (unlisten) commands
  1966. are automatically sent after a completed io operation using this descriptor.
  1967. This option is off by default.</entry>
  1968. <entry>device</entry>
  1969. </row>
  1970. <row>
  1971. <entry>IbcHSCableLength</entry>
  1972. <entry>0x1f</entry>
  1973. <entry>Useless, included only for compatibility.</entry>
  1974. <entry>board</entry>
  1975. </row>
  1976. <row>
  1977. <entry>IbcIst</entry>
  1978. <entry>0x20</entry>
  1979. <entry>Sets the individual status bit, a.k.a. 'ist'. Same
  1980. as <link LINKEND="reference-function-ibist">ibist()</link>.
  1981. </entry>
  1982. <entry>board</entry>
  1983. </row>
  1984. <row>
  1985. <entry>IbcRsv</entry>
  1986. <entry>0x21</entry>
  1987. <entry>Sets the current status byte this board will use to respond to
  1988. serial polls. Same as <link LINKEND="reference-function-ibrsv">ibrsv()</link>.
  1989. </entry>
  1990. <entry>board</entry>
  1991. </row>
  1992. <row>
  1993. <entry>IbcBNA</entry>
  1994. <entry>0x200</entry>
  1995. <entry>Changes the GPIB interface board used to access a device. The
  1996. setting specifies the board index of the new access board. This configuration
  1997. option is similar to <link LINKEND="reference-function-ibbna">ibbna()</link>
  1998. except the new board is specified by its board index instead of a name.
  1999. </entry>
  2000. <entry>device</entry>
  2001. </row>
  2002. </tbody>
  2003. </tgroup>
  2004. </table>
  2005. </para>
  2006. </refsect1>
  2007. <refsect1>
  2008. <title>
  2009. Return value
  2010. </title>
  2011. <para>
  2012. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2013. </para>
  2014. </refsect1>
  2015. </refentry>
  2016. <refentry ID="reference-function-ibdev">
  2017. <refmeta>
  2018. <refentrytitle>ibdev</refentrytitle>
  2019. <manvolnum>3</manvolnum>
  2020. </refmeta>
  2021. <refnamediv>
  2022. <refname>ibdev</refname>
  2023. <refpurpose>open a device (device)</refpurpose>
  2024. </refnamediv>
  2025. <refsynopsisdiv>
  2026. <funcsynopsis>
  2027. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2028. <funcprototype>
  2029. <funcdef>int <function>ibdev</function></funcdef>
  2030. <paramdef>int <parameter>board_index</parameter></paramdef>
  2031. <paramdef>int <parameter>pad</parameter></paramdef>
  2032. <paramdef>int <parameter>sad</parameter></paramdef>
  2033. <paramdef>int <parameter>timeout</parameter></paramdef>
  2034. <paramdef>int <parameter>send_eoi</parameter></paramdef>
  2035. <paramdef>int <parameter>eos</parameter></paramdef>
  2036. </funcprototype>
  2037. </funcsynopsis>
  2038. </refsynopsisdiv>
  2039. <refsect1>
  2040. <title>
  2041. Description
  2042. </title>
  2043. <para>
  2044. ibdev() is used to obtain a device descriptor, which can then be used by
  2045. other functions in the library. The argument <parameter>board_index</parameter>
  2046. specifies which GPIB interface board the device is connected to.
  2047. The <parameter>pad</parameter> and <parameter>sad</parameter> arguments specify
  2048. the GPIB address of the device to be opened (see <link LINKEND="reference-function-ibpad">
  2049. ibpad()</link> and <link LINKEND="reference-function-ibsad">ibsad()</link>).
  2050. The timeout for io operations is specified by <parameter> timeout </parameter>
  2051. (see <link LINKEND="reference-function-ibtmo">ibtmo()</link>). If
  2052. <parameter>send_eoi</parameter> is nonzero, then the EOI
  2053. line will be asserted with the last byte sent during writes (see
  2054. <link LINKEND="reference-function-ibeot">ibeot()</link>).
  2055. Finally, the <parameter>eos</parameter>
  2056. argument specifies the end-of-string character and whether or not its
  2057. reception should terminate reads (see <link LINKEND="reference-function-ibeos">
  2058. ibeos()</link>).
  2059. </para>
  2060. </refsect1>
  2061. <refsect1>
  2062. <title>
  2063. Return value
  2064. </title>
  2065. <para>
  2066. If sucessful, returns a (non-negative) device descriptor. On failure, -1 is returned.
  2067. </para>
  2068. </refsect1>
  2069. </refentry>
  2070. <refentry ID="reference-function-ibeos">
  2071. <refmeta>
  2072. <refentrytitle>ibeos</refentrytitle>
  2073. <manvolnum>3</manvolnum>
  2074. </refmeta>
  2075. <refnamediv>
  2076. <refname>ibeos</refname>
  2077. <refpurpose>set end-of-string mode (board or device)</refpurpose>
  2078. </refnamediv>
  2079. <refsynopsisdiv>
  2080. <funcsynopsis>
  2081. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2082. <funcprototype>
  2083. <funcdef>int <function>ibeos</function></funcdef>
  2084. <paramdef>int <parameter>ud</parameter></paramdef>
  2085. <paramdef>int <parameter>eosmode</parameter></paramdef>
  2086. </funcprototype>
  2087. </funcsynopsis>
  2088. </refsynopsisdiv>
  2089. <refsect1>
  2090. <title>
  2091. Description
  2092. </title>
  2093. <para>
  2094. ibeos() is used to set the end-of-string character and mode. The least
  2095. significant 8 bits of <parameter>eosmode</parameter> specify the
  2096. eos character. You may also bitwise-or one or more of the following
  2097. bits to set the eos mode:
  2098. </para>
  2099. <para>
  2100. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="1">
  2101. <title>End-of-String Mode Bits</title>
  2102. <tgroup COLS="3" ALIGN="left" >
  2103. <thead>
  2104. <row>
  2105. <entry>constant</entry>
  2106. <entry>value (hexadecimal)</entry>
  2107. <entry>meaning</entry>
  2108. </row>
  2109. </thead>
  2110. <tbody>
  2111. <row>
  2112. <entry>REOS</entry>
  2113. <entry>0x400</entry>
  2114. <entry>Enable termination of reads when eos character is received.</entry>
  2115. </row>
  2116. <row>
  2117. <entry>XEOS</entry>
  2118. <entry>0x800</entry>
  2119. <entry>Assert the EOI line whenever the eos character is sent during writes.</entry>
  2120. </row>
  2121. <row>
  2122. <entry>BIN</entry>
  2123. <entry>0x1000</entry>
  2124. <entry>Match eos character using all 8 bits (instead of only looking at
  2125. the 7 least significant bits).</entry>
  2126. </row>
  2127. </tbody>
  2128. </tgroup>
  2129. </table>
  2130. </para>
  2131. </refsect1>
  2132. <refsect1>
  2133. <title>
  2134. Return value
  2135. </title>
  2136. <para>
  2137. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2138. </para>
  2139. </refsect1>
  2140. </refentry>
  2141. <refentry ID="reference-function-ibeot">
  2142. <refmeta>
  2143. <refentrytitle>ibeot</refentrytitle>
  2144. <manvolnum>3</manvolnum>
  2145. </refmeta>
  2146. <refnamediv>
  2147. <refname>ibeot</refname>
  2148. <refpurpose>assert EOI with last data byte (board or device)</refpurpose>
  2149. </refnamediv>
  2150. <refsynopsisdiv>
  2151. <funcsynopsis>
  2152. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2153. <funcprototype>
  2154. <funcdef>int <function>ibeot</function></funcdef>
  2155. <paramdef>int <parameter>ud</parameter></paramdef>
  2156. <paramdef>int <parameter>send_eoi</parameter></paramdef>
  2157. </funcprototype>
  2158. </funcsynopsis>
  2159. </refsynopsisdiv>
  2160. <refsect1>
  2161. <title>
  2162. Description
  2163. </title>
  2164. <para>
  2165. If <parameter>send_eoi</parameter> is non-zero, then the EOI
  2166. line will be asserted with the last byte sent by
  2167. calls to <link LINKEND="reference-function-ibwrt">ibwrt()</link>
  2168. and related functions.
  2169. </para>
  2170. </refsect1>
  2171. <refsect1>
  2172. <title>
  2173. Return value
  2174. </title>
  2175. <para>
  2176. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2177. </para>
  2178. </refsect1>
  2179. </refentry>
  2180. <refentry ID="reference-function-ibevent">
  2181. <refmeta>
  2182. <refentrytitle>ibevent</refentrytitle>
  2183. <manvolnum>3</manvolnum>
  2184. </refmeta>
  2185. <refnamediv>
  2186. <refname>ibevent</refname>
  2187. <refpurpose>get events from event queue (board)</refpurpose>
  2188. </refnamediv>
  2189. <refsynopsisdiv>
  2190. <funcsynopsis>
  2191. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2192. <funcprototype>
  2193. <funcdef>int <function>ibevent</function></funcdef>
  2194. <paramdef>int <parameter>ud</parameter></paramdef>
  2195. <paramdef>short *<parameter>event</parameter></paramdef>
  2196. </funcprototype>
  2197. </funcsynopsis>
  2198. </refsynopsisdiv>
  2199. <refsect1>
  2200. <title>
  2201. Description
  2202. </title>
  2203. <para>
  2204. ibevent() is used to obtain the oldest event stored in the event
  2205. queue of the board specified by the board descriptor
  2206. <parameter>ud</parameter>. The EVENT bit of
  2207. <link LINKEND="reference-globals-ibsta">ibsta</link> indicates
  2208. that the event queue contains 1 or more events.
  2209. An event may be a clear command, a trigger command, or reception
  2210. of an interface clear. The type of event is stored in the location
  2211. specified by <parameter>event</parameter> and may be set to any of the
  2212. following values:
  2213. </para>
  2214. <para>
  2215. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="0">
  2216. <title>events</title>
  2217. <tgroup COLS="3" ALIGN="left" >
  2218. <thead>
  2219. <row>
  2220. <entry>constant</entry>
  2221. <entry>value</entry>
  2222. <entry>description</entry>
  2223. </row>
  2224. </thead>
  2225. <tbody>
  2226. <row>
  2227. <entry>EventNone</entry>
  2228. <entry>0</entry>
  2229. <entry>The board's event queue is empty</entry>
  2230. </row>
  2231. <row>
  2232. <entry>EventDevTrg</entry>
  2233. <entry>1</entry>
  2234. <entry>The board has received a trigger command from the controller-in-charge.</entry>
  2235. </row>
  2236. <row>
  2237. <entry>EventDevClr</entry>
  2238. <entry>2</entry>
  2239. <entry>The board has received a clear command from the controller-in-charge.</entry>
  2240. </row>
  2241. <row>
  2242. <entry>EventIFC</entry>
  2243. <entry>3</entry>
  2244. <entry>The board has received an interface clear from the system controller.
  2245. Note, some models of GPIB interface board lack the ability to report interface
  2246. clear events.</entry>
  2247. </row>
  2248. </tbody>
  2249. </tgroup>
  2250. </table>
  2251. </para>
  2252. <para>
  2253. The event queue is disabled by default. It may be enabled by a call to
  2254. <link LINKEND="reference-function-ibconfig">ibconfig()</link>.
  2255. Each interface board has a single event queue which is shared across
  2256. all processes and threads. So, only one process can retrieve any given event
  2257. from the queue. Also, the queue is of finite size so events may be lost
  2258. (ibevent() will return an error) if it is neglected too long.
  2259. </para>
  2260. </refsect1>
  2261. <refsect1>
  2262. <title>
  2263. Return value
  2264. </title>
  2265. <para>
  2266. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2267. </para>
  2268. </refsect1>
  2269. </refentry>
  2270. <refentry ID="reference-function-ibfind">
  2271. <refmeta>
  2272. <refentrytitle>ibfind</refentrytitle>
  2273. <manvolnum>3</manvolnum>
  2274. </refmeta>
  2275. <refnamediv>
  2276. <refname>ibfind</refname>
  2277. <refpurpose>open a board or device (board or device)</refpurpose>
  2278. </refnamediv>
  2279. <refsynopsisdiv>
  2280. <funcsynopsis>
  2281. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2282. <funcprototype>
  2283. <funcdef>int <function>ibfind</function></funcdef>
  2284. <paramdef>const char *<parameter>name</parameter></paramdef>
  2285. </funcprototype>
  2286. </funcsynopsis>
  2287. </refsynopsisdiv>
  2288. <refsect1>
  2289. <title>
  2290. Description
  2291. </title>
  2292. <para>
  2293. ibfind() returns a board or device descriptor based on the information
  2294. found in the <link LINKEND="configuration">configuration file</link>.
  2295. It is not required to use this function, since device descriptors
  2296. can be obtained with <link LINKEND="reference-function-ibdev">ibdev()</link>
  2297. and the 'board index' (minor number in the configuration file)
  2298. can be used directly as a board descriptor.
  2299. </para>
  2300. </refsect1>
  2301. <refsect1>
  2302. <title>
  2303. Return value
  2304. </title>
  2305. <para>
  2306. If sucessful, returns a (non-negative) board or device descriptor.
  2307. On failure, -1 is returned.
  2308. </para>
  2309. </refsect1>
  2310. </refentry>
  2311. <refentry ID="reference-function-ibgts">
  2312. <refmeta>
  2313. <refentrytitle>ibgts</refentrytitle>
  2314. <manvolnum>3</manvolnum>
  2315. </refmeta>
  2316. <refnamediv>
  2317. <refname>ibgts</refname>
  2318. <refpurpose>release ATN (board)</refpurpose>
  2319. </refnamediv>
  2320. <refsynopsisdiv>
  2321. <funcsynopsis>
  2322. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2323. <funcprototype>
  2324. <funcdef>int <function>ibgts</function></funcdef>
  2325. <paramdef>int <parameter>ud</parameter></paramdef>
  2326. <paramdef>int <parameter>shadow_handshake</parameter></paramdef>
  2327. </funcprototype>
  2328. </funcsynopsis>
  2329. </refsynopsisdiv>
  2330. <refsect1>
  2331. <title>
  2332. Description
  2333. </title>
  2334. <para>
  2335. ibgts() is the complement of <link LINKEND="reference-function-ibcac">ibcac()</link>,
  2336. and causes the board specified by the board descriptor <parameter>ud</parameter>
  2337. to go to standby by releasing the ATN line.
  2338. The board must be controller-in-change to change the state of the ATN line.
  2339. If <parameter>shadow_handshake</parameter> is nonzero, then
  2340. the board will handshake any data
  2341. bytes it receives until it encounters an EOI or end-of-string character,
  2342. or the ATN line is asserted again. The received data is discarded.
  2343. </para>
  2344. <para>
  2345. It is generally not necessary to call ibgts(). It is provided
  2346. for advanced users who want direct, low-level access to the GPIB bus.
  2347. </para>
  2348. </refsect1>
  2349. <refsect1>
  2350. <title>
  2351. Return value
  2352. </title>
  2353. <para>
  2354. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2355. </para>
  2356. </refsect1>
  2357. </refentry>
  2358. <refentry ID="reference-function-ibist">
  2359. <refmeta>
  2360. <refentrytitle>ibist</refentrytitle>
  2361. <manvolnum>3</manvolnum>
  2362. </refmeta>
  2363. <refnamediv>
  2364. <refname>ibist</refname>
  2365. <refpurpose>set individual status bit (board)</refpurpose>
  2366. </refnamediv>
  2367. <refsynopsisdiv>
  2368. <funcsynopsis>
  2369. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2370. <funcprototype>
  2371. <funcdef>int <function>ibist</function></funcdef>
  2372. <paramdef>int <parameter>ud</parameter></paramdef>
  2373. <paramdef>int <parameter>ist</parameter></paramdef>
  2374. </funcprototype>
  2375. </funcsynopsis>
  2376. </refsynopsisdiv>
  2377. <refsect1>
  2378. <title>
  2379. Description
  2380. </title>
  2381. <para>
  2382. If <parameter>ist</parameter> is nonzero, then the individual status bit
  2383. of the board specified by the board descriptor <parameter>ud</parameter>
  2384. is set. If <parameter>ist</parameter> is zero then the individual status
  2385. bit is cleared. The individual status bit is sent by the board in response
  2386. to parallel polls.
  2387. </para>
  2388. <para>
  2389. On success, <link LINKEND="reference-globals-iberr">iberr</link> is set
  2390. to the previous ist value.
  2391. </para>
  2392. </refsect1>
  2393. <refsect1>
  2394. <title>
  2395. Return value
  2396. </title>
  2397. <para>
  2398. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2399. </para>
  2400. </refsect1>
  2401. </refentry>
  2402. <refentry ID="reference-function-iblines">
  2403. <refmeta>
  2404. <refentrytitle>iblines</refentrytitle>
  2405. <manvolnum>3</manvolnum>
  2406. </refmeta>
  2407. <refnamediv>
  2408. <refname>iblines</refname>
  2409. <refpurpose>monitor bus lines (board)</refpurpose>
  2410. </refnamediv>
  2411. <refsynopsisdiv>
  2412. <funcsynopsis>
  2413. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2414. <funcprototype>
  2415. <funcdef>int <function>iblines</function></funcdef>
  2416. <paramdef>int <parameter>ud</parameter></paramdef>
  2417. <paramdef>short *<parameter>line_status</parameter></paramdef>
  2418. </funcprototype>
  2419. </funcsynopsis>
  2420. </refsynopsisdiv>
  2421. <refsect1>
  2422. <title>
  2423. Description
  2424. </title>
  2425. <para>
  2426. iblines() is used to obtain the status of the control and
  2427. handshaking <link LINKEND="gpib-protocol-bus-lines">bus lines</link> of the
  2428. bus. The board used to monitor the bus
  2429. is specified by the <parameter>ud</parameter> argument,
  2430. and the status of the various bus lines are written to
  2431. the location specified by <parameter>line_status</parameter>.
  2432. </para>
  2433. <para>
  2434. Some older chips are not capable of reporting the status
  2435. of the bus lines, so each line has two corresponding bits in
  2436. <parameter>line_status</parameter>. One bit indicates if
  2437. the board can monitor the line, and the other bit indicates
  2438. the line's state.
  2439. The meaning of the <parameter>line_status</parameter> bits are
  2440. as follows:
  2441. </para>
  2442. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="0">
  2443. <title>line status bits</title>
  2444. <tgroup COLS="3" ALIGN="left" >
  2445. <thead>
  2446. <row>
  2447. <entry>constant</entry>
  2448. <entry>value</entry>
  2449. <entry>description</entry>
  2450. </row>
  2451. </thead>
  2452. <tbody>
  2453. <row>
  2454. <entry>ValidDAV</entry>
  2455. <entry>0x1</entry>
  2456. <entry>The BusDAV bit is valid.</entry>
  2457. </row>
  2458. <row>
  2459. <entry>ValidNDAC</entry>
  2460. <entry>0x2</entry>
  2461. <entry>The BusNDAC bit is valid.</entry>
  2462. </row>
  2463. <row>
  2464. <entry>ValidNRFD</entry>
  2465. <entry>0x4</entry>
  2466. <entry>The BusNRFD bit is valid.</entry>
  2467. </row>
  2468. <row>
  2469. <entry>ValidIFC</entry>
  2470. <entry>0x8</entry>
  2471. <entry>The BusIFC bit is valid.</entry>
  2472. </row>
  2473. <row>
  2474. <entry>ValidREN</entry>
  2475. <entry>0x10</entry>
  2476. <entry>The BusREN bit is valid.</entry>
  2477. </row>
  2478. <row>
  2479. <entry>ValidSRQ</entry>
  2480. <entry>0x20</entry>
  2481. <entry>The BusSRQ bit is valid.</entry>
  2482. </row>
  2483. <row>
  2484. <entry>ValidATN</entry>
  2485. <entry>0x40</entry>
  2486. <entry>The BusATN bit is valid.</entry>
  2487. </row>
  2488. <row>
  2489. <entry>ValidEOI</entry>
  2490. <entry>0x80</entry>
  2491. <entry>The BusEOI bit is valid.</entry>
  2492. </row>
  2493. <row>
  2494. <entry>BusDAV</entry>
  2495. <entry>0x100</entry>
  2496. <entry>Set/cleared if the DAV line is asserted/unasserted.</entry>
  2497. </row>
  2498. <row>
  2499. <entry>BusNDAC</entry>
  2500. <entry>0x200</entry>
  2501. <entry>Set/cleared if the NDAC line is asserted/unasserted.</entry>
  2502. </row>
  2503. <row>
  2504. <entry>BusNRFD</entry>
  2505. <entry>0x400</entry>
  2506. <entry>Set/cleared if the NRFD line is asserted/unasserted.</entry>
  2507. </row>
  2508. <row>
  2509. <entry>BusIFC</entry>
  2510. <entry>0x800</entry>
  2511. <entry>Set/cleared if the IFC line is asserted/unasserted.</entry>
  2512. </row>
  2513. <row>
  2514. <entry>BusREN</entry>
  2515. <entry>0x1000</entry>
  2516. <entry>Set/cleared if the REN line is asserted/unasserted.</entry>
  2517. </row>
  2518. <row>
  2519. <entry>BusSRQ</entry>
  2520. <entry>0x2000</entry>
  2521. <entry>Set/cleared if the SRQ line is asserted/unasserted.</entry>
  2522. </row>
  2523. <row>
  2524. <entry>BusATN</entry>
  2525. <entry>0x4000</entry>
  2526. <entry>Set/cleared if the ATN line is asserted/unasserted.</entry>
  2527. </row>
  2528. <row>
  2529. <entry>BusEOI</entry>
  2530. <entry>0x8000</entry>
  2531. <entry>Set/cleared if the EOI line is asserted/unasserted.</entry>
  2532. </row>
  2533. </tbody>
  2534. </tgroup>
  2535. </table>
  2536. <para>
  2537. </para>
  2538. </refsect1>
  2539. <refsect1>
  2540. <title>
  2541. Return value
  2542. </title>
  2543. <para>
  2544. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2545. </para>
  2546. </refsect1>
  2547. </refentry>
  2548. <refentry ID="reference-function-ibln">
  2549. <refmeta>
  2550. <refentrytitle>ibln</refentrytitle>
  2551. <manvolnum>3</manvolnum>
  2552. </refmeta>
  2553. <refnamediv>
  2554. <refname>ibln</refname>
  2555. <refpurpose>check if listener is present (board or device)</refpurpose>
  2556. </refnamediv>
  2557. <refsynopsisdiv>
  2558. <funcsynopsis>
  2559. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2560. <funcprototype>
  2561. <funcdef>int <function>ibln</function></funcdef>
  2562. <paramdef>int <parameter>ud</parameter></paramdef>
  2563. <paramdef>int <parameter>pad</parameter></paramdef>
  2564. <paramdef>int <parameter>sad</parameter></paramdef>
  2565. <paramdef>short *<parameter>found_listener</parameter></paramdef>
  2566. </funcprototype>
  2567. </funcsynopsis>
  2568. </refsynopsisdiv>
  2569. <refsect1>
  2570. <title>
  2571. Description
  2572. </title>
  2573. <para>
  2574. ibln() checks for the presence of a device, by attempting to address
  2575. it as a listener. <parameter>ud</parameter> specifies the GPIB
  2576. interface board which should check for listeners. If <parameter>ud</parameter>
  2577. is a device descriptor, then the device's access board is used.
  2578. </para>
  2579. <para>
  2580. The GPIB address to check is specified by the
  2581. <parameter>pad</parameter> and <parameter>sad</parameter> arguments.
  2582. <parameter>pad</parameter> specifies the primary address, 0 through 30
  2583. are valid values. <parameter>sad</parameter> gives the secondary
  2584. address, and may be a value from 0x60 through 0x7e (96 through 126), or
  2585. one of the constants NO_SAD or ALL_SAD. NO_SAD indicates that no
  2586. secondary addressing is to be used, and ALL_SAD indicates that
  2587. all secondary addresses should be checked.
  2588. </para>
  2589. <para>
  2590. If the board finds a listener at the specified GPIB address(es), then the
  2591. variable specified by the pointer <parameter>found_listener</parameter>
  2592. is set to a nonzero value. If no listener is found, the variable is set
  2593. to zero.
  2594. </para>
  2595. <para>
  2596. The board must be controller-in-charge to perform this function. Also,
  2597. it must have the capability to monitor the NDAC
  2598. <link LINKEND="gpib-protocol-bus-lines">bus line</link>
  2599. (see <link LINKEND="reference-function-iblines">iblines()</link>).
  2600. </para>
  2601. </refsect1>
  2602. <refsect1>
  2603. <title>
  2604. Return value
  2605. </title>
  2606. <para>
  2607. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2608. </para>
  2609. </refsect1>
  2610. </refentry>
  2611. <refentry ID="reference-function-ibloc">
  2612. <refmeta>
  2613. <refentrytitle>ibloc</refentrytitle>
  2614. <manvolnum>3</manvolnum>
  2615. </refmeta>
  2616. <refnamediv>
  2617. <refname>ibloc</refname>
  2618. <refpurpose>go to local mode (board or device)</refpurpose>
  2619. </refnamediv>
  2620. <refsynopsisdiv>
  2621. <funcsynopsis>
  2622. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2623. <funcprototype>
  2624. <funcdef>int <function>ibloc</function></funcdef>
  2625. <paramdef>int <parameter>ud</parameter></paramdef>
  2626. </funcprototype>
  2627. </funcsynopsis>
  2628. </refsynopsisdiv>
  2629. <refsect1>
  2630. <title>
  2631. Description
  2632. </title>
  2633. <para>
  2634. Causes the board or device specified by the descriptor <parameter>ud</parameter>
  2635. to go to local mode. If <parameter>ud</parameter> is a board descriptor,
  2636. and the board is in local lockout, then the function will fail.
  2637. </para>
  2638. <para>
  2639. Note, if the system controller is asserting the REN line, then devices on
  2640. the bus will
  2641. return to remote mode the next time they are addressed by the controller
  2642. in charge.
  2643. </para>
  2644. </refsect1>
  2645. <refsect1>
  2646. <title>
  2647. Return value
  2648. </title>
  2649. <para>
  2650. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2651. </para>
  2652. </refsect1>
  2653. </refentry>
  2654. <refentry ID="reference-function-ibonl">
  2655. <refmeta>
  2656. <refentrytitle>ibonl</refentrytitle>
  2657. <manvolnum>3</manvolnum>
  2658. </refmeta>
  2659. <refnamediv>
  2660. <refname>ibonl</refname>
  2661. <refpurpose>close or reinitialize descriptor (board or device)</refpurpose>
  2662. </refnamediv>
  2663. <refsynopsisdiv>
  2664. <funcsynopsis>
  2665. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2666. <funcprototype>
  2667. <funcdef>int <function>ibonl</function></funcdef>
  2668. <paramdef>int <parameter>ud</parameter></paramdef>
  2669. <paramdef>int <parameter>online</parameter></paramdef>
  2670. </funcprototype>
  2671. </funcsynopsis>
  2672. </refsynopsisdiv>
  2673. <refsect1>
  2674. <title>
  2675. Description
  2676. </title>
  2677. <para>
  2678. If the <parameter>online</parameter> is zero, then ibonl() frees the
  2679. resources associated with the board or device descriptor
  2680. <parameter>ud</parameter>. The descriptor cannot be used again after the
  2681. ibonl() call.
  2682. </para>
  2683. <para>
  2684. If the <parameter>online</parameter> is nonzero, then all the settings
  2685. associated with the descriptor (GPIB address, end-of-string mode, timeout,
  2686. etc.) are reset to their 'default' values. The 'default' values are
  2687. the settings the descriptor had when it was first obtained with
  2688. <link LINKEND="reference-function-ibdev">ibdev()</link> or
  2689. <link LINKEND="reference-function-ibfind">ibfind()</link>.
  2690. </para>
  2691. </refsect1>
  2692. <refsect1>
  2693. <title>
  2694. Return value
  2695. </title>
  2696. <para>
  2697. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2698. </para>
  2699. </refsect1>
  2700. </refentry>
  2701. <refentry ID="reference-function-ibpad">
  2702. <refmeta>
  2703. <refentrytitle>ibpad</refentrytitle>
  2704. <manvolnum>3</manvolnum>
  2705. </refmeta>
  2706. <refnamediv>
  2707. <refname>ibpad</refname>
  2708. <refpurpose>set primary GPIB address (board or device)</refpurpose>
  2709. </refnamediv>
  2710. <refsynopsisdiv>
  2711. <funcsynopsis>
  2712. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2713. <funcprototype>
  2714. <funcdef>int <function>ibpad</function></funcdef>
  2715. <paramdef>int <parameter>ud</parameter></paramdef>
  2716. <paramdef>int <parameter>pad</parameter></paramdef>
  2717. </funcprototype>
  2718. </funcsynopsis>
  2719. </refsynopsisdiv>
  2720. <refsect1>
  2721. <title>
  2722. Description
  2723. </title>
  2724. <para>
  2725. ibpad() sets the GPIB primary address to <parameter>pad</parameter>
  2726. for the device or board specified by the descriptor <parameter>ud</parameter>.
  2727. If <parameter>ud</parameter> is a device descriptor, then the setting is
  2728. local to the descriptor (it does not affect the behaviour of calls using
  2729. other descriptors, even if they refer to the same physical device). If
  2730. <parameter>ud</parameter> is a board descriptor, then the board's
  2731. primary address is changed immediately, which is a global change affecting
  2732. anything (even other processes) using the board. Valid GPIB primary
  2733. addresses are in the range from 0 to 30.
  2734. </para>
  2735. </refsect1>
  2736. <refsect1>
  2737. <title>
  2738. Return value
  2739. </title>
  2740. <para>
  2741. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2742. </para>
  2743. </refsect1>
  2744. </refentry>
  2745. <refentry ID="reference-function-ibpct">
  2746. <refmeta>
  2747. <refentrytitle>ibpct</refentrytitle>
  2748. <manvolnum>3</manvolnum>
  2749. </refmeta>
  2750. <refnamediv>
  2751. <refname>ibpct</refname>
  2752. <refpurpose>pass control (board)</refpurpose>
  2753. </refnamediv>
  2754. <refsynopsisdiv>
  2755. <funcsynopsis>
  2756. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2757. <funcprototype>
  2758. <funcdef>int <function>ibpct</function></funcdef>
  2759. <paramdef>int <parameter>ud</parameter></paramdef>
  2760. </funcprototype>
  2761. </funcsynopsis>
  2762. </refsynopsisdiv>
  2763. <refsect1>
  2764. <title>
  2765. Description
  2766. </title>
  2767. <para>
  2768. ibpct() passes control to the device specified by the device
  2769. descriptor <parameter>ud</parameter>. The device becomes
  2770. the new controller-in-charge.
  2771. </para>
  2772. </refsect1>
  2773. <refsect1>
  2774. <title>
  2775. Return value
  2776. </title>
  2777. <para>
  2778. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2779. </para>
  2780. </refsect1>
  2781. </refentry>
  2782. <refentry ID="reference-function-ibppc">
  2783. <refmeta>
  2784. <refentrytitle>ibppc</refentrytitle>
  2785. <manvolnum>3</manvolnum>
  2786. </refmeta>
  2787. <refnamediv>
  2788. <refname>ibppc</refname>
  2789. <refpurpose>parallel poll configure (board or device)</refpurpose>
  2790. </refnamediv>
  2791. <refsynopsisdiv>
  2792. <funcsynopsis>
  2793. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2794. <funcprototype>
  2795. <funcdef>int <function>ibppc</function></funcdef>
  2796. <paramdef>int <parameter>ud</parameter></paramdef>
  2797. <paramdef>int <parameter>configuration</parameter></paramdef>
  2798. </funcprototype>
  2799. </funcsynopsis>
  2800. </refsynopsisdiv>
  2801. <refsect1>
  2802. <title>
  2803. Description
  2804. </title>
  2805. <para>
  2806. Configures the parallel poll response of the device or board specified
  2807. by <parameter>ud</parameter>. The <parameter>configuration</parameter>
  2808. should either be set to the 'PPD' constant to disable parallel poll
  2809. responses, or set to the return value of the
  2810. <link LINKEND="reference-function-ppe-byte">PPE_byte()</link> inline
  2811. function to enable and
  2812. configure the parallel poll response.
  2813. </para>
  2814. <para>
  2815. After configuring the parallel poll response of devices on a bus,
  2816. you may use
  2817. <link LINKEND="reference-function-ibrpp">ibrpp()</link> to
  2818. parallel poll the devices.
  2819. </para>
  2820. </refsect1>
  2821. <refsect1>
  2822. <title>
  2823. Return value
  2824. </title>
  2825. <para>
  2826. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2827. </para>
  2828. </refsect1>
  2829. </refentry>
  2830. <refentry ID="reference-function-ibrd">
  2831. <refmeta>
  2832. <refentrytitle>ibrd</refentrytitle>
  2833. <manvolnum>3</manvolnum>
  2834. </refmeta>
  2835. <refnamediv>
  2836. <refname>ibrd</refname>
  2837. <refpurpose>read data bytes (board or device)</refpurpose>
  2838. </refnamediv>
  2839. <refsynopsisdiv>
  2840. <funcsynopsis>
  2841. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2842. <funcprototype>
  2843. <funcdef>int <function>ibrd</function></funcdef>
  2844. <paramdef>int <parameter>ud</parameter></paramdef>
  2845. <paramdef>void *<parameter>buffer</parameter></paramdef>
  2846. <paramdef>long <parameter>num_bytes</parameter></paramdef>
  2847. </funcprototype>
  2848. </funcsynopsis>
  2849. </refsynopsisdiv>
  2850. <refsect1>
  2851. <title>
  2852. Description
  2853. </title>
  2854. <para>
  2855. ibrd() is used to read data bytes from a device or board. The argument
  2856. <parameter>ud</parameter> can be either a device or board descriptor.
  2857. Up to
  2858. <parameter>num_bytes</parameter> bytes
  2859. are read into the user-supplied array <parameter>buffer</parameter>.
  2860. The read may be terminated by a
  2861. timeout occuring(see <link LINKEND="reference-function-ibtmo">ibtmo()</link>),
  2862. the talker asserting the EOI line, the board receiving the
  2863. end-of-string character (see
  2864. <link LINKEND="reference-function-ibeos">ibeos()</link>), receiving a device
  2865. clear command, or receiving an interface clear.
  2866. </para>
  2867. <para>
  2868. If <parameter>ud</parameter> is a device descriptor, then the library
  2869. automatically handles addressing the device as talker and the interface
  2870. board as listener before performing the read.
  2871. </para>
  2872. <para>
  2873. If <parameter>ud</parameter> is a board descriptor, no addressing
  2874. is performed and the board must be addressed as a listener
  2875. by the controller-in-charge.
  2876. </para>
  2877. <para>
  2878. After the ibrd() call, ibcnt and ibcntl are set to the number of bytes
  2879. read.
  2880. </para>
  2881. </refsect1>
  2882. <refsect1>
  2883. <title>
  2884. Return value
  2885. </title>
  2886. <para>
  2887. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2888. </para>
  2889. </refsect1>
  2890. </refentry>
  2891. <refentry ID="reference-function-ibrda">
  2892. <refmeta>
  2893. <refentrytitle>ibrda</refentrytitle>
  2894. <manvolnum>3</manvolnum>
  2895. </refmeta>
  2896. <refnamediv>
  2897. <refname>ibrda</refname>
  2898. <refpurpose>read data bytes asynchronously (board or device)</refpurpose>
  2899. </refnamediv>
  2900. <refsynopsisdiv>
  2901. <funcsynopsis>
  2902. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2903. <funcprototype>
  2904. <funcdef>int <function>ibrda</function></funcdef>
  2905. <paramdef>int <parameter>ud</parameter></paramdef>
  2906. <paramdef>void *<parameter>buffer</parameter></paramdef>
  2907. <paramdef>long <parameter>num_bytes</parameter></paramdef>
  2908. </funcprototype>
  2909. </funcsynopsis>
  2910. </refsynopsisdiv>
  2911. <refsect1>
  2912. <title>
  2913. Description
  2914. </title>
  2915. <para>
  2916. ibrda() is similar to
  2917. <link LINKEND="reference-function-ibrd">ibrd()</link>
  2918. except it operates asynchronously. ibrda() does not
  2919. wait for the reception of the data bytes to complete, but
  2920. rather returns immediately.
  2921. </para>
  2922. <para>
  2923. While an asynchronous
  2924. operation is in progress, most library functions will
  2925. fail with an EOIP error. In order to sucessfully
  2926. complete an
  2927. asynchronous operation, you must call
  2928. <link LINKEND="reference-function-ibwait">ibwait()</link>
  2929. until the CMPL bit is set ibsta. Asynchronous
  2930. operations
  2931. may also be aborted with an
  2932. <link LINKEND="reference-function-ibstop">ibstop()</link>
  2933. or
  2934. <link LINKEND="reference-function-ibonl">ibonl()</link>
  2935. call.
  2936. </para>
  2937. </refsect1>
  2938. <refsect1>
  2939. <title>
  2940. Return value
  2941. </title>
  2942. <para>
  2943. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2944. </para>
  2945. </refsect1>
  2946. </refentry>
  2947. <refentry ID="reference-function-ibrdf">
  2948. <refmeta>
  2949. <refentrytitle>ibrdf</refentrytitle>
  2950. <manvolnum>3</manvolnum>
  2951. </refmeta>
  2952. <refnamediv>
  2953. <refname>ibrdf</refname>
  2954. <refpurpose>read data bytes to file (board or device)</refpurpose>
  2955. </refnamediv>
  2956. <refsynopsisdiv>
  2957. <funcsynopsis>
  2958. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2959. <funcprototype>
  2960. <funcdef>int <function>ibrdf</function></funcdef>
  2961. <paramdef>int <parameter>ud</parameter></paramdef>
  2962. <paramdef>const char *<parameter>file_path</parameter></paramdef>
  2963. </funcprototype>
  2964. </funcsynopsis>
  2965. </refsynopsisdiv>
  2966. <refsect1>
  2967. <title>
  2968. Description
  2969. </title>
  2970. <para>
  2971. ibrdf() is similar to <link LINKEND="reference-function-ibrd">ibrd()</link>
  2972. except that the data bytes read are stored in a file instead
  2973. of an array in memory. <parameter>file_path</parameter> specifies
  2974. the save file. If the file already exists, the data will be appended
  2975. onto the end of the file.
  2976. </para>
  2977. </refsect1>
  2978. <refsect1>
  2979. <title>
  2980. Return value
  2981. </title>
  2982. <para>
  2983. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  2984. </para>
  2985. </refsect1>
  2986. </refentry>
  2987. <refentry ID="reference-function-ibrpp">
  2988. <refmeta>
  2989. <refentrytitle>ibrpp</refentrytitle>
  2990. <manvolnum>3</manvolnum>
  2991. </refmeta>
  2992. <refnamediv>
  2993. <refname>ibrpp</refname>
  2994. <refpurpose>perform a parallel poll (board or device)</refpurpose>
  2995. </refnamediv>
  2996. <refsynopsisdiv>
  2997. <funcsynopsis>
  2998. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  2999. <funcprototype>
  3000. <funcdef>int <function>ibrpp</function></funcdef>
  3001. <paramdef>int <parameter>ud</parameter></paramdef>
  3002. <paramdef>char *<parameter>ppoll_result</parameter></paramdef>
  3003. </funcprototype>
  3004. </funcsynopsis>
  3005. </refsynopsisdiv>
  3006. <refsect1>
  3007. <title>
  3008. Description
  3009. </title>
  3010. <para>
  3011. ibrpp() causes the interface board to perform a parallel poll, and stores
  3012. the resulting parallel poll byte in the
  3013. location specified by <parameter>ppoll_result</parameter>. Bits 0 to 7
  3014. of the parallel poll byte correspond to the dio lines 1 to 8, with
  3015. a 1 indicating the corresponding dio line is asserted. The devices
  3016. on the bus you wish to poll should be configured beforehand with
  3017. <link LINKEND="reference-function-ibppc">ibppc()</link>. The board
  3018. which performs the parallel poll must be controller-in-charge, and
  3019. is specified by the descriptor <parameter>ud</parameter>.
  3020. If <parameter>ud</parameter> is a device descriptor instead of
  3021. a board descriptor, the device's access board performs the
  3022. parallel poll.
  3023. </para>
  3024. </refsect1>
  3025. <refsect1>
  3026. <title>
  3027. Return value
  3028. </title>
  3029. <para>
  3030. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3031. </para>
  3032. </refsect1>
  3033. </refentry>
  3034. <refentry ID="reference-function-ibrsc">
  3035. <refmeta>
  3036. <refentrytitle>ibrsc</refentrytitle>
  3037. <manvolnum>3</manvolnum>
  3038. </refmeta>
  3039. <refnamediv>
  3040. <refname>ibrsc</refname>
  3041. <refpurpose>request system control (board)</refpurpose>
  3042. </refnamediv>
  3043. <refsynopsisdiv>
  3044. <funcsynopsis>
  3045. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3046. <funcprototype>
  3047. <funcdef>int <function>ibrsc</function></funcdef>
  3048. <paramdef>int <parameter>ud</parameter></paramdef>
  3049. <paramdef>int <parameter>request_control</parameter></paramdef>
  3050. </funcprototype>
  3051. </funcsynopsis>
  3052. </refsynopsisdiv>
  3053. <refsect1>
  3054. <title>
  3055. Description
  3056. </title>
  3057. <para>
  3058. If <parameter>request_control</parameter> is nonzero, then the board
  3059. specified by the board descriptor <parameter>ud</parameter> is
  3060. made system controller. If <parameter>request_control</parameter>
  3061. is zero, then the board releases system control.
  3062. </para>
  3063. <para>
  3064. The system controller has the ability
  3065. to assert the REN and IFC lines, and is typically also the
  3066. controller-in-charge. A GPIB bus may not have more than one
  3067. system controller.
  3068. </para>
  3069. </refsect1>
  3070. <refsect1>
  3071. <title>
  3072. Return value
  3073. </title>
  3074. <para>
  3075. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3076. </para>
  3077. </refsect1>
  3078. </refentry>
  3079. <refentry ID="reference-function-ibrsp">
  3080. <refmeta>
  3081. <refentrytitle>ibrsp</refentrytitle>
  3082. <manvolnum>3</manvolnum>
  3083. </refmeta>
  3084. <refnamediv>
  3085. <refname>ibrsp</refname>
  3086. <refpurpose>conduct serial poll (device)</refpurpose>
  3087. </refnamediv>
  3088. <refsynopsisdiv>
  3089. <funcsynopsis>
  3090. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3091. <funcprototype>
  3092. <funcdef>int <function>ibrsp</function></funcdef>
  3093. <paramdef>int <parameter>ud</parameter></paramdef>
  3094. <paramdef>char *<parameter>result</parameter></paramdef>
  3095. </funcprototype>
  3096. </funcsynopsis>
  3097. </refsynopsisdiv>
  3098. <refsect1>
  3099. <title>
  3100. Description
  3101. </title>
  3102. <para>
  3103. ibrsp() serial polls the device specified by <parameter>ud</parameter>.
  3104. The status byte is stored in the location specified by <parameter>result</parameter>.
  3105. </para>
  3106. </refsect1>
  3107. <refsect1>
  3108. <title>
  3109. Return value
  3110. </title>
  3111. <para>
  3112. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3113. </para>
  3114. </refsect1>
  3115. </refentry>
  3116. <refentry ID="reference-function-ibrsv">
  3117. <refmeta>
  3118. <refentrytitle>ibrsv</refentrytitle>
  3119. <manvolnum>3</manvolnum>
  3120. </refmeta>
  3121. <refnamediv>
  3122. <refname>ibrsv</refname>
  3123. <refpurpose>request service (board)</refpurpose>
  3124. </refnamediv>
  3125. <refsynopsisdiv>
  3126. <funcsynopsis>
  3127. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3128. <funcprototype>
  3129. <funcdef>int <function>ibrsv</function></funcdef>
  3130. <paramdef>int <parameter>ud</parameter></paramdef>
  3131. <paramdef>int <parameter>status_byte</parameter></paramdef>
  3132. </funcprototype>
  3133. </funcsynopsis>
  3134. </refsynopsisdiv>
  3135. <refsect1>
  3136. <title>
  3137. Description
  3138. </title>
  3139. <para>
  3140. The serial poll response byte of the board specified by the board
  3141. descriptor <parameter>ud</parameter> is set to <parameter>status_byte</parameter>.
  3142. If the request service bit (0x40 hexadecimal) in <parameter>status_byte</parameter>
  3143. is set, then the board will also request service by asserting the RQS line.
  3144. </para>
  3145. </refsect1>
  3146. <refsect1>
  3147. <title>
  3148. Return value
  3149. </title>
  3150. <para>
  3151. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3152. </para>
  3153. </refsect1>
  3154. </refentry>
  3155. <refentry ID="reference-function-ibsad">
  3156. <refmeta>
  3157. <refentrytitle>ibsad</refentrytitle>
  3158. <manvolnum>3</manvolnum>
  3159. </refmeta>
  3160. <refnamediv>
  3161. <refname>ibsad</refname>
  3162. <refpurpose>set secondary GPIB address (board or device)</refpurpose>
  3163. </refnamediv>
  3164. <refsynopsisdiv>
  3165. <funcsynopsis>
  3166. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3167. <funcprototype>
  3168. <funcdef>int <function>ibsad</function></funcdef>
  3169. <paramdef>int <parameter>ud</parameter></paramdef>
  3170. <paramdef>int <parameter>sad</parameter></paramdef>
  3171. </funcprototype>
  3172. </funcsynopsis>
  3173. </refsynopsisdiv>
  3174. <refsect1>
  3175. <title>
  3176. Description
  3177. </title>
  3178. <para>
  3179. ibsad() sets the GPIB secondary address
  3180. of the device or board specified by the descriptor <parameter>ud</parameter>.
  3181. If <parameter>ud</parameter> is a device descriptor, then the setting is
  3182. local to the descriptor (it does not affect the behaviour of calls using
  3183. other descriptors, even if they refer to the same physical device). If
  3184. <parameter>ud</parameter> is a board descriptor, then the board's
  3185. secondary address is changed immediately, which is a global change affecting
  3186. anything (even other processes) using the board.
  3187. </para>
  3188. <para>
  3189. This library follows NI's unfortunate convention of adding 0x60 hexadecimal (96
  3190. decimal) to
  3191. secondary addresses. That is, if you wish to set the secondary address
  3192. to 3, you should set <parameter>sad</parameter> to 0x63. Setting
  3193. <parameter>sad</parameter> to 0 disables the use of secondary addressing.
  3194. Valid GPIB secondary addresses are in the range from 0 to 30 (which correspond
  3195. to <parameter>sad</parameter> values of 0x60 to 0x7e).
  3196. </para>
  3197. </refsect1>
  3198. <refsect1>
  3199. <title>
  3200. Return value
  3201. </title>
  3202. <para>
  3203. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3204. </para>
  3205. </refsect1>
  3206. </refentry>
  3207. <refentry ID="reference-function-ibsic">
  3208. <refmeta>
  3209. <refentrytitle>ibsic</refentrytitle>
  3210. <manvolnum>3</manvolnum>
  3211. </refmeta>
  3212. <refnamediv>
  3213. <refname>ibsic</refname>
  3214. <refpurpose>perform interface clear (board)</refpurpose>
  3215. </refnamediv>
  3216. <refsynopsisdiv>
  3217. <funcsynopsis>
  3218. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3219. <funcprototype>
  3220. <funcdef>int <function>ibsic</function></funcdef>
  3221. <paramdef>int <parameter>ud</parameter></paramdef>
  3222. </funcprototype>
  3223. </funcsynopsis>
  3224. </refsynopsisdiv>
  3225. <refsect1>
  3226. <title>
  3227. Description
  3228. </title>
  3229. <para>
  3230. ibsic() resets the GPIB bus by asserting the 'interface clear' (IFC)
  3231. bus line
  3232. for a duration of at least 100 microseconds. The board specified
  3233. by <parameter>ud</parameter> must be the system controller
  3234. in order to assert IFC. The interface clear causes all devices
  3235. to untalk and unlisten, puts them into
  3236. serial poll disabled state (don't worry, you will still be able
  3237. to conduct serial polls), and the board becomes
  3238. controller-in-charge.
  3239. </para>
  3240. </refsect1>
  3241. <refsect1>
  3242. <title>
  3243. Return value
  3244. </title>
  3245. <para>
  3246. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3247. </para>
  3248. </refsect1>
  3249. </refentry>
  3250. <refentry ID="reference-function-ibsre">
  3251. <refmeta>
  3252. <refentrytitle>ibsre</refentrytitle>
  3253. <manvolnum>3</manvolnum>
  3254. </refmeta>
  3255. <refnamediv>
  3256. <refname>ibsre</refname>
  3257. <refpurpose>set remote enable (board)</refpurpose>
  3258. </refnamediv>
  3259. <refsynopsisdiv>
  3260. <funcsynopsis>
  3261. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3262. <funcprototype>
  3263. <funcdef>int <function>ibsre</function></funcdef>
  3264. <paramdef>int <parameter>ud</parameter></paramdef>
  3265. <paramdef>int <parameter>enable</parameter></paramdef>
  3266. </funcprototype>
  3267. </funcsynopsis>
  3268. </refsynopsisdiv>
  3269. <refsect1>
  3270. <title>
  3271. Description
  3272. </title>
  3273. <para>
  3274. If <parameter>enable</parameter> is nonzero, then the board specified
  3275. by the board descriptor <parameter>ud</parameter> asserts the REN line.
  3276. If <parameter>enable</parameter> is zero, the REN line is unasserted.
  3277. The board must be the system controller.
  3278. </para>
  3279. </refsect1>
  3280. <refsect1>
  3281. <title>
  3282. Return value
  3283. </title>
  3284. <para>
  3285. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3286. </para>
  3287. </refsect1>
  3288. </refentry>
  3289. <refentry ID="reference-function-ibstop">
  3290. <refmeta>
  3291. <refentrytitle>ibstop</refentrytitle>
  3292. <manvolnum>3</manvolnum>
  3293. </refmeta>
  3294. <refnamediv>
  3295. <refname>ibstop</refname>
  3296. <refpurpose>abort asynchronous i/o operation (board or device)</refpurpose>
  3297. </refnamediv>
  3298. <refsynopsisdiv>
  3299. <funcsynopsis>
  3300. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3301. <funcprototype>
  3302. <funcdef>int <function>ibstop</function></funcdef>
  3303. <paramdef>int <parameter>ud</parameter></paramdef>
  3304. </funcprototype>
  3305. </funcsynopsis>
  3306. </refsynopsisdiv>
  3307. <refsect1>
  3308. <title>
  3309. Description
  3310. </title>
  3311. <para>
  3312. ibstop() aborts an asynchronous i/o operation (for example, one
  3313. started with
  3314. <link LINKEND="reference-function-ibcmda">ibcmda()</link>,
  3315. <link LINKEND="reference-function-ibrda">ibrda()</link>, or
  3316. <link LINKEND="reference-function-ibwrta">ibwrta()</link>).
  3317. </para>
  3318. <para>
  3319. The return value of ibstop() is counter-intuitive. On successfully
  3320. aborting an asynchronous operation, the ERR bit is set in
  3321. <link LINKEND="reference-globals-ibsta">ibsta</link>, and
  3322. <link LINKEND="reference-globals-iberr">iberr</link> is
  3323. set to EABO. If the ERR bit is not set in ibsta, then
  3324. there was no asynchronous i/o operation in progress. If the
  3325. function failed, the ERR bit will be set and iberr will be
  3326. set to some value other than EABO.
  3327. </para>
  3328. </refsect1>
  3329. <refsect1>
  3330. <title>
  3331. Return value
  3332. </title>
  3333. <para>
  3334. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3335. </para>
  3336. </refsect1>
  3337. </refentry>
  3338. <refentry ID="reference-function-ibtmo">
  3339. <refmeta>
  3340. <refentrytitle>ibtmo</refentrytitle>
  3341. <manvolnum>3</manvolnum>
  3342. </refmeta>
  3343. <refnamediv>
  3344. <refname>ibtmo</refname>
  3345. <refpurpose>adjust io timeout (board or device)</refpurpose>
  3346. </refnamediv>
  3347. <refsynopsisdiv>
  3348. <funcsynopsis>
  3349. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3350. <funcprototype>
  3351. <funcdef>int <function>ibtmo</function></funcdef>
  3352. <paramdef>int <parameter>ud</parameter></paramdef>
  3353. <paramdef>int <parameter>timeout</parameter></paramdef>
  3354. </funcprototype>
  3355. </funcsynopsis>
  3356. </refsynopsisdiv>
  3357. <refsect1>
  3358. <title>
  3359. Description
  3360. </title>
  3361. <para>
  3362. ibtmo() sets timeout for IO operations performed using the board
  3363. or device descriptor
  3364. <parameter>ud</parameter>. The actual amount of time before
  3365. a timeout occurs may be greater than the period specified, but
  3366. never less.
  3367. <parameter>timeout</parameter> is specified by using one of
  3368. the following constants:
  3369. </para>
  3370. <para>
  3371. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="0">
  3372. <title>Timeout constants</title>
  3373. <tgroup COLS="3" ALIGN="left" >
  3374. <thead>
  3375. <row>
  3376. <entry>constant</entry>
  3377. <entry>value</entry>
  3378. <entry>timeout</entry>
  3379. </row>
  3380. </thead>
  3381. <tbody>
  3382. <row>
  3383. <entry>TNONE</entry>
  3384. <entry>0</entry>
  3385. <entry>Never timeout.</entry>
  3386. </row>
  3387. <row>
  3388. <entry>T10us</entry>
  3389. <entry>1</entry>
  3390. <entry>10 microseconds</entry>
  3391. </row>
  3392. <row>
  3393. <entry>T30us</entry>
  3394. <entry>2</entry>
  3395. <entry>30 microseconds</entry>
  3396. </row>
  3397. <row>
  3398. <entry>T100us</entry>
  3399. <entry>3</entry>
  3400. <entry>100 microseconds</entry>
  3401. </row>
  3402. <row>
  3403. <entry>T300us</entry>
  3404. <entry>4</entry>
  3405. <entry>300 microseconds</entry>
  3406. </row>
  3407. <row>
  3408. <entry>T1ms</entry>
  3409. <entry>5</entry>
  3410. <entry>1 millisecond</entry>
  3411. </row>
  3412. <row>
  3413. <entry>T3ms</entry>
  3414. <entry>6</entry>
  3415. <entry>3 milliseconds</entry>
  3416. </row>
  3417. <row>
  3418. <entry>T10ms</entry>
  3419. <entry>7</entry>
  3420. <entry>10 milliseconds</entry>
  3421. </row>
  3422. <row>
  3423. <entry>T30ms</entry>
  3424. <entry>8</entry>
  3425. <entry>30 milliseconds</entry>
  3426. </row>
  3427. <row>
  3428. <entry>T100ms</entry>
  3429. <entry>9</entry>
  3430. <entry>100 milliseconds</entry>
  3431. </row>
  3432. <row>
  3433. <entry>T300ms</entry>
  3434. <entry>10</entry>
  3435. <entry>300 milliseconds</entry>
  3436. </row>
  3437. <row>
  3438. <entry>T1s</entry>
  3439. <entry>11</entry>
  3440. <entry>1 second</entry>
  3441. </row>
  3442. <row>
  3443. <entry>T3s</entry>
  3444. <entry>12</entry>
  3445. <entry>3 seconds</entry>
  3446. </row>
  3447. <row>
  3448. <entry>T10s</entry>
  3449. <entry>13</entry>
  3450. <entry>10 seconds</entry>
  3451. </row>
  3452. <row>
  3453. <entry>T30s</entry>
  3454. <entry>14</entry>
  3455. <entry>30 seconds</entry>
  3456. </row>
  3457. <row>
  3458. <entry>T100s</entry>
  3459. <entry>15</entry>
  3460. <entry>100 seconds</entry>
  3461. </row>
  3462. <row>
  3463. <entry>T300s</entry>
  3464. <entry>16</entry>
  3465. <entry>300 seconds</entry>
  3466. </row>
  3467. <row>
  3468. <entry>T1000s</entry>
  3469. <entry>17</entry>
  3470. <entry>1000 seconds</entry>
  3471. </row>
  3472. </tbody>
  3473. </tgroup>
  3474. </table>
  3475. </para>
  3476. </refsect1>
  3477. <refsect1>
  3478. <title>
  3479. Return value
  3480. </title>
  3481. <para>
  3482. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3483. </para>
  3484. </refsect1>
  3485. </refentry>
  3486. <refentry ID="reference-function-ibtrg">
  3487. <refmeta>
  3488. <refentrytitle>ibtrg</refentrytitle>
  3489. <manvolnum>3</manvolnum>
  3490. </refmeta>
  3491. <refnamediv>
  3492. <refname>ibtrg</refname>
  3493. <refpurpose>trigger device (device)</refpurpose>
  3494. </refnamediv>
  3495. <refsynopsisdiv>
  3496. <funcsynopsis>
  3497. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3498. <funcprototype>
  3499. <funcdef>int <function>ibtrg</function></funcdef>
  3500. <paramdef>int <parameter>ud</parameter></paramdef>
  3501. </funcprototype>
  3502. </funcsynopsis>
  3503. </refsynopsisdiv>
  3504. <refsect1>
  3505. <title>
  3506. Description
  3507. </title>
  3508. <para>
  3509. ibtrg() sends a GET (group execute trigger)
  3510. <link LINKEND="reference-command-bytes">command byte</link> to the
  3511. device specified by the device descriptor <parameter>ud</parameter>.
  3512. </para>
  3513. </refsect1>
  3514. <refsect1>
  3515. <title>
  3516. Return value
  3517. </title>
  3518. <para>
  3519. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3520. </para>
  3521. </refsect1>
  3522. </refentry>
  3523. <refentry ID="reference-function-ibwait">
  3524. <refmeta>
  3525. <refentrytitle>ibwait</refentrytitle>
  3526. <manvolnum>3</manvolnum>
  3527. </refmeta>
  3528. <refnamediv>
  3529. <refname>ibwait</refname>
  3530. <refpurpose>wait for event (board or device)</refpurpose>
  3531. </refnamediv>
  3532. <refsynopsisdiv>
  3533. <funcsynopsis>
  3534. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3535. <funcprototype>
  3536. <funcdef>int <function>ibwait</function></funcdef>
  3537. <paramdef>int <parameter>ud</parameter></paramdef>
  3538. <paramdef>int <parameter>status_mask</parameter></paramdef>
  3539. </funcprototype>
  3540. </funcsynopsis>
  3541. </refsynopsisdiv>
  3542. <refsect1>
  3543. <title>
  3544. Description
  3545. </title>
  3546. <para>
  3547. ibwait() will sleep until one of the conditions specified in
  3548. <parameter>status_mask</parameter> is true. The meaning of
  3549. the bits in <parameter>status_mask</parameter> are the same
  3550. as the bits of the <link LINKEND="reference-globals-ibsta">ibsta</link>
  3551. status variable.
  3552. </para>
  3553. <para>
  3554. If <parameter>status_mask</parameter> is zero, then ibwait() will
  3555. return immediately. This is useful if you simply wish to get an
  3556. updated ibsta.
  3557. </para>
  3558. </refsect1>
  3559. <refsect1>
  3560. <title>
  3561. Return value
  3562. </title>
  3563. <para>
  3564. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3565. </para>
  3566. </refsect1>
  3567. </refentry>
  3568. <refentry ID="reference-function-ibwrt">
  3569. <refmeta>
  3570. <refentrytitle>ibwrt</refentrytitle>
  3571. <manvolnum>3</manvolnum>
  3572. </refmeta>
  3573. <refnamediv>
  3574. <refname>ibwrt</refname>
  3575. <refpurpose>write data bytes (board or device)</refpurpose>
  3576. </refnamediv>
  3577. <refsynopsisdiv>
  3578. <funcsynopsis>
  3579. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3580. <funcprototype>
  3581. <funcdef>int <function>ibwrt</function></funcdef>
  3582. <paramdef>int <parameter>ud</parameter></paramdef>
  3583. <paramdef>const void *<parameter>data</parameter></paramdef>
  3584. <paramdef>long <parameter>num_bytes</parameter></paramdef>
  3585. </funcprototype>
  3586. </funcsynopsis>
  3587. </refsynopsisdiv>
  3588. <refsect1>
  3589. <title>
  3590. Description
  3591. </title>
  3592. <para>
  3593. ibwrt() is used to write data bytes to a device or board. The argument
  3594. <parameter>ud</parameter> can be either a device or board descriptor.
  3595. <parameter>num_bytes</parameter> specifies how many bytes
  3596. are written from the user-supplied array <parameter>data</parameter>.
  3597. EOI may be asserted with the last byte sent or when the end-of-string
  3598. character is sent (see <link LINKEND="reference-function-ibeos">
  3599. ibeos()</link> and <link LINKEND="reference-function-ibeot">
  3600. ibeot()</link>). The write operation
  3601. may be interrupted by a timeout (see <link LINKEND="reference-function-ibtmo">
  3602. ibtmo()</link>), the board receiving a device clear command, or
  3603. receiving an interface clear.
  3604. </para>
  3605. <para>
  3606. If <parameter>ud</parameter> is a device descriptor, then the library
  3607. automatically handles addressing the device as listener and the interface
  3608. board as talker, before sending the data bytes onto the bus.
  3609. </para>
  3610. <para>
  3611. If <parameter>ud</parameter>
  3612. is a board descriptor, the board simply writes the data onto the bus. The
  3613. controller-in-charge must address the board as talker.
  3614. </para>
  3615. <para>
  3616. After the ibwrt() call, ibcnt and ibcntl are set to the number of bytes
  3617. written.
  3618. </para>
  3619. </refsect1>
  3620. <refsect1>
  3621. <title>
  3622. Return value
  3623. </title>
  3624. <para>
  3625. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3626. </para>
  3627. </refsect1>
  3628. </refentry>
  3629. <refentry ID="reference-function-ibwrta">
  3630. <refmeta>
  3631. <refentrytitle>ibwrta</refentrytitle>
  3632. <manvolnum>3</manvolnum>
  3633. </refmeta>
  3634. <refnamediv>
  3635. <refname>ibwrta</refname>
  3636. <refpurpose>write data bytes asynchronously (board or device)</refpurpose>
  3637. </refnamediv>
  3638. <refsynopsisdiv>
  3639. <funcsynopsis>
  3640. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3641. <funcprototype>
  3642. <funcdef>int <function>ibwrta</function></funcdef>
  3643. <paramdef>int <parameter>ud</parameter></paramdef>
  3644. <paramdef>const void *<parameter>buffer</parameter></paramdef>
  3645. <paramdef>long <parameter>num_bytes</parameter></paramdef>
  3646. </funcprototype>
  3647. </funcsynopsis>
  3648. </refsynopsisdiv>
  3649. <refsect1>
  3650. <title>
  3651. Description
  3652. </title>
  3653. <para>
  3654. ibwrta() is similar to
  3655. <link LINKEND="reference-function-ibwrt">ibwrt()</link>
  3656. except it operates asynchronously. ibwrta() does not
  3657. wait for the sending of the data bytes to complete, but
  3658. rather returns immediately.
  3659. </para>
  3660. <para>
  3661. While an asynchronous
  3662. operation is in progress, most library functions will
  3663. fail with an EOIP error. In order to sucessfully
  3664. complete an
  3665. asynchronous operation, you must call
  3666. <link LINKEND="reference-function-ibwait">ibwait()</link>
  3667. and until the CMPL bit is set ibsta. Asynchronous
  3668. operations
  3669. may also be aborted with an
  3670. <link LINKEND="reference-function-ibstop">ibstop()</link>
  3671. or
  3672. <link LINKEND="reference-function-ibonl">ibonl()</link>
  3673. call.
  3674. </para>
  3675. </refsect1>
  3676. <refsect1>
  3677. <title>
  3678. Return value
  3679. </title>
  3680. <para>
  3681. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3682. </para>
  3683. </refsect1>
  3684. </refentry>
  3685. <refentry ID="reference-function-ibwrtf">
  3686. <refmeta>
  3687. <refentrytitle>ibwrtf</refentrytitle>
  3688. <manvolnum>3</manvolnum>
  3689. </refmeta>
  3690. <refnamediv>
  3691. <refname>ibwrtf</refname>
  3692. <refpurpose>write data bytes from file (board or device)</refpurpose>
  3693. </refnamediv>
  3694. <refsynopsisdiv>
  3695. <funcsynopsis>
  3696. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3697. <funcprototype>
  3698. <funcdef>int <function>ibwrtf</function></funcdef>
  3699. <paramdef>int <parameter>ud</parameter></paramdef>
  3700. <paramdef>const char *<parameter>file_path</parameter></paramdef>
  3701. </funcprototype>
  3702. </funcsynopsis>
  3703. </refsynopsisdiv>
  3704. <refsect1>
  3705. <title>
  3706. Description
  3707. </title>
  3708. <para>
  3709. ibwrtf() is similar to <link LINKEND="reference-function-ibwrt">ibwrt()</link>
  3710. except that the data to be written is taken from a file instead
  3711. of an array in memory. <parameter>file_path</parameter> specifies
  3712. the file, which is written byte for byte onto the bus.
  3713. </para>
  3714. </refsect1>
  3715. <refsect1>
  3716. <title>
  3717. Return value
  3718. </title>
  3719. <para>
  3720. The value of <link LINKEND="reference-globals-ibsta">ibsta</link> is returned.
  3721. </para>
  3722. </refsect1>
  3723. </refentry>
  3724. </section>
  3725. <section>
  3726. <title>
  3727. "Multidevice" API Functions
  3728. </title>
  3729. <para>
  3730. The "Multidevice" API functions provide similar functionality to the "Traditional" API functions.
  3731. However, some of the "multidevice" functions can be
  3732. to be performed on multiple devices simultaneously. For example,
  3733. <link LINKEND="reference-function-sendlist">SendList()</link>
  3734. can be used to write a message to multiple devices. Such functions take an array of Addr4882_t
  3735. as an argument. The end of the array is specified by setting the last element to the
  3736. constant NOADDR.
  3737. </para>
  3738. <refentry ID="reference-function-allspoll">
  3739. <refmeta>
  3740. <refentrytitle>AllSPoll</refentrytitle>
  3741. <manvolnum>3</manvolnum>
  3742. </refmeta>
  3743. <refnamediv>
  3744. <refname>AllSPoll</refname>
  3745. <refpurpose>serial poll multiple devices</refpurpose>
  3746. </refnamediv>
  3747. <refsynopsisdiv>
  3748. <funcsynopsis>
  3749. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3750. <funcprototype>
  3751. <funcdef>void <function>AllSPoll</function></funcdef>
  3752. <paramdef>int <parameter>board_desc</parameter></paramdef>
  3753. <paramdef>Addr4882_t *<parameter>addressList</parameter></paramdef>
  3754. <paramdef>short *<parameter>resultList</parameter></paramdef>
  3755. </funcprototype>
  3756. <funcprototype>
  3757. <funcdef>void <function>AllSpoll</function></funcdef>
  3758. <paramdef>int <parameter>board_desc</parameter></paramdef>
  3759. <paramdef>const Addr4882_t *<parameter>addressList</parameter></paramdef>
  3760. <paramdef>short *<parameter>resultList</parameter></paramdef>
  3761. </funcprototype>
  3762. </funcsynopsis>
  3763. </refsynopsisdiv>
  3764. <refsect1>
  3765. <title>
  3766. Description
  3767. </title>
  3768. <para>
  3769. AllSPoll() causes the interface board specified by <parameter>board_desc</parameter>
  3770. to serial poll all the GPIB addresses specified in the <parameter>addressList</parameter>
  3771. array. The results of the serial polls are stored into <parameter>resultList</parameter>.
  3772. If you only wish to serial poll a single device,
  3773. <link LINKEND="reference-function-readstatusbyte">ReadStatusByte()</link> or
  3774. <link LINKEND="reference-function-ibrsp">ibrsp()</link> may be
  3775. more convenient.
  3776. </para>
  3777. <para>
  3778. This function may also be invoked with the alternate capitalization 'AllSpoll'
  3779. for compatibility with NI's library.
  3780. </para>
  3781. </refsect1>
  3782. </refentry>
  3783. <refentry ID="reference-function-devclear">
  3784. <refmeta>
  3785. <refentrytitle>DevClear</refentrytitle>
  3786. <manvolnum>3</manvolnum>
  3787. </refmeta>
  3788. <refnamediv>
  3789. <refname>DevClear</refname>
  3790. <refpurpose>clear a device</refpurpose>
  3791. </refnamediv>
  3792. <refsynopsisdiv>
  3793. <funcsynopsis>
  3794. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3795. <funcprototype>
  3796. <funcdef>void <function>DevClear</function></funcdef>
  3797. <paramdef>int <parameter>board_desc</parameter></paramdef>
  3798. <paramdef>Addr4882_t <parameter>address</parameter></paramdef>
  3799. </funcprototype>
  3800. </funcsynopsis>
  3801. </refsynopsisdiv>
  3802. <refsect1>
  3803. <title>
  3804. Description
  3805. </title>
  3806. <para>
  3807. DevClear() causes the interface board specified by <parameter>board_desc</parameter>
  3808. to send the clear command to the GPIB addresses specified by <parameter>address</parameter>. The results of the serial polls are stored into <parameter>resultList</parameter>.
  3809. If you wish to clear multiple devices simultaneously, use
  3810. <link LINKEND="reference-function-devclearlist">DevClearList()</link>
  3811. </para>
  3812. </refsect1>
  3813. </refentry>
  3814. <refentry ID="reference-function-devclearlist">
  3815. <refmeta>
  3816. <refentrytitle>DevClearList</refentrytitle>
  3817. <manvolnum>3</manvolnum>
  3818. </refmeta>
  3819. <refnamediv>
  3820. <refname>DevClearList</refname>
  3821. <refpurpose>clear multiple devices</refpurpose>
  3822. </refnamediv>
  3823. <refsynopsisdiv>
  3824. <funcsynopsis>
  3825. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3826. <funcprototype>
  3827. <funcdef>void <function>DevClearList</function></funcdef>
  3828. <paramdef>int <parameter>board_desc</parameter></paramdef>
  3829. <paramdef>const Addr4882_t <parameter>addressList[]</parameter></paramdef>
  3830. </funcprototype>
  3831. </funcsynopsis>
  3832. </refsynopsisdiv>
  3833. <refsect1>
  3834. <title>
  3835. Description
  3836. </title>
  3837. <para>
  3838. DevClear() causes the interface board specified by <parameter>board_desc</parameter>
  3839. to send the clear command simultaneously to all the GPIB addresses specified by the
  3840. <parameter>addressList</parameter> array. If <parameter>addressList</parameter> is
  3841. empty or NULL, then the clear command is sent to all devices on the bus.
  3842. If you only wish to clear a single device,
  3843. <link LINKEND="reference-function-devclear">DevClear()</link>
  3844. or <link LINKEND="reference-function-ibclr">ibclr()</link> may
  3845. be slightly more convenient.
  3846. </para>
  3847. </refsect1>
  3848. </refentry>
  3849. <refentry ID="reference-function-enablelocal">
  3850. <refmeta>
  3851. <refentrytitle>EnableLocal</refentrytitle>
  3852. <manvolnum>3</manvolnum>
  3853. </refmeta>
  3854. <refnamediv>
  3855. <refname>EnableLocal</refname>
  3856. <refpurpose>put devices into local mode.</refpurpose>
  3857. </refnamediv>
  3858. <refsynopsisdiv>
  3859. <funcsynopsis>
  3860. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3861. <funcprototype>
  3862. <funcdef>void <function>EnableLocal</function></funcdef>
  3863. <paramdef>int <parameter>board_desc</parameter></paramdef>
  3864. <paramdef>const Addr4882_t <parameter>addressList[]</parameter></paramdef>
  3865. </funcprototype>
  3866. </funcsynopsis>
  3867. </refsynopsisdiv>
  3868. <refsect1>
  3869. <title>
  3870. Description
  3871. </title>
  3872. <para>
  3873. EnableLocal() addresses
  3874. all of the devices in the <parameter>addressList</parameter> array as listeners
  3875. then sends the GTL (go to local) command byte, causing them to enter local mode.
  3876. This requires that the board is the controller-in-charge.
  3877. Note that while the REN (remote enable) bus line is asserted, the devices
  3878. will return to remote mode the next time they are addressed.
  3879. </para>
  3880. <para>
  3881. If <parameter>addressList</parameter> is empty or NULL, then the REN
  3882. line is unasserted and all devices enter local mode. The board must
  3883. be system controller to change the state of the REN line.
  3884. </para>
  3885. </refsect1>
  3886. </refentry>
  3887. <refentry ID="reference-function-enableremote">
  3888. <refmeta>
  3889. <refentrytitle>EnableRemote</refentrytitle>
  3890. <manvolnum>3</manvolnum>
  3891. </refmeta>
  3892. <refnamediv>
  3893. <refname>EnableRemote</refname>
  3894. <refpurpose>put devices into remote mode.</refpurpose>
  3895. </refnamediv>
  3896. <refsynopsisdiv>
  3897. <funcsynopsis>
  3898. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3899. <funcprototype>
  3900. <funcdef>void <function>EnableRemote</function></funcdef>
  3901. <paramdef>int <parameter>board_desc</parameter></paramdef>
  3902. <paramdef>const Addr4882_t <parameter>addressList[]</parameter></paramdef>
  3903. </funcprototype>
  3904. </funcsynopsis>
  3905. </refsynopsisdiv>
  3906. <refsect1>
  3907. <title>
  3908. Description
  3909. </title>
  3910. <para>
  3911. EnableRemote() asserts the REN (remote enable) line, and addresses
  3912. all of the devices
  3913. in the <parameter>addressList</parameter> array as listeners (causing
  3914. them to enter remote mode). The board must be system controller.
  3915. </para>
  3916. </refsect1>
  3917. </refentry>
  3918. <refentry ID="reference-function-findlstn">
  3919. <refmeta>
  3920. <refentrytitle>FindLstn</refentrytitle>
  3921. <manvolnum>3</manvolnum>
  3922. </refmeta>
  3923. <refnamediv>
  3924. <refname>FindLstn</refname>
  3925. <refpurpose>find devices</refpurpose>
  3926. </refnamediv>
  3927. <refsynopsisdiv>
  3928. <funcsynopsis>
  3929. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3930. <funcprototype>
  3931. <funcdef>void <function>FindLstn</function></funcdef>
  3932. <paramdef>int <parameter>board_desc</parameter></paramdef>
  3933. <paramdef>const Addr4882_t <parameter>padList[]</parameter></paramdef>
  3934. <paramdef>Addr4882_t <parameter>resultList[]</parameter></paramdef>
  3935. <paramdef>int <parameter>maxNumResults</parameter></paramdef>
  3936. </funcprototype>
  3937. </funcsynopsis>
  3938. </refsynopsisdiv>
  3939. <refsect1>
  3940. <title>
  3941. Description
  3942. </title>
  3943. <para>
  3944. FindLstn() will check the primary addresses in the <parameter>padList</parameter>
  3945. array for devices. The GPIB addresses of all devices found will be stored in the
  3946. <parameter>resultList</parameter> array, and
  3947. <link LINKEND="reference-globals-ibcnt">ibcnt</link>
  3948. will be set to the number
  3949. of devices found. The <parameter>maxNumResults</parameter> parameter
  3950. limits the maximum number of results that will be returned, and is usually
  3951. set to the number of elements in the <parameter>resultList</parameter> array.
  3952. If more than <parameter>maxNumResults</parameter> devices are found, an
  3953. ETAB error is returned in <link LINKEND="reference-globals-iberr">iberr</link>.
  3954. The <parameter>padList</parameter> should consist of primary addresses only,
  3955. with no secondary addresses (all possible secondary addresses will be checked
  3956. as necessary).
  3957. </para>
  3958. <para>
  3959. Your GPIB board must have the capability to monitor the NDAC bus line in order
  3960. to use this function (see <link LINKEND="reference-function-iblines">iblines</link>).
  3961. </para>
  3962. </refsect1>
  3963. </refentry>
  3964. <refentry ID="reference-function-findrqs">
  3965. <refmeta>
  3966. <refentrytitle>FindRQS</refentrytitle>
  3967. <manvolnum>3</manvolnum>
  3968. </refmeta>
  3969. <refnamediv>
  3970. <refname>FindRQS</refname>
  3971. <refpurpose>find device requesting service and read its status byte</refpurpose>
  3972. </refnamediv>
  3973. <refsynopsisdiv>
  3974. <funcsynopsis>
  3975. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  3976. <funcprototype>
  3977. <funcdef>void <function>FindRQS</function></funcdef>
  3978. <paramdef>int <parameter>board_desc</parameter></paramdef>
  3979. <paramdef>const Addr4882_t <parameter>addressList[]</parameter></paramdef>
  3980. <paramdef>short *<parameter>status</parameter></paramdef>
  3981. </funcprototype>
  3982. </funcsynopsis>
  3983. </refsynopsisdiv>
  3984. <refsect1>
  3985. <title>
  3986. Description
  3987. </title>
  3988. <para>
  3989. FindRQS will serial poll the GPIB addresses specified in the
  3990. <parameter>addressList</parameter> array until it finds a device
  3991. requesting service. The status byte of the device requesting
  3992. service is stored in the location specified by <parameter>status</parameter>.
  3993. The <parameter>addressList</parameter> array index of the device requesting
  3994. service is returned in <link LINKEND="reference-globals-ibcnt">ibcnt</link>.
  3995. If no device requesting service is found,
  3996. an ETAB error is returned in <link LINKEND="reference-globals-iberr">iberr</link>.
  3997. </para>
  3998. </refsect1>
  3999. </refentry>
  4000. <refentry ID="reference-function-passcontrol">
  4001. <refmeta>
  4002. <refentrytitle>PassControl</refentrytitle>
  4003. <manvolnum>3</manvolnum>
  4004. </refmeta>
  4005. <refnamediv>
  4006. <refname>PassControl</refname>
  4007. <refpurpose>make device controller-in-charge</refpurpose>
  4008. </refnamediv>
  4009. <refsynopsisdiv>
  4010. <funcsynopsis>
  4011. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4012. <funcprototype>
  4013. <funcdef>void <function>PassControl</function></funcdef>
  4014. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4015. <paramdef>const Addr4882_t <parameter>address</parameter></paramdef>
  4016. </funcprototype>
  4017. </funcsynopsis>
  4018. </refsynopsisdiv>
  4019. <refsect1>
  4020. <title>
  4021. Description
  4022. </title>
  4023. <para>
  4024. PassControl() causes the board specified by <parameter>board_desc</parameter>
  4025. to pass control to the device specified by <parameter>address</parameter>.
  4026. On success, the device becomes the new controller-in-charge.
  4027. </para>
  4028. </refsect1>
  4029. </refentry>
  4030. <refentry ID="reference-function-ppoll">
  4031. <refmeta>
  4032. <refentrytitle>PPoll</refentrytitle>
  4033. <manvolnum>3</manvolnum>
  4034. </refmeta>
  4035. <refnamediv>
  4036. <refname>PPoll</refname>
  4037. <refpurpose>parallel poll devices</refpurpose>
  4038. </refnamediv>
  4039. <refsynopsisdiv>
  4040. <funcsynopsis>
  4041. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4042. <funcprototype>
  4043. <funcdef>void <function>PPoll</function></funcdef>
  4044. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4045. <paramdef>short *<parameter>result</parameter></paramdef>
  4046. </funcprototype>
  4047. </funcsynopsis>
  4048. </refsynopsisdiv>
  4049. <refsect1>
  4050. <title>
  4051. Description
  4052. </title>
  4053. <para>
  4054. PPoll() is similar to the 'traditional' API function
  4055. <link LINKEND="reference-function-ibrpp">ibrpp()</link>.
  4056. It causes the interface board to perform a parallel poll, and stores
  4057. the parallel poll byte in the
  4058. location specified by <parameter>result</parameter>. Bits 0 to 7
  4059. of the parallel poll byte correspond to the dio lines 1 to 8, with
  4060. a 1 indicating the corresponding dio line is asserted. The devices
  4061. on the bus you wish to poll should be configured beforehand with
  4062. <link LINKEND="reference-function-ppollconfig">PPollConfig()</link>.
  4063. The board must be controller-in-charge to perform a parallel poll.
  4064. </para>
  4065. </refsect1>
  4066. </refentry>
  4067. <refentry ID="reference-function-ppollconfig">
  4068. <refmeta>
  4069. <refentrytitle>PPollConfig</refentrytitle>
  4070. <manvolnum>3</manvolnum>
  4071. </refmeta>
  4072. <refnamediv>
  4073. <refname>PPollConfig</refname>
  4074. <refpurpose>configure a device's parallel poll response</refpurpose>
  4075. </refnamediv>
  4076. <refsynopsisdiv>
  4077. <funcsynopsis>
  4078. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4079. <funcprototype>
  4080. <funcdef>void <function>PPollConfig</function></funcdef>
  4081. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4082. <paramdef>Addr4882_t <parameter>address</parameter></paramdef>
  4083. <paramdef>int <parameter>dio_line</parameter></paramdef>
  4084. <paramdef>int <parameter>line_sense</parameter></paramdef>
  4085. </funcprototype>
  4086. </funcsynopsis>
  4087. </refsynopsisdiv>
  4088. <refsect1>
  4089. <title>
  4090. Description
  4091. </title>
  4092. <para>
  4093. PPollConfig() configures the device specified by <parameter>address</parameter>
  4094. to respond to parallel polls.
  4095. The <parameter>dio_line</parameter> (valid values are 1 through 8)
  4096. specifies which dio line the device being configured should use to send
  4097. back its parallel poll response. The <parameter>line_sense</parameter> argument
  4098. specifies the polarity of the response. If <parameter>line_sense</parameter>
  4099. is nonzero, then the specified dio line will be asserted to indicate
  4100. that the 'individual status bit' (or 'ist') is 1. If <parameter>sense</parameter>
  4101. is zero, then the specified dio line will be asserted when ist is zero.
  4102. </para>
  4103. </refsect1>
  4104. </refentry>
  4105. <refentry ID="reference-function-ppollunconfig">
  4106. <refmeta>
  4107. <refentrytitle>PPollUnconfig</refentrytitle>
  4108. <manvolnum>3</manvolnum>
  4109. </refmeta>
  4110. <refnamediv>
  4111. <refname>PPollUnconfig</refname>
  4112. <refpurpose>disable devices' parallel poll response</refpurpose>
  4113. </refnamediv>
  4114. <refsynopsisdiv>
  4115. <funcsynopsis>
  4116. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4117. <funcprototype>
  4118. <funcdef>void <function>PPollUnconfig</function></funcdef>
  4119. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4120. <paramdef>const Addr4882_t <parameter>addressList[]</parameter></paramdef>
  4121. </funcprototype>
  4122. </funcsynopsis>
  4123. </refsynopsisdiv>
  4124. <refsect1>
  4125. <title>
  4126. Description
  4127. </title>
  4128. <para>
  4129. PPollUnconfig() configures the devices specified by <parameter>addressList</parameter>
  4130. to ignore parallel polls.
  4131. </para>
  4132. </refsect1>
  4133. </refentry>
  4134. <refentry ID="reference-function-rcvrespmsg">
  4135. <refmeta>
  4136. <refentrytitle>RcvRespMsg</refentrytitle>
  4137. <manvolnum>3</manvolnum>
  4138. </refmeta>
  4139. <refnamediv>
  4140. <refname>RcvRespMsg</refname>
  4141. <refpurpose>read data</refpurpose>
  4142. </refnamediv>
  4143. <refsynopsisdiv>
  4144. <funcsynopsis>
  4145. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4146. <funcprototype>
  4147. <funcdef>void <function>RcvRespMsg</function></funcdef>
  4148. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4149. <paramdef>void *<parameter>buffer</parameter></paramdef>
  4150. <paramdef>long <parameter>count</parameter></paramdef>
  4151. <paramdef>int <parameter>termination</parameter></paramdef>
  4152. </funcprototype>
  4153. </funcsynopsis>
  4154. </refsynopsisdiv>
  4155. <refsect1>
  4156. <title>
  4157. Description
  4158. </title>
  4159. <para>
  4160. RcvRespMsg() reads data from the bus.
  4161. A device must have already been addressed as talker (and the
  4162. board as listener) before calling this function. Addressing may
  4163. be accomplished with the
  4164. <link LINKEND="reference-function-receivesetup">ReceiveSetup()</link>
  4165. function.
  4166. </para>
  4167. <para>
  4168. Up to <parameter>count</parameter> bytes are read into the array
  4169. specified by <parameter>buffer</parameter>. The <parameter>termination</parameter>
  4170. argument specifies the 8-bit end-of-string character (which must
  4171. be a value from 0 to 255) whose
  4172. reception will terminate a read. <parameter>termination</parameter>
  4173. can also be set to the 'STOPend' constant, in which case no
  4174. end-of-string character will be used. Assertion of the EOI line
  4175. will always end a read.
  4176. </para>
  4177. <para>
  4178. You may find it simpler to use the slightly higher level function
  4179. <link LINKEND="reference-function-receive">Receive()</link>, since
  4180. it does not require
  4181. addressing and reading of data to be performed separately.
  4182. </para>
  4183. </refsect1>
  4184. </refentry>
  4185. <refentry ID="reference-function-readstatusbyte">
  4186. <refmeta>
  4187. <refentrytitle>ReadStatusByte</refentrytitle>
  4188. <manvolnum>3</manvolnum>
  4189. </refmeta>
  4190. <refnamediv>
  4191. <refname>ReadStatusByte</refname>
  4192. <refpurpose>serial poll a device</refpurpose>
  4193. </refnamediv>
  4194. <refsynopsisdiv>
  4195. <funcsynopsis>
  4196. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4197. <funcprototype>
  4198. <funcdef>void <function>ReadStatusByte</function></funcdef>
  4199. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4200. <paramdef>Addr4882_t <parameter>address</parameter></paramdef>
  4201. <paramdef>short *<parameter>result</parameter></paramdef>
  4202. </funcprototype>
  4203. </funcsynopsis>
  4204. </refsynopsisdiv>
  4205. <refsect1>
  4206. <title>
  4207. Description
  4208. </title>
  4209. <para>
  4210. ReadStatusByte() causes the board specified by
  4211. the board descriptor <parameter>board_desc</parameter> to serial poll
  4212. the GPIB address specified by <parameter>address</parameter>. The
  4213. status byte is stored at the location specified by the <parameter>result</parameter>
  4214. pointer. If you wish to serial poll multiple devices, it
  4215. may be slightly more efficient to use
  4216. <link LINKEND="reference-function-allspoll">AllSPoll()</link>.
  4217. Serial polls may also be conducted with the 'traditional API' function
  4218. <link LINKEND="reference-function-ibrsp">ibrsp()</link>.
  4219. </para>
  4220. </refsect1>
  4221. </refentry>
  4222. <refentry ID="reference-function-receive">
  4223. <refmeta>
  4224. <refentrytitle>Receive</refentrytitle>
  4225. <manvolnum>3</manvolnum>
  4226. </refmeta>
  4227. <refnamediv>
  4228. <refname>Receive</refname>
  4229. <refpurpose>perform receive addressing and read data</refpurpose>
  4230. </refnamediv>
  4231. <refsynopsisdiv>
  4232. <funcsynopsis>
  4233. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4234. <funcprototype>
  4235. <funcdef>void <function>Receive</function></funcdef>
  4236. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4237. <paramdef>Addr4882_t <parameter>address</parameter></paramdef>
  4238. <paramdef>void *<parameter>buffer</parameter></paramdef>
  4239. <paramdef>long <parameter>count</parameter></paramdef>
  4240. <paramdef>int <parameter>termination</parameter></paramdef>
  4241. </funcprototype>
  4242. </funcsynopsis>
  4243. </refsynopsisdiv>
  4244. <refsect1>
  4245. <title>
  4246. Description
  4247. </title>
  4248. <para>
  4249. Receive() performs the necessary addressing, then reads data from the device
  4250. specified by <parameter>address</parameter>.
  4251. It is equivalent to a
  4252. <link LINKEND="reference-function-receivesetup">ReceiveSetup()</link>
  4253. call followed by a
  4254. <link LINKEND="reference-function-rcvrespmsg">RcvRespMsg()</link>
  4255. call.
  4256. </para>
  4257. </refsect1>
  4258. </refentry>
  4259. <refentry ID="reference-function-receivesetup">
  4260. <refmeta>
  4261. <refentrytitle>ReceiveSetup</refentrytitle>
  4262. <manvolnum>3</manvolnum>
  4263. </refmeta>
  4264. <refnamediv>
  4265. <refname>ReceiveSetup</refname>
  4266. <refpurpose>perform receive addressing</refpurpose>
  4267. </refnamediv>
  4268. <refsynopsisdiv>
  4269. <funcsynopsis>
  4270. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4271. <funcprototype>
  4272. <funcdef>void <function>ReceiveSetup</function></funcdef>
  4273. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4274. <paramdef>Addr4882_t <parameter>address</parameter></paramdef>
  4275. </funcprototype>
  4276. </funcsynopsis>
  4277. </refsynopsisdiv>
  4278. <refsect1>
  4279. <title>
  4280. Description
  4281. </title>
  4282. <para>
  4283. ReceiveSetup() addresses the device specified by <parameter>address</parameter>
  4284. as talker, and addresses the interface board as listener. A subsequent
  4285. <link LINKEND="reference-function-rcvrespmsg">RcvRespMsg()</link> call
  4286. will read data from the device.
  4287. </para>
  4288. <para>
  4289. You may find it simpler to use the slightly higher level function
  4290. <link LINKEND="reference-function-receive">Receive()</link>, since
  4291. it does not require
  4292. addressing and reading of data to be performed separately.
  4293. </para>
  4294. </refsect1>
  4295. </refentry>
  4296. <refentry ID="reference-function-resetsys">
  4297. <refmeta>
  4298. <refentrytitle>ResetSys</refentrytitle>
  4299. <manvolnum>3</manvolnum>
  4300. </refmeta>
  4301. <refnamediv>
  4302. <refname>ResetSys</refname>
  4303. <refpurpose>reset system</refpurpose>
  4304. </refnamediv>
  4305. <refsynopsisdiv>
  4306. <funcsynopsis>
  4307. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4308. <funcprototype>
  4309. <funcdef>void <function>ResetSys</function></funcdef>
  4310. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4311. <paramdef>const Addr4882_t <parameter>addressList[]</parameter></paramdef>
  4312. </funcprototype>
  4313. </funcsynopsis>
  4314. </refsynopsisdiv>
  4315. <refsect1>
  4316. <title>
  4317. Description
  4318. </title>
  4319. <para>
  4320. ResetSys() has the following effects:
  4321. <itemizedlist>
  4322. <listitem>
  4323. <para>
  4324. The remote enable bus line is asserted.
  4325. </para>
  4326. </listitem>
  4327. <listitem>
  4328. <para>
  4329. An interface clear is performed (the interface clear bus line is asserted
  4330. for at least 100 microseconds).
  4331. </para>
  4332. </listitem>
  4333. <listitem>
  4334. <para>
  4335. The device clear command is sent to all the devices on the bus.
  4336. </para>
  4337. </listitem>
  4338. <listitem>
  4339. <para>
  4340. The *RST message is sent to every device specified in the <parameter>addressList</parameter>.
  4341. </para>
  4342. </listitem>
  4343. </itemizedlist>
  4344. </para>
  4345. </refsect1>
  4346. </refentry>
  4347. <refentry ID="reference-function-send">
  4348. <refmeta>
  4349. <refentrytitle>Send</refentrytitle>
  4350. <manvolnum>3</manvolnum>
  4351. </refmeta>
  4352. <refnamediv>
  4353. <refname>Send</refname>
  4354. <refpurpose>perform send addressing and write data</refpurpose>
  4355. </refnamediv>
  4356. <refsynopsisdiv>
  4357. <funcsynopsis>
  4358. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4359. <funcprototype>
  4360. <funcdef>void <function>Send</function></funcdef>
  4361. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4362. <paramdef>Addr4882_t <parameter>address</parameter></paramdef>
  4363. <paramdef>const void *<parameter>data</parameter></paramdef>
  4364. <paramdef>long <parameter>count</parameter></paramdef>
  4365. <paramdef>int <parameter>eot_mode</parameter></paramdef>
  4366. </funcprototype>
  4367. </funcsynopsis>
  4368. </refsynopsisdiv>
  4369. <refsect1>
  4370. <title>
  4371. Description
  4372. </title>
  4373. <para>
  4374. Send() addresses the device specified by <parameter>address</parameter>
  4375. as listener, then writes data onto the bus.
  4376. It is equivalent to a
  4377. <link LINKEND="reference-function-sendlist">SendList()</link>
  4378. except it only uses a single GPIB address to specify the listener
  4379. instead of allowing an array of listeners.
  4380. </para>
  4381. </refsect1>
  4382. </refentry>
  4383. <refentry ID="reference-function-sendcmds">
  4384. <refmeta>
  4385. <refentrytitle>SendCmds</refentrytitle>
  4386. <manvolnum>3</manvolnum>
  4387. </refmeta>
  4388. <refnamediv>
  4389. <refname>SendCmds</refname>
  4390. <refpurpose>write command bytes onto bus</refpurpose>
  4391. </refnamediv>
  4392. <refsynopsisdiv>
  4393. <funcsynopsis>
  4394. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4395. <funcprototype>
  4396. <funcdef>void <function>SendCmds</function></funcdef>
  4397. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4398. <paramdef>const void *<parameter>cmds</parameter></paramdef>
  4399. <paramdef>long <parameter>count</parameter></paramdef>
  4400. </funcprototype>
  4401. </funcsynopsis>
  4402. </refsynopsisdiv>
  4403. <refsect1>
  4404. <title>
  4405. Description
  4406. </title>
  4407. <para>
  4408. SendCmds() writes <parameter>count</parameter>
  4409. <link LINKEND="reference-command-bytes">command byte</link>
  4410. onto the
  4411. the GPIB bus from the array <parameter>cmds</parameter>.
  4412. </para>
  4413. <para>
  4414. It is generally not necessary to call SendCmds(). It is provided
  4415. for advanced users who want direct, low-level access to the GPIB bus.
  4416. </para>
  4417. </refsect1>
  4418. </refentry>
  4419. <refentry ID="reference-function-senddatabytes">
  4420. <refmeta>
  4421. <refentrytitle>SendDataBytes</refentrytitle>
  4422. <manvolnum>3</manvolnum>
  4423. </refmeta>
  4424. <refnamediv>
  4425. <refname>SendDataBytes</refname>
  4426. <refpurpose>write data</refpurpose>
  4427. </refnamediv>
  4428. <refsynopsisdiv>
  4429. <funcsynopsis>
  4430. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4431. <funcprototype>
  4432. <funcdef>void <function>SendDataBytes</function></funcdef>
  4433. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4434. <paramdef>const void *<parameter>data</parameter></paramdef>
  4435. <paramdef>long <parameter>count</parameter></paramdef>
  4436. <paramdef>int <parameter>eot_mode</parameter></paramdef>
  4437. </funcprototype>
  4438. </funcsynopsis>
  4439. </refsynopsisdiv>
  4440. <refsect1>
  4441. <title>
  4442. Description
  4443. </title>
  4444. <para>
  4445. SendDataBytes() writes data to the bus.
  4446. One or more devices must have already been addressed as listener (and the
  4447. board as talker) before calling this function. Addressing may
  4448. be accomplished with the
  4449. <link LINKEND="reference-function-sendsetup">SendSetup()</link>
  4450. function.
  4451. </para>
  4452. <para>
  4453. <parameter>count</parameter> bytes are written from the array
  4454. specified by <parameter>data</parameter>. The <parameter>eot_mode</parameter>
  4455. argument specifies how the message should be terminated, and may be any of
  4456. the following values:
  4457. </para>
  4458. <para>
  4459. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="0">
  4460. <title>eot modes</title>
  4461. <tgroup COLS="3" ALIGN="left" >
  4462. <thead>
  4463. <row>
  4464. <entry>constant</entry>
  4465. <entry>value</entry>
  4466. <entry>description</entry>
  4467. </row>
  4468. </thead>
  4469. <tbody>
  4470. <row>
  4471. <entry>NULLend</entry>
  4472. <entry>0</entry>
  4473. <entry>Do not assert EOI or add a newline at the end of the write.</entry>
  4474. </row>
  4475. <row>
  4476. <entry>DABend</entry>
  4477. <entry>1</entry>
  4478. <entry>Assert EOI with the last byte of the write.</entry>
  4479. </row>
  4480. <row>
  4481. <entry>NLend</entry>
  4482. <entry>2</entry>
  4483. <entry>Append a newline, and assert EOI with the newline at the end of the write.</entry>
  4484. </row>
  4485. </tbody>
  4486. </tgroup>
  4487. </table>
  4488. </para>
  4489. <para>
  4490. You may find it simpler to use the slightly higher level functions
  4491. <link LINKEND="reference-function-send">Send()</link> or
  4492. <link LINKEND="reference-function-sendlist">SendList()</link>, since
  4493. they does not require
  4494. addressing and writing of data to be performed separately.
  4495. </para>
  4496. </refsect1>
  4497. </refentry>
  4498. <refentry ID="reference-function-sendifc">
  4499. <refmeta>
  4500. <refentrytitle>SendIFC</refentrytitle>
  4501. <manvolnum>3</manvolnum>
  4502. </refmeta>
  4503. <refnamediv>
  4504. <refname>SendIFC</refname>
  4505. <refpurpose>perform interface clear</refpurpose>
  4506. </refnamediv>
  4507. <refsynopsisdiv>
  4508. <funcsynopsis>
  4509. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4510. <funcprototype>
  4511. <funcdef>void <function>SendIFC</function></funcdef>
  4512. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4513. </funcprototype>
  4514. </funcsynopsis>
  4515. </refsynopsisdiv>
  4516. <refsect1>
  4517. <title>
  4518. Description
  4519. </title>
  4520. <para>
  4521. SendIFC() resets the GPIB bus by asserting the 'interface clear' (IFC)
  4522. bus line
  4523. for a duration of at least 100 microseconds. The board specified
  4524. by <parameter>board_desc</parameter> must be the system controller
  4525. in order to assert IFC. The interface clear causes all devices
  4526. to untalk and unlisten, puts them into
  4527. serial poll disabled state (don't worry, you will still be able
  4528. to conduct serial polls), and the board becomes
  4529. controller-in-charge.
  4530. </para>
  4531. </refsect1>
  4532. </refentry>
  4533. <refentry ID="reference-function-sendlist">
  4534. <refmeta>
  4535. <refentrytitle>SendList</refentrytitle>
  4536. <manvolnum>3</manvolnum>
  4537. </refmeta>
  4538. <refnamediv>
  4539. <refname>SendList</refname>
  4540. <refpurpose>write data to multiple devices</refpurpose>
  4541. </refnamediv>
  4542. <refsynopsisdiv>
  4543. <funcsynopsis>
  4544. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4545. <funcprototype>
  4546. <funcdef>void <function>SendList</function></funcdef>
  4547. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4548. <paramdef>const Addr4882_t <parameter>addressList[]</parameter></paramdef>
  4549. <paramdef>const void *<parameter>data</parameter></paramdef>
  4550. <paramdef>long <parameter>count</parameter></paramdef>
  4551. <paramdef>int <parameter>eot_mode</parameter></paramdef>
  4552. </funcprototype>
  4553. </funcsynopsis>
  4554. </refsynopsisdiv>
  4555. <refsect1>
  4556. <title>
  4557. Description
  4558. </title>
  4559. <para>
  4560. SendList() addresses the devices in <parameter>addressList</parameter>
  4561. as listeners, then writes the contents of the array <parameter>data</parameter>
  4562. to them.
  4563. It is equivalent to a
  4564. <link LINKEND="reference-function-sendsetup">SendSetup()</link>
  4565. call followed by a
  4566. <link LINKEND="reference-function-senddatabytes">SendDataBytes()</link>
  4567. call.
  4568. </para>
  4569. </refsect1>
  4570. </refentry>
  4571. <refentry ID="reference-function-sendllo">
  4572. <refmeta>
  4573. <refentrytitle>SendLLO</refentrytitle>
  4574. <manvolnum>3</manvolnum>
  4575. </refmeta>
  4576. <refnamediv>
  4577. <refname>SendLLO</refname>
  4578. <refpurpose>put devices into local lockout mode</refpurpose>
  4579. </refnamediv>
  4580. <refsynopsisdiv>
  4581. <funcsynopsis>
  4582. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4583. <funcprototype>
  4584. <funcdef>void <function>SendLLO</function></funcdef>
  4585. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4586. </funcprototype>
  4587. </funcsynopsis>
  4588. </refsynopsisdiv>
  4589. <refsect1>
  4590. <title>
  4591. Description
  4592. </title>
  4593. <para>
  4594. SendLLO() asserts the 'remote enable' bus line, then sends the
  4595. LLO
  4596. <link LINKEND="reference-command-bytes">command byte</link>.
  4597. Any devices currently addressed as listener will be put into
  4598. RWLS (remote with lockout state), and all other devices
  4599. will enter LWLS (local with lockout state). Local lockout means
  4600. the remote/local mode of devices cannot be changed though the
  4601. devices' front-panel controls. Unasserting the REN line should
  4602. bring the devices out of lockout state.
  4603. </para>
  4604. <para>
  4605. The
  4606. <link LINKEND="reference-function-setrwls">SetRWLS()</link>
  4607. performs a similar function, except it lets you
  4608. specifiy which devices you wish to address as listener before
  4609. sending the LLO command.
  4610. </para>
  4611. </refsect1>
  4612. </refentry>
  4613. <refentry ID="reference-function-sendsetup">
  4614. <refmeta>
  4615. <refentrytitle>SendSetup</refentrytitle>
  4616. <manvolnum>3</manvolnum>
  4617. </refmeta>
  4618. <refnamediv>
  4619. <refname>SendSetup</refname>
  4620. <refpurpose>perform send addressing</refpurpose>
  4621. </refnamediv>
  4622. <refsynopsisdiv>
  4623. <funcsynopsis>
  4624. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4625. <funcprototype>
  4626. <funcdef>void <function>SendSetup</function></funcdef>
  4627. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4628. <paramdef>const Addr4882_t <parameter>addressList[]</parameter></paramdef>
  4629. </funcprototype>
  4630. </funcsynopsis>
  4631. </refsynopsisdiv>
  4632. <refsect1>
  4633. <title>
  4634. Description
  4635. </title>
  4636. <para>
  4637. SendSetup() addresses the devices in <parameter>addressList</parameter>
  4638. as listeners, and addresses the interface board as talker.
  4639. A subsequent
  4640. <link LINKEND="reference-function-senddatabytes">SendDataBytes()</link> call
  4641. will write data to the devices.
  4642. </para>
  4643. <para>
  4644. You may find it simpler to use the slightly higher level functions
  4645. <link LINKEND="reference-function-send">Send()</link> or
  4646. <link LINKEND="reference-function-sendlist">SendList()</link>, since
  4647. they does not require
  4648. addressing and writing of data to be performed separately.
  4649. </para>
  4650. </refsect1>
  4651. </refentry>
  4652. <refentry ID="reference-function-setrwls">
  4653. <refmeta>
  4654. <refentrytitle>SetRWLS</refentrytitle>
  4655. <manvolnum>3</manvolnum>
  4656. </refmeta>
  4657. <refnamediv>
  4658. <refname>SetRWLS</refname>
  4659. <refpurpose>put devices into remote with lockout state</refpurpose>
  4660. </refnamediv>
  4661. <refsynopsisdiv>
  4662. <funcsynopsis>
  4663. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4664. <funcprototype>
  4665. <funcdef>void <function>SetRWLS</function></funcdef>
  4666. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4667. <paramdef>const Addr4882_t <parameter>addressList[]</parameter></paramdef>
  4668. </funcprototype>
  4669. </funcsynopsis>
  4670. </refsynopsisdiv>
  4671. <refsect1>
  4672. <title>
  4673. Description
  4674. </title>
  4675. <para>
  4676. SetRWLS() asserts the 'remote enable' bus line,
  4677. addresses the devices in the <parameter>addressList</parameter>
  4678. array as listeners, then sends the
  4679. LLO
  4680. <link LINKEND="reference-command-bytes">command byte</link>.
  4681. The devices addressed as listener will be put into
  4682. RWLS (remote with lockout state), and all other devices
  4683. will enter LWLS (local with lockout state). Local lockout means
  4684. the remote/local mode of devices cannot be changed though the
  4685. devices' front-panel controls. Unasserting the REN line should
  4686. bring the devices out of the lockout state.
  4687. </para>
  4688. </refsect1>
  4689. </refentry>
  4690. <refentry ID="reference-function-testsrq">
  4691. <refmeta>
  4692. <refentrytitle>TestSRQ</refentrytitle>
  4693. <manvolnum>3</manvolnum>
  4694. </refmeta>
  4695. <refnamediv>
  4696. <refname>TestSRQ</refname>
  4697. <refpurpose>query state of SRQ bus line</refpurpose>
  4698. </refnamediv>
  4699. <refsynopsisdiv>
  4700. <funcsynopsis>
  4701. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4702. <funcprototype>
  4703. <funcdef>void <function>TestSRQ</function></funcdef>
  4704. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4705. <paramdef>short *<parameter>result</parameter></paramdef>
  4706. </funcprototype>
  4707. </funcsynopsis>
  4708. </refsynopsisdiv>
  4709. <refsect1>
  4710. <title>
  4711. Description
  4712. </title>
  4713. <para>
  4714. TestSRQ() checks the state of the SRQ
  4715. <link LINKEND="gpib-protocol-bus-lines">bus line</link> and
  4716. writes its state to the location specified by <parameter>result</parameter>.
  4717. A '1' indicates the SRQ line is asserted, and a '0' indicates
  4718. the line is not asserted.
  4719. </para>
  4720. <para>
  4721. Some boards lack the capability to report the status of the SRQ
  4722. line. In such a case, an ECAP error is returned in
  4723. <link LINKEND="reference-globals-iberr">iberr</link>.
  4724. </para>
  4725. </refsect1>
  4726. </refentry>
  4727. <refentry ID="reference-function-testsys">
  4728. <refmeta>
  4729. <refentrytitle>TestSys</refentrytitle>
  4730. <manvolnum>3</manvolnum>
  4731. </refmeta>
  4732. <refnamediv>
  4733. <refname>TestSys</refname>
  4734. <refpurpose>perform self-test queries on devices</refpurpose>
  4735. </refnamediv>
  4736. <refsynopsisdiv>
  4737. <funcsynopsis>
  4738. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4739. <funcprototype>
  4740. <funcdef>void <function>TestSys</function></funcdef>
  4741. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4742. <paramdef>const Addr4882_t <parameter>addressList[]</parameter></paramdef>
  4743. <paramdef>short <parameter>results[]</parameter></paramdef>
  4744. </funcprototype>
  4745. </funcsynopsis>
  4746. </refsynopsisdiv>
  4747. <refsect1>
  4748. <title>
  4749. Description
  4750. </title>
  4751. <para>
  4752. TestSys() sends the '*TST?' message to all the devices in the
  4753. <parameter>addressList</parameter> array, then reads their
  4754. responses into the <parameter>results</parameter> array.
  4755. This will cause devices that conform to the IEEE 488.2 standard
  4756. to perform a self-test and respond with a zero on success.
  4757. A non-zero response indicates an error during the self-test.
  4758. </para>
  4759. <para>
  4760. The number of devices which responded with nonzero values from
  4761. their self-tests is returned in
  4762. <link LINKEND="reference-globals-ibcnt">ibcnt and ibcntl</link>.
  4763. If a device fails to respond to the *TST? query, an error
  4764. will be flagged in
  4765. <link LINKEND="reference-globals-ibsta">ibsta</link> (this
  4766. is different than NI's documented behaviour which is broken).
  4767. </para>
  4768. </refsect1>
  4769. </refentry>
  4770. <refentry ID="reference-function-trigger">
  4771. <refmeta>
  4772. <refentrytitle>Trigger</refentrytitle>
  4773. <manvolnum>3</manvolnum>
  4774. </refmeta>
  4775. <refnamediv>
  4776. <refname>Trigger</refname>
  4777. <refpurpose>trigger a device</refpurpose>
  4778. </refnamediv>
  4779. <refsynopsisdiv>
  4780. <funcsynopsis>
  4781. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4782. <funcprototype>
  4783. <funcdef>void <function>Trigger</function></funcdef>
  4784. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4785. <paramdef>Addr4882_t <parameter>address</parameter></paramdef>
  4786. </funcprototype>
  4787. </funcsynopsis>
  4788. </refsynopsisdiv>
  4789. <refsect1>
  4790. <title>
  4791. Description
  4792. </title>
  4793. <para>
  4794. Trigger() is equivalent to a
  4795. <link LINKEND="reference-function-triggerlist">TriggerList()</link>
  4796. call with a single address.
  4797. </para>
  4798. </refsect1>
  4799. </refentry>
  4800. <refentry ID="reference-function-triggerlist">
  4801. <refmeta>
  4802. <refentrytitle>TriggerList</refentrytitle>
  4803. <manvolnum>3</manvolnum>
  4804. </refmeta>
  4805. <refnamediv>
  4806. <refname>Trigger</refname>
  4807. <refpurpose>trigger multiple devices</refpurpose>
  4808. </refnamediv>
  4809. <refsynopsisdiv>
  4810. <funcsynopsis>
  4811. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4812. <funcprototype>
  4813. <funcdef>void <function>TriggerList</function></funcdef>
  4814. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4815. <paramdef>Addr4882_t <parameter>addressList[]</parameter></paramdef>
  4816. </funcprototype>
  4817. </funcsynopsis>
  4818. </refsynopsisdiv>
  4819. <refsect1>
  4820. <title>
  4821. Description
  4822. </title>
  4823. <para>
  4824. TriggerList() sends a GET (group execute trigger)
  4825. <link LINKEND="reference-command-bytes">command byte</link> to all
  4826. the
  4827. devices specified in the <parameter>addressList</parameter> array.
  4828. If no addresses are specified in <parameter>addressList</parameter>
  4829. then the GET command byte is sent without performing any addressing.
  4830. </para>
  4831. </refsect1>
  4832. </refentry>
  4833. <refentry ID="reference-function-waitsrq">
  4834. <refmeta>
  4835. <refentrytitle>WaitSRQ</refentrytitle>
  4836. <manvolnum>3</manvolnum>
  4837. </refmeta>
  4838. <refnamediv>
  4839. <refname>WaitSRQ</refname>
  4840. <refpurpose>sleep until the SRQ bus line is asserted</refpurpose>
  4841. </refnamediv>
  4842. <refsynopsisdiv>
  4843. <funcsynopsis>
  4844. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4845. <funcprototype>
  4846. <funcdef>void <function>WaitSRQ</function></funcdef>
  4847. <paramdef>int <parameter>board_desc</parameter></paramdef>
  4848. <paramdef>short *<parameter>result</parameter></paramdef>
  4849. </funcprototype>
  4850. </funcsynopsis>
  4851. </refsynopsisdiv>
  4852. <refsect1>
  4853. <title>
  4854. Description
  4855. </title>
  4856. <para>
  4857. WaitSRQ() sleeps until either the SRQ
  4858. <link LINKEND="gpib-protocol-bus-lines">bus line</link> is
  4859. asserted, or a timeout (see <link LINKEND="reference-function-ibtmo">ibtmo()</link>)
  4860. occurs. A '1' will be written to the location specified by
  4861. <parameter>result</parameter> if SRQ was asserted, and a
  4862. '0' will be written if the function timed out.
  4863. </para>
  4864. </refsect1>
  4865. </refentry>
  4866. </section>
  4867. <section>
  4868. <title>
  4869. Utility Functions
  4870. </title>
  4871. <refentry ID="reference-function-get-pad">
  4872. <refmeta>
  4873. <refentrytitle>GetPAD</refentrytitle>
  4874. <manvolnum>3</manvolnum>
  4875. </refmeta>
  4876. <refnamediv>
  4877. <refname>GetPAD</refname>
  4878. <refpurpose>extract primary address from an Addr4882_t value</refpurpose>
  4879. </refnamediv>
  4880. <refsynopsisdiv>
  4881. <funcsynopsis>
  4882. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4883. <funcprototype>
  4884. <funcdef>static __inline__ unsigned int <function>GetPAD</function></funcdef>
  4885. <paramdef>Addr4882_t <parameter>address</parameter></paramdef>
  4886. </funcprototype>
  4887. </funcsynopsis>
  4888. </refsynopsisdiv>
  4889. <refsect1>
  4890. <title>
  4891. Description
  4892. </title>
  4893. <para>
  4894. GetPAD() extracts the primary address packed into the Addr4882_t
  4895. value <parameter>address</parameter>.
  4896. </para>
  4897. </refsect1>
  4898. <refsect1>
  4899. <title>
  4900. Return value
  4901. </title>
  4902. <para>
  4903. The primary GPIB address (from 0 through 30) stored in <parameter>address</parameter>.
  4904. </para>
  4905. </refsect1>
  4906. </refentry>
  4907. <refentry ID="reference-function-get-sad">
  4908. <refmeta>
  4909. <refentrytitle>GetSAD</refentrytitle>
  4910. <manvolnum>3</manvolnum>
  4911. </refmeta>
  4912. <refnamediv>
  4913. <refname>GetSAD</refname>
  4914. <refpurpose>extract secondary address from an Addr4882_t value</refpurpose>
  4915. </refnamediv>
  4916. <refsynopsisdiv>
  4917. <funcsynopsis>
  4918. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4919. <funcprototype>
  4920. <funcdef>static __inline__ unsigned int <function>GetSAD</function></funcdef>
  4921. <paramdef>Addr4882_t <parameter>address</parameter></paramdef>
  4922. </funcprototype>
  4923. </funcsynopsis>
  4924. </refsynopsisdiv>
  4925. <refsect1>
  4926. <title>
  4927. Description
  4928. </title>
  4929. <para>
  4930. GetSAD() extracts the secondary address packed into the Addr4882_t
  4931. value <parameter>address</parameter>.
  4932. </para>
  4933. </refsect1>
  4934. <refsect1>
  4935. <title>
  4936. Return value
  4937. </title>
  4938. <para>
  4939. The secondary GPIB address (from 0x60 through 0x7e, or 0 for none) stored in
  4940. <parameter>address</parameter>.
  4941. </para>
  4942. </refsect1>
  4943. </refentry>
  4944. <refentry ID="reference-function-make-addr">
  4945. <refmeta>
  4946. <refentrytitle>MakeAddr</refentrytitle>
  4947. <manvolnum>3</manvolnum>
  4948. </refmeta>
  4949. <refnamediv>
  4950. <refname>MakeAddr</refname>
  4951. <refpurpose>pack primary and secondary address into an Addr4882_t value</refpurpose>
  4952. </refnamediv>
  4953. <refsynopsisdiv>
  4954. <funcsynopsis>
  4955. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  4956. <funcprototype>
  4957. <funcdef>static __inline__ Addr4882_t <function>MakeAddr</function></funcdef>
  4958. <paramdef>unsigned int <parameter>pad</parameter></paramdef>
  4959. <paramdef>unsigned int <parameter>sad</parameter></paramdef>
  4960. </funcprototype>
  4961. </funcsynopsis>
  4962. </refsynopsisdiv>
  4963. <refsect1>
  4964. <title>
  4965. Description
  4966. </title>
  4967. <para>
  4968. MakeAddr() generates an Addr4882_t value that corresponds to the
  4969. specified primary address <parameter>pad</parameter> and secondary
  4970. address <parameter>sad</parameter>. It does so by putting
  4971. <parameter>pad</parameter> into the least significant byte and
  4972. left shifting <parameter>sad</parameter> up to the next byte.
  4973. </para>
  4974. </refsect1>
  4975. <refsect1>
  4976. <title>
  4977. Examples
  4978. </title>
  4979. <programlisting>
  4980. Addr4882_t addressList[ 5 ];
  4981. addressList[ 0 ] = 5 /* primary address 5, no secondary address */
  4982. addressList[ 1 ] = MakeAddr(3, 0); /* primary address 3, no secondary address */
  4983. addressList[ 2 ] = MakeAddr(7, 0x70); /* primary address 3, secondary address 16 */
  4984. addressList[ 3 ] = MakeAddr(20, MSA(9)); /* primary address 20, secondary address 9 */
  4985. addressList[ 4 ] = NOADDR;
  4986. </programlisting>
  4987. </refsect1>
  4988. <refsect1>
  4989. <title>
  4990. Return value
  4991. </title>
  4992. <para>
  4993. An Addr4882_t value corresponding to the specified primary and
  4994. secondary GPIB address.
  4995. </para>
  4996. </refsect1>
  4997. </refentry>
  4998. <refentry ID="reference-function-mla">
  4999. <refmeta>
  5000. <refentrytitle>MLA</refentrytitle>
  5001. <manvolnum>3</manvolnum>
  5002. </refmeta>
  5003. <refnamediv>
  5004. <refname>MLA</refname>
  5005. <refpurpose>generate 'my listen address' command byte</refpurpose>
  5006. </refnamediv>
  5007. <refsynopsisdiv>
  5008. <funcsynopsis>
  5009. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  5010. <funcprototype>
  5011. <funcdef>uint8_t <function>MLA</function></funcdef>
  5012. <paramdef>unsigned int <parameter>address</parameter></paramdef>
  5013. </funcprototype>
  5014. </funcsynopsis>
  5015. </refsynopsisdiv>
  5016. <refsect1>
  5017. <title>
  5018. Description
  5019. </title>
  5020. <para>
  5021. MLA() returns a 'my listen address'
  5022. <link LINKEND="reference-command-bytes">command byte</link> corresponding
  5023. to the <parameter>address</parameter> argument. The <parameter>address</parameter>
  5024. my be between 0 and 30.
  5025. </para>
  5026. </refsect1>
  5027. <refsect1>
  5028. <title>
  5029. Return value
  5030. </title>
  5031. <para>
  5032. The appropriate MLA command byte is returned.
  5033. </para>
  5034. </refsect1>
  5035. </refentry>
  5036. <refentry ID="reference-function-msa">
  5037. <refmeta>
  5038. <refentrytitle>MSA</refentrytitle>
  5039. <manvolnum>3</manvolnum>
  5040. </refmeta>
  5041. <refnamediv>
  5042. <refname>MSA</refname>
  5043. <refpurpose>generate 'my secondary address' command byte</refpurpose>
  5044. </refnamediv>
  5045. <refsynopsisdiv>
  5046. <funcsynopsis>
  5047. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  5048. <funcprototype>
  5049. <funcdef>uint8_t <function>MSA</function></funcdef>
  5050. <paramdef>unsigned int <parameter>address</parameter></paramdef>
  5051. </funcprototype>
  5052. </funcsynopsis>
  5053. </refsynopsisdiv>
  5054. <refsect1>
  5055. <title>
  5056. Description
  5057. </title>
  5058. <para>
  5059. MSA() returns a 'my secondary address'
  5060. <link LINKEND="reference-command-bytes">command byte</link> corresponding
  5061. to the <parameter>address</parameter> argument. The <parameter>address</parameter>
  5062. my be between 0 and 30. This macro is also useful for mangling
  5063. secondary addresses from the 'real' values between 0 and 30 to the
  5064. range 0x60 to 0x7e used by most of the library's functions.
  5065. </para>
  5066. </refsect1>
  5067. <refsect1>
  5068. <title>
  5069. Return value
  5070. </title>
  5071. <para>
  5072. The appropriate MSA command byte is returned.
  5073. </para>
  5074. </refsect1>
  5075. </refentry>
  5076. <refentry ID="reference-function-mta">
  5077. <refmeta>
  5078. <refentrytitle>MTA</refentrytitle>
  5079. <manvolnum>3</manvolnum>
  5080. </refmeta>
  5081. <refnamediv>
  5082. <refname>MTA</refname>
  5083. <refpurpose>generate 'my talk address' command byte</refpurpose>
  5084. </refnamediv>
  5085. <refsynopsisdiv>
  5086. <funcsynopsis>
  5087. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  5088. <funcprototype>
  5089. <funcdef>uint8_t <function>MTA</function></funcdef>
  5090. <paramdef>unsigned int <parameter>address</parameter></paramdef>
  5091. </funcprototype>
  5092. </funcsynopsis>
  5093. </refsynopsisdiv>
  5094. <refsect1>
  5095. <title>
  5096. Description
  5097. </title>
  5098. <para>
  5099. MTA() returns a 'my talk address'
  5100. <link LINKEND="reference-command-bytes">command byte</link> corresponding
  5101. to the <parameter>address</parameter> argument. The <parameter>address</parameter>
  5102. my be between 0 and 30.
  5103. </para>
  5104. </refsect1>
  5105. <refsect1>
  5106. <title>
  5107. Return value
  5108. </title>
  5109. <para>
  5110. The appropriate MTA command byte is returned.
  5111. </para>
  5112. </refsect1>
  5113. </refentry>
  5114. <refentry ID="reference-function-ppe-byte">
  5115. <refmeta>
  5116. <refentrytitle>PPE_byte</refentrytitle>
  5117. <manvolnum>3</manvolnum>
  5118. </refmeta>
  5119. <refnamediv>
  5120. <refname>PPE_byte</refname>
  5121. <refpurpose>generate 'parallel poll enable' command byte</refpurpose>
  5122. </refnamediv>
  5123. <refsynopsisdiv>
  5124. <funcsynopsis>
  5125. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  5126. <funcprototype>
  5127. <funcdef>uint8_t <function>PPE_byte</function></funcdef>
  5128. <paramdef>unsigned int <parameter>dio_line</parameter></paramdef>
  5129. <paramdef>int <parameter>sense</parameter></paramdef>
  5130. </funcprototype>
  5131. </funcsynopsis>
  5132. </refsynopsisdiv>
  5133. <refsect1>
  5134. <title>
  5135. Description
  5136. </title>
  5137. <para>
  5138. PPE_byte() returns a 'parallel poll enable'
  5139. <link LINKEND="reference-command-bytes">command byte</link> corresponding
  5140. to the <parameter>dio_line</parameter> and <parameter>sense</parameter>
  5141. arguments. The <parameter>dio_line</parameter> (valid values are 1 through 8)
  5142. specifies which dio line the device being configured should use to send
  5143. back its parallel poll response. The <parameter>sense</parameter> argument
  5144. specifies the polarity of the response. If <parameter>sense</parameter>
  5145. is nonzero, then the specified dio line will be asserted to indicate
  5146. that the 'individual status bit' (or 'ist') is 1. If <parameter>sense</parameter>
  5147. is zero, then the specified dio line will be asserted when ist is zero.
  5148. </para>
  5149. </refsect1>
  5150. <refsect1>
  5151. <title>
  5152. Return value
  5153. </title>
  5154. <para>
  5155. The appropriate PPE command byte is returned.
  5156. </para>
  5157. </refsect1>
  5158. </refentry>
  5159. <refentry ID="reference-function-thread-ibcnt">
  5160. <refmeta>
  5161. <refentrytitle>ThreadIbcnt and ThreadIbcntl</refentrytitle>
  5162. <manvolnum>3</manvolnum>
  5163. </refmeta>
  5164. <refnamediv>
  5165. <refname>ThreadIbcnt and ThreadIbcntl</refname>
  5166. <refpurpose>thread-specific ibcnt and ibcntl values</refpurpose>
  5167. </refnamediv>
  5168. <refsynopsisdiv>
  5169. <funcsynopsis>
  5170. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  5171. <funcprototype>
  5172. <funcdef>int <function>ThreadIbcnt</function></funcdef>
  5173. <paramdef>void</paramdef>
  5174. </funcprototype>
  5175. <funcprototype>
  5176. <funcdef>long <function>ThreadIbcntl</function></funcdef>
  5177. <paramdef>void</paramdef>
  5178. </funcprototype>
  5179. </funcsynopsis>
  5180. </refsynopsisdiv>
  5181. <refsect1>
  5182. <title>
  5183. Description
  5184. </title>
  5185. <para>
  5186. ThreadIbcnt() and ThreadIbcntl() return thread-local versions
  5187. of the global
  5188. variables <link LINKEND="reference-globals-ibcnt">ibcnt and ibcntl</link>.
  5189. </para>
  5190. </refsect1>
  5191. <refsect1>
  5192. <title>
  5193. Return value
  5194. </title>
  5195. <para>
  5196. The value of <link LINKEND="reference-globals-ibcnt">ibcnt or ibcntl</link>
  5197. corresponding to the last 'traditional' or 'multidevice' function
  5198. called in the current thread is returned.
  5199. </para>
  5200. </refsect1>
  5201. </refentry>
  5202. <refentry ID="reference-function-thread-iberr">
  5203. <refmeta>
  5204. <refentrytitle>ThreadIberr</refentrytitle>
  5205. <manvolnum>3</manvolnum>
  5206. </refmeta>
  5207. <refnamediv>
  5208. <refname>ThreadIberr</refname>
  5209. <refpurpose>thread-specific iberr value</refpurpose>
  5210. </refnamediv>
  5211. <refsynopsisdiv>
  5212. <funcsynopsis>
  5213. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  5214. <funcprototype>
  5215. <funcdef>int <function>ThreadIberr</function></funcdef>
  5216. <paramdef>void</paramdef>
  5217. </funcprototype>
  5218. </funcsynopsis>
  5219. </refsynopsisdiv>
  5220. <refsect1>
  5221. <title>
  5222. Description
  5223. </title>
  5224. <para>
  5225. ThreadIberr() returns a thread-local version of the global
  5226. variable <link LINKEND="reference-globals-iberr">iberr</link>.
  5227. </para>
  5228. </refsect1>
  5229. <refsect1>
  5230. <title>
  5231. Return value
  5232. </title>
  5233. <para>
  5234. The value of <link LINKEND="reference-globals-iberr">iberr</link>
  5235. corresponding to the last 'traditional' or 'multidevice' function
  5236. called by the current thread is returned.
  5237. </para>
  5238. </refsect1>
  5239. </refentry>
  5240. <refentry ID="reference-function-thread-ibsta">
  5241. <refmeta>
  5242. <refentrytitle>ThreadIbsta</refentrytitle>
  5243. <manvolnum>3</manvolnum>
  5244. </refmeta>
  5245. <refnamediv>
  5246. <refname>ThreadIbsta</refname>
  5247. <refpurpose>thread-specific ibsta value</refpurpose>
  5248. </refnamediv>
  5249. <refsynopsisdiv>
  5250. <funcsynopsis>
  5251. <funcsynopsisinfo>#include &lt;gpib/ib.h&gt;</funcsynopsisinfo>
  5252. <funcprototype>
  5253. <funcdef>int <function>ThreadIbsta</function></funcdef>
  5254. <paramdef>void</paramdef>
  5255. </funcprototype>
  5256. </funcsynopsis>
  5257. </refsynopsisdiv>
  5258. <refsect1>
  5259. <title>
  5260. Description
  5261. </title>
  5262. <para>
  5263. ThreadIbsta() returns a thread-local version of the global
  5264. variable <link LINKEND="reference-globals-ibsta">ibsta</link>.
  5265. </para>
  5266. </refsect1>
  5267. <refsect1>
  5268. <title>
  5269. Return value
  5270. </title>
  5271. <para>
  5272. The value of <link LINKEND="reference-globals-ibsta">ibsta</link>
  5273. corresponding to the last 'traditional' or 'multidevice' function
  5274. called by the current thread is returned.
  5275. </para>
  5276. </refsect1>
  5277. </refentry>
  5278. </section>
  5279. </section>
  5280. <section ID="gpib-protocol">
  5281. <title>GPIB protocol</title>
  5282. <section ID="reference-command-bytes">
  5283. <title>GPIB command bytes</title>
  5284. <para>
  5285. The meaning and values of the possible GPIB command bytes
  5286. are as follows:
  5287. </para>
  5288. <para>
  5289. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="1">
  5290. <title>GPIB command bytes</title>
  5291. <tgroup COLS="3" ALIGN="left" >
  5292. <thead>
  5293. <row>
  5294. <entry>byte value (hexadecimal)</entry>
  5295. <entry>name</entry>
  5296. <entry>description</entry>
  5297. </row>
  5298. </thead>
  5299. <tbody>
  5300. <row>
  5301. <entry>0x1</entry>
  5302. <entry>GTL</entry>
  5303. <entry>Go to local</entry>
  5304. </row>
  5305. <row>
  5306. <entry>0x4</entry>
  5307. <entry>SDC</entry>
  5308. <entry>Selected device clear</entry>
  5309. </row>
  5310. <row>
  5311. <entry>0x5</entry>
  5312. <entry>PPConfig (also 'PPC' on non-powerpc architectures)</entry>
  5313. <entry>Parallel poll configure</entry>
  5314. </row>
  5315. <row>
  5316. <entry>0x8</entry>
  5317. <entry>GET</entry>
  5318. <entry>Group execute trigger</entry>
  5319. </row>
  5320. <row>
  5321. <entry>0x9</entry>
  5322. <entry>TCT</entry>
  5323. <entry>Take control</entry>
  5324. </row>
  5325. <row>
  5326. <entry>0x11</entry>
  5327. <entry>LLO</entry>
  5328. <entry>Local lockout</entry>
  5329. </row>
  5330. <row>
  5331. <entry>0x14</entry>
  5332. <entry>DCL</entry>
  5333. <entry>Device clear</entry>
  5334. </row>
  5335. <row>
  5336. <entry>0x15</entry>
  5337. <entry>PPU</entry>
  5338. <entry>Parallel poll unconfigure</entry>
  5339. </row>
  5340. <row>
  5341. <entry>0x18</entry>
  5342. <entry>SPE</entry>
  5343. <entry>Serial poll enable</entry>
  5344. </row>
  5345. <row>
  5346. <entry>0x19</entry>
  5347. <entry>SPD</entry>
  5348. <entry>Serial poll disable</entry>
  5349. </row>
  5350. <row>
  5351. <entry>0x20 to 0x3e</entry>
  5352. <entry>MLA0 to MLA30</entry>
  5353. <entry>My (primary) listen address 0 to 30</entry>
  5354. </row>
  5355. <row>
  5356. <entry>0x3f</entry>
  5357. <entry>UNL</entry>
  5358. <entry>Unlisten</entry>
  5359. </row>
  5360. <row>
  5361. <entry>0x40 to 0x5e</entry>
  5362. <entry>MTA0 to MTA30</entry>
  5363. <entry>My (primary) talk address 0 to 30</entry>
  5364. </row>
  5365. <row>
  5366. <entry>0x5f</entry>
  5367. <entry>UNT</entry>
  5368. <entry>Untalk</entry>
  5369. </row>
  5370. <row>
  5371. <entry>0x60 to 0x6f</entry>
  5372. <entry>MSA0 to MSA15, also PPE</entry>
  5373. <entry>When following a talk or listen address, this is
  5374. 'my secondary address' 0 to 15. When following a parallel
  5375. poll configure, this is 'parallel poll enable'. For
  5376. parallel poll enable, the least significant 3 bits
  5377. of the command byte specify which DIO line the device
  5378. should use to send its parallel poll response. The
  5379. fourth least significant bit (0x8)
  5380. indicates the 'sense' or polarity the device should use
  5381. when responding.
  5382. </entry>
  5383. </row>
  5384. <row>
  5385. <entry>0x70 to 0x7d</entry>
  5386. <entry>MSA16 to MSA29, also PPD</entry>
  5387. <entry>When following a talk or listen address, this is
  5388. 'my secondary address' 16 to 29. When following a parallel
  5389. poll configure, this is 'parallel poll disable'.</entry>
  5390. </row>
  5391. <row>
  5392. <entry>0x7e</entry>
  5393. <entry>MSA30</entry>
  5394. <entry>My secondary address 30</entry>
  5395. </row>
  5396. </tbody>
  5397. </tgroup>
  5398. </table>
  5399. </para>
  5400. </section>
  5401. <section ID="gpib-protocol-bus-lines">
  5402. <title>GPIB bus lines</title>
  5403. <para>
  5404. Physically, the GPIB bus consists of 8 data lines, 3 handshaking
  5405. lines, and 5 control lines (and 8 ground
  5406. lines). Brief descriptions
  5407. of how they are used follow:
  5408. </para>
  5409. <para>
  5410. <table COLSEP="1" ROWSEP="1" ORIENT="port" PGWIDE="1">
  5411. <title>GPIB bus lines</title>
  5412. <tgroup COLS="3" ALIGN="left" >
  5413. <thead>
  5414. <row>
  5415. <entry>bus line</entry>
  5416. <entry>description</entry>
  5417. <entry>pin number</entry>
  5418. </row>
  5419. </thead>
  5420. <tbody>
  5421. <row>
  5422. <entry>DIO1 through DIO8</entry>
  5423. <entry>Data input/output bits. These 8 lines are used to read and write the 8 bits
  5424. of a data or command byte that is being sent over the bus.</entry>
  5425. <entry>DIO1 to DIO4 use pins 1 to 4, DIO5 to DIO8 use pins 13 to 16</entry>
  5426. </row>
  5427. <row>
  5428. <entry>EOI</entry>
  5429. <entry>End-or-identify. This line is asserted with the last byte of
  5430. data during a write, to indicate the end of the message. It can
  5431. also be asserted along with the ATN line to conduct a parallel poll.</entry>
  5432. <entry>5</entry>
  5433. </row>
  5434. <row>
  5435. <entry>DAV</entry>
  5436. <entry>Data valid. This is a handshaking line, used to signal that
  5437. the value being sent with DIO1-DIO8 is valid. During transfers the
  5438. DIO1-DIO8 lines are set, then the DAV line is asserted after
  5439. a delay called the 'T1 delay'. The T1 delay lets the data lines
  5440. settle to stable values before they are read.</entry>
  5441. <entry>6</entry>
  5442. </row>
  5443. <row>
  5444. <entry>NRFD</entry>
  5445. <entry>Not ready for data. NRFD is a handshaking line asserted by
  5446. listeners to indicate
  5447. they are not ready to receive a new data byte.</entry>
  5448. <entry>7</entry>
  5449. </row>
  5450. <row>
  5451. <entry>NDAC</entry>
  5452. <entry>Not data accepted. NDAC is a handshaking line asserted by
  5453. listeners to indicate
  5454. they have not yet read the byte contained on the DIO lines.</entry>
  5455. <entry>8</entry>
  5456. </row>
  5457. <row>
  5458. <entry>IFC</entry>
  5459. <entry>Interface clear. The system controller can assert this line
  5460. (it should be asserted for at least 100 microseconds) to reset
  5461. the bus and make itself controller-in-charge.</entry>
  5462. <entry>9</entry>
  5463. </row>
  5464. <row>
  5465. <entry>SRQ</entry>
  5466. <entry>Service request. Devices on the bus can assert this line
  5467. to request service from the controller-in-charge. The controller
  5468. can then poll the devices until it finds the device requesting
  5469. service, and perform whatever action is necessary.</entry>
  5470. <entry>10</entry>
  5471. </row>
  5472. <row>
  5473. <entry>ATN</entry>
  5474. <entry>Attention. ATN is asserted to indicate that the DIO lines
  5475. contain a <link LINKEND="reference-command-bytes">command byte</link>
  5476. (as opposed to a data byte). Also, it is asserted with EOI
  5477. when conducting parallel polls.</entry>
  5478. <entry>11</entry>
  5479. </row>
  5480. <row>
  5481. <entry>REN</entry>
  5482. <entry>Remote enable. Asserted by the system controller, it enables
  5483. devices to enter remote mode. When REN is asserted, a device will
  5484. enter remote mode when it is addressed by the controller. When
  5485. REN is false, all devices will immediately return to local mode.
  5486. </entry>
  5487. <entry>17</entry>
  5488. </row>
  5489. </tbody>
  5490. </tgroup>
  5491. </table>
  5492. </para>
  5493. </section>
  5494. </section>
  5495. &license
  5496. </article>