Re: Working with secondary addresses
John <[email protected]> Thu, 26 Mar 2026 13:31:46 +0000
| Newsgroups | gmane.linux.hardware.gpib.general |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--===============7135490685491181317==
Content-Type: multipart/alternative;
boundary="------------1GenX6gsw0JjLtYhVNKAC0RO"
Content-Language: en-US
This is a multi-part message in MIME format.
--------------1GenX6gsw0JjLtYhVNKAC0RO
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Dave,
Thank you for spotting my mistake. Yes it should be 0x7B not 0x73. I
tried changing the 0x73 to 0x7B but unfortunately still get the same
error. I also tried the decimal equivalents of the HEX value. Same result.
If I run the Perl script, I see the bytes 3F 20 25 7B being received on
the device while ATN is asserted.
If I run the Python script I see: 40 3F 25 7B
I did wonder whether the hex 20 is the controller listen address 0, but
then there isn't any data expected back from secondary 0x7B. On the
other hand why would Python send talk 40 before the 3F which normally
comes first?
This short script doesn't use secondary addressing, but otherwise works
perfectly well on a HP34401A multimeter:
#!/usr/bin/python3
import gpib
# GPIB interface 0, address 22
con = None
try:
con = gpib.dev(0,22)
except gpib.GpibError as e:
print(e)
exit()
status = gpib.write(con, "*IDN?")
deviceID = gpib.read(con, 1000).decode()
print("Found device: " + deviceID)
status = gpib.write(con, "meas?")
measurement = gpib.read(con, 3000).decode()
print("Measurement: " + measurement)
Its entirely possible that that the other device might be misbehaving in
some way. I am not entirely convinced that either the 20 or the 40
should actually be there? I need to dig further into that. I will post
an update if I find anything.
On 26/03/2026 11:05, dave penkler wrote:
> Hi John,
> The python bindings are fine.
> "but there are no listeners currently addressed." means that when the
> addressing commands are sent there is no response on the bus.
> In detail: no device has asserted one of NDAC and NRFD
> So it looks like the device at pad 5 does not recognise sad 0x73
> Looking at the perl code you are using sad 0x7B
> Could that be the issue ?
> cheers,
> -Dave
>
> On Wed, 25 Mar 2026 at 22:02, dave penkler <[email protected]> wrote:
>
> OK,
> I'll look into it.
>
>
> On Wed, 25 Mar 2026 at 16:35, John via Linux-gpib-general
> <[email protected]> wrote:
>
>
> 1) Not plugged into the bus
>
> The device is plugged in and the Perl script works so its not
> connectivity.
>
> 2) Not powered on
>
> Again, the Perl script works on the same device.
>
> 3) Device is hung
>
> There is no change after power cycling the device and computer.
>
> I am fairly certain its a software issue, but would need to
> dig into the library code and maybe attach a logic analyser to
> understand what's happening behind the scenes so to speak.
>
> What does it mean by "but there are no listeners currently
> addressed." ?
> The gpib.dev <http://gpib.dev>() addressing command is
> presumably opening a listen or talk communication handle?
>
> Could be an issue with how the device is responding I suppose,
> but why would Perl work and Python not when its supposedly
> doing the same thing?
>
> I do at least have the option to run with Perl for now, but it
> would be nice to have Python.
>
> _______________________________________________
> Linux-gpib-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/linux-gpib-general
>
>
>
> _______________________________________________
> Linux-gpib-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/linux-gpib-general
--------------1GenX6gsw0JjLtYhVNKAC0RO
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Dave,</p>
<p>Thank you for spotting my mistake. Yes it should be 0x7B not
0x73. I tried changing the 0x73 to 0x7B but unfortunately still
get the same error. I also tried the decimal equivalents of the
HEX value. Same result.</p>
<p>If I run the Perl script, I see the bytes 3F 20 25 7B being
received on the device while ATN is asserted.</p>
<p>If I run the Python script I see: 40 3F 25 7B</p>
<p>I did wonder whether the hex 20 is the controller listen address
0, but then there isn't any data expected back from secondary
0x7B. On the other hand why would Python send talk 40 before the
3F which normally comes first?</p>
<p>This short script doesn't use secondary addressing, but otherwise
works perfectly well on a HP34401A multimeter:</p>
<p>#!/usr/bin/python3<br>
<br>
import gpib<br>
<br>
# GPIB interface 0, address 22<br>
con = None<br>
try:<br>
con = gpib.dev(0,22)<br>
except gpib.GpibError as e:<br>
print(e)<br>
exit()<br>
<br>
status = gpib.write(con, "*IDN?")<br>
deviceID = gpib.read(con, 1000).decode()<br>
print("Found device: " + deviceID)<br>
<br>
status = gpib.write(con, "meas?")<br>
measurement = gpib.read(con, 3000).decode()<br>
print("Measurement: " + measurement)<br>
</p>
<p><br>
</p>
<p>Its entirely possible that that the other device might be
misbehaving in some way. I am not entirely convinced that either
the 20 or the 40 should actually be there? I need to dig further
into that. I will post an update if I find anything.</p>
<p></p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 26/03/2026 11:05, dave penkler
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAL=kjP1dfpmw51K+KTqSgO3yGHCv5hOqz=sGVbH8O2UoK-9V6Q@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div>Hi John,</div>
<div>The python bindings are fine.</div>
<div>"but there are no listeners currently addressed." means
that when the addressing commands are sent there is no
response on the bus.</div>
<div>In detail: no device has asserted one of NDAC and NRFD </div>
<div>So it looks like the device at pad 5 does not recognise
sad 0x73</div>
<div>Looking at the perl code you are using sad 0x7B</div>
<div>Could that be the issue ?</div>
<div>cheers,</div>
<div>-Dave</div>
</div>
<br>
<div class="gmail_quote gmail_quote_container">
<div dir="ltr" class="gmail_attr">On Wed, 25 Mar 2026 at
22:02, dave penkler <<a href="mailto:[email protected]"
moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">OK,
<div>I'll look into it.</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, 25 Mar 2026 at
16:35, John via Linux-gpib-general <<a
href="mailto:[email protected]"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">[email protected]</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p><br>
</p>
<div>1) Not plugged into the bus</div>
<div><br>
</div>
<div>The device is plugged in and the Perl script
works so its not connectivity.</div>
<div><br>
</div>
<div>
<div>2) Not powered on</div>
<div><br>
</div>
<div>Again, the Perl script works on the same
device.</div>
<div><br>
</div>
<div>
<div>3) Device is hung</div>
<div><br>
</div>
<div>There is no change after power cycling the
device and computer.</div>
<div><br>
</div>
<div>I am fairly certain its a software issue, but
would need to dig into the library code and
maybe attach a logic analyser to understand
what's happening behind the scenes so to speak.</div>
<div><br>
</div>
What does it mean by "but there are no listeners
currently addressed." ?</div>
</div>
<div>The <a href="http://gpib.dev" target="_blank"
moz-do-not-send="true">gpib.dev</a>() addressing
command is presumably opening a listen or talk
communication handle?</div>
<p>Could be an issue with how the device is responding
I suppose, but why would Perl work and Python not
when its supposedly doing the same thing?</p>
<p>I do at least have the option to run with Perl for
now, but it would be nice to have Python.</p>
<blockquote type="cite"> </blockquote>
</div>
_______________________________________________<br>
Linux-gpib-general mailing list<br>
<a
href="mailto:[email protected]"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">[email protected]</a><br>
<a
href="https://lists.sourceforge.net/lists/listinfo/linux-gpib-general"
rel="noreferrer" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.sourceforge.net/lists/listinfo/linux-gpib-general</a><br>
</blockquote>
</div>
</blockquote>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre wrap="" class="moz-quote-pre">_______________________________________________
Linux-gpib-general mailing list
<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/linux-gpib-general">https://lists.sourceforge.net/lists/listinfo/linux-gpib-general</a>
</pre>
</blockquote>
</body>
</html>
--------------1GenX6gsw0JjLtYhVNKAC0RO--
--===============7135490685491181317==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============7135490685491181317==
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
--===============7135490685491181317==--