Re: Working with secondary addresses

dave penkler <[email protected]> Tue, 24 Mar 2026 17:33:01 +0100
Newsgroups gmane.linux.hardware.gpib.general
Message-ID <CAL=kjP0nmASatE=HEfq1rQc3pp+P=cV6bfmjynMzfKDhdXTB0g@mail.gmail.com>
--===============5880255753963761630==
Content-Type: multipart/alternative; boundary="00000000000023f737064dc7b5ec"

--00000000000023f737064dc7b5ec
Content-Type: text/plain; charset="UTF-8"

>
>> I initially tried doing this with Python, but quickly found that the ib*
>> commands in the reference do not correlate to the Python gpib module,
>> and that the pythin gpib module does not have methods for writing to or
>> reading from secondary addresses.
>
>
Just checked the python extension and you can use (ib)dev in the same way
as perl.
import sys
sys.path.append('/usr/local/lib64/python3.9/site-packages') # or wherever
they are
import gpib
devw=gpib.dev(0, 5, 0x7B, 12, 1, 0)
devr=gpib.dev(0, 5, 0x6D, 12, 1, 0)
gpib.write(devw,"1\r")
result=gpib.read(devr, 100)
print result
print "\n"

--00000000000023f737064dc7b5ec
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_quote gmail_quote_container"><div><br>=
</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b=
order-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=3D"gmail=
_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex=
;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
I initially tried doing this with Python, but quickly found that the ib* <b=
r>
commands in the reference do not correlate to the Python gpib module, <br>
and that the pythin gpib module does not have methods for writing to or <br=
>
reading from secondary addresses.</blockquote></div></blockquote><div>=C2=
=A0</div><div>Just checked the python extension and you can use (ib)dev in =
the same way as perl.</div><div><font face=3D"monospace">import sys<br>sys.=
path.append(&#39;/usr/local/lib64/python3.9/site-packages&#39;) # or wherev=
er they are<br>import gpib</font></div><div><font face=3D"monospace">devw=
=3D<a href=3D"http://gpib.dev">gpib.dev</a>(0, 5, 0x7B, 12, 1, 0)</font></d=
iv><div><font face=3D"monospace">devr=3D<a href=3D"http://gpib.dev">gpib.de=
v</a>(0, 5, 0x6D, 12, 1, 0)</font></div><div><font face=3D"monospace">gpib.=
write(devw,&quot;1\r&quot;)</font></div><div><font face=3D"monospace">resul=
t=3Dgpib.read(devr, 100)</font></div><div><font face=3D"monospace">print re=
sult</font></div><div><font face=3D"monospace">print &quot;\n&quot;</font><=
/div></div></div>

--00000000000023f737064dc7b5ec--


--===============5880255753963761630==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============5880255753963761630==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Linux-gpib-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-gpib-general

--===============5880255753963761630==--