| 
	
		
			| 
					08.02.2011, 19:28  
				  Beitrag #1 |  
			| 
					
                                                 | surfman19
   LVF-Neueinsteiger
 
 
 Beiträge: 7
 Registriert seit: Feb 2011
 
 9
 -
 kA
 
 
 
 
 | Agilent - Messignal über GPIB auslesen 
					Hallo,
 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?
 
 lg
 
				
				 |  |  
			|  |  
	
		
			| 
					08.02.2011, 19:33  
				  Beitrag #2 |  
			| 
					
                                                 |   jg
   CLA & CLED
 
   
 Beiträge: 15.864
 Registriert seit: Jun 2005
 
 20xx / 8.x
 1999
 EN
 
 Franken...
 Deutschland
 
 | RE: Agilent - Messignal über GPIB auslesen 
					 
Ich habe dich schon einmal auf die LVF-Regeln hingewiesen:
http://www.labviewforum.de/Thread-Sampli...#pid114458 
Bitte kein durchgehendenes Kleinschreiben! Danke.
 
Gruß, Jens
				 
 
Wer die erhabene Weisheit der Mathematik tadelt, nährt sich von Verwirrung. (Leonardo da Vinci)!! BITTE !!  stellt mir keine Fragen über PM, dafür ist das Forum da - andere haben vielleicht auch Interesse an der Antwort!
 
Einführende Links zu LabVIEW, s. GerdWs Signatur . 
				
				 |  |  
			|  |  
	
		
			| 
					08.02.2011, 20:32  
				  Beitrag #3 |  
			| 
					
                                                 |   GerdW
   ______________
 
   
 Beiträge: 17.529
 Registriert seit: May 2009
 
 LV2019 (LV2021)
 1995
 DE_EN
 
 10×××
 Deutschland
 
 | RE: Agilent - Messignal über GPIB auslesen 
					Hallo, Zitat:was soll ich bei WAVEFORM:POINTS:MODE einstellen? 
Das gleich wie bei Matlab - LabVIEW kann genauso gut mit Daten umgehen und Binary steht üblicherweise für die schnellste Datenübertragung...
 Zitat:wie sind die messdaten verschachtelt? wird zeit und strom übertragen, wie ist das format? 
Das steht im Handbuch des Oszis! Wer lesen kann, ist klar im Vorteil   
 
				
				 |  |  
			|  |  
	
		
			| 
					08.02.2011, 21:23  (Dieser Beitrag wurde zuletzt bearbeitet: 08.02.2011 21:24  von surfman19.) Beitrag #4 |  
			| 
					
                                                 | surfman19
   LVF-Neueinsteiger
 
 
 Beiträge: 7
 Registriert seit: Feb 2011
 
 9
 -
 kA
 
 
 
 
 | RE: Agilent - Messignal über GPIB auslesen 
					Es gibt ja zum Glück schon was fertiges ;Dhttp://www.mathworks.com/matlabcentral/f...illoscopes 
Ich poste folgenden Code mal, könnte sein, das mehrere Leute sowas vor haben...
 
Source Code in Matlab:
 
Code:
 % Specify data from Channel 1fprintf(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;
 
 % Plot it
 plot(waveform.XData,waveform.YData);
 set(gca,'XTick',(min(waveform.XData):waveform.SecPerDiv:max(waveform.XData)))
 xlabel('Time (s)');
 ylabel('Volts (V)');
 title('Oscilloscope Data');
 grid on;
 
Ist es für das Plotten nun egal, ob die Messwerte eine Spannungsverlauf oder einen Stromverlauf darstellen???
 
lg
				
				
				 |  
    |  
			|  |  
	
		
			| 
					09.02.2011, 08:46  
				  Beitrag #5 |  
			| 
					
                                                 |   GerdW
   ______________
 
   
 Beiträge: 17.529
 Registriert seit: May 2009
 
 LV2019 (LV2021)
 1995
 DE_EN
 
 10×××
 Deutschland
 
 | RE: Agilent - Messignal über GPIB auslesen 
					Hallo surfman, Zitat:Ist es für das Plotten nun egal, ob die Messwerte eine Spannungsverlauf oder einen Stromverlauf darstellen??? 
Radio Eriwan: Jein... 
Ich würde zumindest die Achsenbezeichnung von "Volt" nach "Ampere" anpassen   
 
				
				 |  |  
			|  |  
	
		
			| 
					09.02.2011, 08:53  
				  Beitrag #6 |  
			| 
					
                                                 | surfman19
   LVF-Neueinsteiger
 
 
 Beiträge: 7
 Registriert seit: Feb 2011
 
 9
 -
 kA
 
 
 
 
 | RE: Agilent - Messignal über GPIB auslesen 
					Das ist das kleinste Problem    
ich ich nur noch nicht verstehe, warum er die Einstellung bzgl. der Anzahl der Punkte nicht übernimmt!? hmm...
 
Code:
 >> fprintf(visaObj,':WAVEFORM:POINTS 1000');>> fprintf(visaObj,':WAVEFORM:POINTS?');
 >> fscanf(visaObj)
 
 ans =
 
 31985
				
				 |  |  
			|  |  
	
		
			| 
					09.02.2011, 08:58  
				  Beitrag #7 |  
			| 
					
                                                 |   GerdW
   ______________
 
   
 Beiträge: 17.529
 Registriert seit: May 2009
 
 LV2019 (LV2021)
 1995
 DE_EN
 
 10×××
 Deutschland
 
 | RE: Agilent - Messignal über GPIB auslesen 
					Hallo surfman,
 dies hier ist weder ein Matlab-Forum noch ein Agilent-Oszi-Forum...
 Was sagt denn das Manual, was die Abfrage "Points?" zurückliefern soll?
 
 
				
				 |  |  
			|  |  
	
		
			| 
					09.02.2011, 10:32  
				  Beitrag #8 |  
			| 
					
                                                 | surfman19
   LVF-Neueinsteiger
 
 
 Beiträge: 7
 Registriert seit: Feb 2011
 
 9
 -
 kA
 
 
 
 
 | RE: Agilent - Messignal über GPIB auslesen 
					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....
 
				
				 |  |  
			|  |  |  |