03-13-2012 09:32 AM
Hallo Forum Members,
I just run into trouble reading a trace from an FSP13 with FORMAT REAL,32.
I hunted the issue down to the point, that the trace is incomplete after the
first occurence of a 0 in the binary data, so more or less data are read,
depending on the position of the 0.
I compared the REAL,32 trace with an ASC trace and could exactly locate the0x00
in the Ascii trace.0. The message ends regularly with ibsta = END,CMPL. and also
no "system:err?" is reported.
What do I do?
- I use libgpibapi.so under linux i686 (loaded via ctypes into python), HW is an NI-PCI-Card,
Here is the fragment, what I'm currently doing:
self.gpib_so.ibdev(self.boardid, self.pad, 0, tmout, 1, 0) # ==> EOI is used and not EOS
self.ibwrt("FORMAT REAL,32")
self.ibwrt("TRACE? TRAC1")
x = ""
while 1:
x += self.ibrd()
if self.ibsta & END:
break
Any help is apreciated, maybe there is something to configure on the FSP13.
Thanks, Axel
Solved! Go to Solution.
05-16-2012
03:33 AM
- last edited on
02-18-2026
02:08 PM
by
Content Cleaner
It turned out that the ctypes string buffer caused the issue.
This buffers had two members, buffer.value and buffer.raw.
buffer.value just returns an 0 terminated string. buffer.raw returns
the entire allocated buffer. To get the real number of received
bytes, you need to access the global variable ibcntl in the gpib
library. Under windows this variable is renamed to user_ibcntl.
(found here: http://www.ni.com/white-paper/4873/en)