Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB

i am some questions about the GPIB Programming on an Agilent Scope , as you know there is a common function to capture the screen on the Scope and transfer through GPIB to PC: The coding as below:
 
**********************************************************************
 Set Picture1 = LoadPicture("")
   
         With Scope
             .IO.Timeout = 15000
             .WriteString ":DISPlay:DATA? BMP, SCReen"    <--- Command send to Scope - - ->
             byteData = .ReadIEEEBlock(BinaryType_UI1)   <--- Agilent I/O Library - command set - Read Binary Data>
             .IO.Timeout = 10000
         End With
   
         saveAsFile filePath, byteData
   
         Picture1.AutoSize = True
         Set Picture1 = LoadPicture(filePath)
 
*************************************************************************
 
I wonder is there any similar function calls in NI 488.2 or NI VISA driver to handle the similar task of "ReadIEEEBlock" Command in Agilent I/O Library above?? Thanks!
 
MY
0 Kudos
Message 1 of 5
(4,736 Views)

There is no equivalent function but if you know the format of the data, you can parse the results from the VISA Read and display it in a picture control. If all you need to do is save it, have you tried doing a VISA Read to File?

I'll admit that I have never done a screen capture and then a file save. With LabVIEW, I've always felt it was silly to do an extra file transfer when all of the necessary information was already visible on the front panel.

0 Kudos
Message 2 of 5
(4,720 Views)

I have read about the NI VISA doc and There is some function call fro reading Binary Data, I wonder can it help.

 

********************************************************************

IEEE-488.2 Binary Data—%b

When writing binary data to or reading it from the instrument, you can use %b, %B format codes with length modifiers (h, l, z, and Z). ASCII data is represented by signed integer values. The range of values depends on the byte width specified. One-byte-wide data ranges from -128 to +127. Two-byte-wide data ranges from -32768 to +32767. An example of an ASCII waveform data string follows:

CURVE<space>-110,-109,-110, -110, -109, -107, -109, -107, -106, -105, -103, -100, -97, -90, -84, -80


    Example
    /* Waveform Query */

    ViInt32 totalPoints = MAX_DATA_PTS;
    ViInt8 rdBuffer[MAX_DATA_PTS];
    viQueryf( io, ":CURV?", "%#b", &totalPoints, rdBuffer);

    The Waveform Query example queries a waveform. The data is in IEEE 488.2 <ARBITRARY BLOCK PROGRAM DATA> format. The number (#) sign specifies the data size. In absence of length modifiers, the data is assumed to be of byte-size elements.

    *****************************************************

0 Kudos
Message 3 of 5
(4,711 Views)
As I said, you can parse the data from the VISA Read and convert it to the correct format if you know the format. You've selected an example for CVI. Is that the language you are using? I'm more familiar with LabVIEW. Below is how to do one type of conversion in LabVIEW. If you can determine the exact format that the data is transmitted as, then you can ask for help in the conversion. Does the manual for the scope explain this? You haven't mentioned the make and model of the scope and that would be very useful information to provide.
 

Message Edited by Dennis Knutson on 09-03-2007 10:12 PM

0 Kudos
Message 4 of 5
(4,710 Views)

Is this you using a different login? If it is, please don't post the same question to multiple boards and especially don't post the same question to multiple boards under different names.

If this question is about the 6000 series scope, then the format of the data is explained on page 71 of the manual.

Message 5 of 5
(4,679 Views)