Re: Working with secondary addresses

John <[email protected]> Tue, 31 Mar 2026 21:04:42 +0100
Newsgroups gmane.linux.hardware.gpib.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------RwKvoHGnSIQdVtZ0wxJFs3Vr
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

> You use a 10s timeout in your python code! Maybe you simple didn't not
> wait long enough. Kidding. :) Better use the provided constants, e.g.
> gpib.T1s

I take your point with that. 10s is an eternity in GPIB transmit terms 
and even 1s should be more than enough.

> But I guess this is a bad end anyway. Since your Perl code is working
> there must be a difference somewhere. Which is very strange, cause these
> are all only wrappers around the C code.

Yes, I think Dave Penler mentioned the same thing. The language is just 
a wrapper around the low level C code, so yes, very strange.

> So probably that is not a problem. Now handle yourself from function to
> function. You have the source code. Instrument it with print statements
> till you see where the difference is. I would do that on the C level.

I added a few more print statements, but its consistently breaking at 
this point:

$ ./test_storage.py
Check for the presence of the device ....
Device present.
Configure FIND ....
Configure INPUT ....
Configure TYPE ....
Configure CLOSE ....
Sleep 1 sec ....
FIND file ....
Traceback (most recent call last):
   File "/home/johnc/Test/linux-gpib/./test_storage.py", line 45, in 
<module>
     gpib.write(cmd_find, fnum)
     ~~~~~~~~~~^^^^^^^^^^^^^^^^
gpib.GpibError: write() failed: You have attempted to write data or 
command bytes, but there are no listeners currently addressed.

which means at this line:

gpib.write(cmd_find, fnum)

which may mean something needs to be changed in here:

cmd_find =  gpib.dev( 0, paddr, 0x7B, gpib.T10s, eot, 0 )

I tried changing the timeout to gpib.T1s or gpib.T30s (not that it 
needed to be any longer) but the exits with the error much too fast for 
the timeout to complete anyway.

Is there any way I can play with manually asserting ATN, sending bytes 
and then de-asserting ATN, then sending some bytes of data, terminating 
with an EOI or reading the returned data? Finally ending with UNT or UNL?



On 31/03/2026 20:13, Christian Grosz wrote:
> John,
>
>> Your example also seems to suggest that 'yes' can be used instead of 1?
> Don't mix up Perl, Python and the /etc/gpib.conf configuration file.
>
> You use a 10s timeout in your python code! Maybe you simple didn't not
> wait long enough. Kidding. :) Better use the provided constants, e.g.
> gpib.T1s
>
> But I guess this is a bad end anyway. Since your Perl code is working
> there must be a difference somewhere. Which is very strange, cause these
> are all only wrappers around the C code.
>
> For python
>
> linux-gpib-4.3.7/linux-gpib-user-4.3.7-orig/language/python/gpibinter.c
> ----
> static PyObject* gpib_dev(PyObject *self, PyObject *args)
> {
> 	int ud = -1;
> 	int board = 0;
> 	int pad = 0;
> 	int sad = NO_SAD;
> 	int tmo = T30s;
> 	int eot = 1;
> 	int eos_mode = 0;
> ...
> ----
>
> there is another set of defaults. For Perl it looks to me like a simple
> wrapper.
>
> So probably that is not a problem. Now handle yourself from function to
> function. You have the source code. Instrument it with print statements
> till you see where the difference is. I would do that on the C level.
>
> Christian
>
>
--------------RwKvoHGnSIQdVtZ0wxJFs3Vr
Content-Type: text/x-python; charset=UTF-8; name="test_storage.py"
Content-Disposition: attachment; filename="test_storage.py"
Content-Transfer-Encoding: base64

IyEvdXNyL2Jpbi9weXRob24zCgppbXBvcnQgZ3BpYgppbXBvcnQgdGltZQoKIyBHUElCIGlu
dGVyZmFjZSAwLCBhZGRyZXNzIDUKY29uID0gTm9uZQpwYWRkciA9IDUKZW90ID0gMQoKI0Zp
bGUKZm51bSA9ICIxMyIKCgojIEdQSUIgaW50ZXJmYWNlIDAsIGFkZHJlc3MgNQpwcmludCgi
Q2hlY2sgZm9yIHRoZSBwcmVzZW5jZSBvZiB0aGUgZGV2aWNlIC4uLi4iKQp0cnk6CiAgICBj
b24gPSBncGliLmRldigwLHBhZGRyKQogICAgcHJpbnQoIkRldmljZSBwcmVzZW50LiIpCmV4
Y2VwdCBncGliLkdwaWJFcnJvciBhcyBlOgogICAgcHJpbnQoIkRldmljZSBlcnJvcjoiKQog
ICAgcHJpbnQoZSkKICAgIGV4aXQoKQoKIyBOb3RlOiB0aW1lb3V0IHZhbHVlIC0gMTMgPSAx
MHNlYywgMTIgPSAzc2VjLCAxMSA9IDFzZWMK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GFbMV0pCnRpbWUuc2xlZXAoMSkKCgojSU5QVVQgZmly
c3QgbGluZQpwcmludCgiSU5QVVQgZmlyc3QgbGluZSAuLi4uIikKbGluZSA9IGdwaWIucmVh
ZChjbWRfaW5wdXQsIDEwMCkuZGVjb2RlKCkKcHJpbnQoIlNsZWVwIDEgc2VjIC4uLi4iKQp0
aW1lLnNsZWVwKDEpCgpwcmludChsaW5lKQoKCiNDTE9TRSBmaWxlCnByaW50KCJDTE9TRSBm
aWxlIC4uLiIpCmxpbmUgPSBncGliLndyaXRlKGNtZF9jbG9zZSwgZm51bSkKdGltZS5zbGVl
cCgxKQoKCiMgQ2xvc2UgZG93bgpncGliLmNsb3NlKGNtZF9maW5kKQpncGliLmNsb3NlKGNt
ZF90eXBlKQpncGliLmNsb3NlKGNtZF9pbnB1dCkKZ3BpYi5jbG9zZShjbWRfY2xvc2UpCgpn
cGliLmNsb3NlKGNvbikKCg==

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


--------------RwKvoHGnSIQdVtZ0wxJFs3Vr
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

--------------RwKvoHGnSIQdVtZ0wxJFs3Vr--