
Concepts and Features
R&S
®
ZNB/ZNBT
147
User Manual 1173.9163.02 ─ 53
Set up a shared memory buffer
The setup of a shared memory buffer and the allocation of trace data is performed by a
sequence of
INITialize
and
finished by a
COMMit
.
1. Initialize the shared memory buffer:
2. Add traces:
a)
'<TrName1>', FDATA|SDATa, #Values1
Select an existing trace name, choose whether to use formatted trace data
(
FDATa
) or unformatted trace data (
SDATa
), and define how many trace values
the firmware writes to the buffer per sweep.
The data block of the first trace has an offset of 0 bytes relative to the start of
the shared memory buffer.
b)
SYSTem:DATA:MEMory:ADD '<TrName2>', FDATA|SDATa, #Values2
Use
to query the offset in bytes of the sec-
ond trace data block. Processes that want to read the trace data from the buffer
need to know this offset. Its size depends on whether the first trace data block
contains formatted (real) or unformatted (complex) values.
c) ...
Use
SYSTem:DATA:MEMory:OFFSet?
to query the offset of the last added trace.
3. Create the named shared memory buffer:
'<ShMemName>'
The name must be unique. Before the
COMMit
you can use
to query the names of existing shared memory buffers.
The size of the last created shared memory buffer can be queried using
Use a shared memory buffer
After you have created a named shared memory buffer, you can access it – from the
instrument – using your favorite programming language and API. With Python, for
instance, you can use the
mmap
module for this purpose.
Delete a shared memory buffer
To delete a shared memory buffer and free the occupied memory, you can use one of
the following commands.
1.
'<ShMemName>'
deletes a single shared memory buffer by name.
2.
deletes all shared memory buffers created using
SYSTem:DATA:MEMory:COMMit
.
Operations on Traces