Wenn dein Problem oder deine Frage geklärt worden ist, markiere den Beitrag als "Lösung",
indem du auf den "Lösung" Button rechts unter dem entsprechenden Beitrag klickst. Vielen Dank!
ich verwende ein folgendes oszi: agilent infiniium 54831D MSO
ich möchte den stromverlauf über der zeit gerne via gpib auslesen können.
in matlab sieht das im moment so aus, ich werds später in labview machen!!
...
fprintf (oszi, ':CHANnel3:UNITs AMPere');
...
fprintf (oszi, ':ACQuire:MODE RTIMe;AVERage OFF;POINts 2000');
fprintf (oszi, ':WAVEFORM:SOURCE CHANnel3');
fprintf (oszi, ':WAVEFORM:POINTS:MODE BINary');
fprintf (oszi, ':WAVEFORM:BYTeorder LSBFirst');
fprintf (oszi, ':WAVEFORM:POINTS 1000');
fprintf (oszi, ':WAVeform:DATA?');
was soll ich bei WAVEFORM:POINTS:MODE einstellen? und wie sind die messdaten verschachtelt? wird zeit und strom übertragen, wie ist das format?
Ich poste folgenden Code mal, könnte sein, das mehrere Leute sowas vor haben...
Source Code in Matlab:
Code:
% Specify data from Channel 1
fprintf(visaObj,':WAVEFORM:SOURCE CHAN1');
% Specify 1000 points at a time by :WAV:DATA?
fprintf(visaObj,':WAVEFORM:POINTS 1000');
% Get the data back as a WORD (i.e., INT16), other options are ASCII and BYTE
fprintf(visaObj,':WAVEFORM:FORMAT WORD');
% Set the byte order on the instrument as well
fprintf(visaObj,':WAVEFORM:BYTEORDER LSBFirst');
% Get the preamble block
preambleBlock = query(visaObj,':WAVEFORM:PREAMBLE?');
% The preamble block contains all of the current WAVEFORM settings.
% It is returned in the form <preamble_block><NL> where <preamble_block> is:
% FORMAT : int16 - 0 = BYTE, 1 = WORD, 2 = ASCII.
% TYPE : int16 - 0 = NORMAL, 1 = PEAK DETECT, 2 = AVERAGE
% POINTS : int32 - number of data points transferred.
% COUNT : int32 - 1 and is always 1.
% XINCREMENT : float64 - time difference between data points.
% XORIGIN : float64 - always the first data point in memory.
% XREFERENCE : int32 - specifies the data point associated with
% x-origin.
% YINCREMENT : float32 - voltage diff between data points.
% YORIGIN : float32 - value is the voltage at center screen.
% YREFERENCE : int32 - specifies the data point where y-origin
% occurs.
% Now send commmand to read data
fprintf(visaObj,':WAV:DATA?');
% read back the BINBLOCK with the data in specified format and store it in
% the waveform structure
waveform.RawData = binblockread(visaObj,'uint16');
%% Data processing: Post process the data retreived from the scope
% Extract the X, Y data and plot it
% Maximum value storable in a INT16
maxVal = 2^16;
% split the preambleBlock into individual pieces of info
preambleBlock = regexp(preambleBlock,',','split');
% store all this information into a waveform structure for later use
waveform.Format = str2double(preambleBlock{1}); % This should be 1, since we're specifying INT16 output
waveform.Type = str2double(preambleBlock{2});
waveform.Points = str2double(preambleBlock{3});
waveform.Count = str2double(preambleBlock{4}); % This is always 1
waveform.XIncrement = str2double(preambleBlock{5}); % in seconds
waveform.XOrigin = str2double(preambleBlock{6}); % in seconds
waveform.XReference = str2double(preambleBlock{7});
waveform.YIncrement = str2double(preambleBlock{8}); % V
waveform.YOrigin = str2double(preambleBlock{9});
waveform.YReference = str2double(preambleBlock{10});
waveform.VoltsPerDiv = (maxVal * waveform.YIncrement / 8); % V
waveform.Offset = ((maxVal/2 - waveform.YReference) * waveform.YIncrement + waveform.YOrigin); % V
waveform.SecPerDiv = waveform.Points * waveform.XIncrement/10 ; % seconds
waveform.Delay = ((waveform.Points/2 - waveform.XReference) * waveform.XIncrement + waveform.XOrigin); % seconds
% Generate X & Y Data
waveform.XData = (waveform.XIncrement.*(1:length(waveform.RawData))) - waveform.XIncrement;
waveform.YData = (waveform.RawData - waveform.YReference) .* waveform.YIncrement + waveform.YOrigin;
ich bin mir bewusst! ich geh mal davon aus das im labview die gleichen probleme auftreten...
also da steht:
The :WAVeform:POINts? query returns the points value in the current waveform
preamble. The points value is the number of time buckets contained in the
waveform selected with the :WAVeform:SOURce command.
Naja ich geh mal davon aus wenn ich die anzahl der punkte auf 1000 festlege sollte er bei der abfrage 1000 zurückliefern....