Binary Block conversion, SRS Lock in amplifier imlementation

2 次查看(过去 30 天)
Hello,
I am trying to read data off of an SRS lock in amplifier in matlab, and I cannot seem to figure out how to read the data out after taking it from the buffer.
The command is:
The CAPTUREGET? query returns all or part of the capture buffer contents as a binary block. The binary block returns j kbytes of capture buffer contents beginning with an offset of i kbytes. If (i+j) is longer than CAPTURELEN, then CAPTUREGET returns wrapped data. The maximum length j is 64 (corresponding to 64 kbytes). Both parameters i and j must be provided. Capture must be stopped when executing CAPTUREGET? or a range error is generated. The binary block query response is in the following format: #nccccxxxxxxx Where “#” is the hash character (character code 35), “n” is a single digit specifying the number of digits to follow in the block length count; “cccc” is the n–digit integer size of the binary block to follow, and “xxxxxxx” is the cccc–byte binary data. Data is packed as 4-byte (32-bit) single precision floating point binary, in little endian format. The CAPTUREGET? query is not recognized on the RS-232 remote interface.
Example CAPTUREGET? 0,32 returns a binary block with 32 kbytes of capture data
fprintf(obj, 'CAPTUREGET? 0,16');
fscanf(obj)
This results in near gibberish. Does anyone know of a tool to convert this binary block to an easier format?
Thanks,
Dan
https://www.thinksrs.com/downloads/pdfs/manuals/SR865Am.pdf

回答(1 个)

Milan Bansal
Milan Bansal 2023-9-1
Hi,
As per my understanding you are not able to read the data file generated from the SRS Lock-in Amplifier in MATLAB.
The file generated should be a binary .mat extension file and could be read using the following code:
S = load('name_of_the_file.mat');
Where S should be a structure.
Refer to the discussion in the MATLAB Answer link given below. I believe that the MATLAB answer here is regarding the similar issue you are facing and will help you in resolving the issue.

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by