From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture the waveform of an oscilloscope connected to a PC through NI's GPIB?

I want to use NI's C/C++ library
0 Kudos
Message 1 of 7
(5,540 Views)
Hi, if you don't worry about the execution time much you can use the "NI 488.2 Library".

After you setup your oscilloscope, use the routine
Send
to upload the command to the scope, to retrieve the waveform, and then use the routine
Receive
to download the waveform from the scope. For ex. I use a TDS220 scope, so when I want to read a waveform from it I use
Send(0, 2, "CURVE?", 6, NLend);
wich tells to the scope, at address 2, that sends the waveform to the device at address 0, the GPIB. The command has 6 characters and the termination mode, of the command, is the character"\n".
Then I read the waveform from the GPIB with,
Receive(0, 2, *buffer, 2507, STOPend);
wich means that 2507 bytes will be readout from the device at address 2, the scope, and put into the
character string buffer, and the data termination mode, STOPend, will be the STOPend character.

If the time execution is extremely important I recomend yout to use the "NI 488 Library" functions, but for this pourpose is a little bit complicate than using the NI 488.2 routines.

Check also, the manual of you scope, for specfic commands to retrieve the waveform. I wrote down many programs. I few minutes I can send you an example, how to do that!.

enrique.gámez:-)
Message 2 of 7
(5,540 Views)
Hi Gomez,

It's Babu again. I want to know whether the "CURVE?" option in Send function, returns us only the waveform or the entire oscilloscope screen. I want the entire oscilloscope screen. Please send your suggestions or solutions. Please tell me your email id.

Regards,
Babu.
0 Kudos
Message 5 of 7
(5,540 Views)
sorry my e-mail its
egamez@fcfm.buap.mx
or
gamez@mail.cern.ch

The command "CURVE?" returns just the waveform, on my scope. Now when I have the waveform I can plot it on a screen, emulating the entire scope screen. I must retrive from the scope the vertical and horizaontal scales to a real screen emulation.
0 Kudos
Message 7 of 7
(5,540 Views)
Hi, it's my again, as I told this is an example to workout with a Tektronix TDS220 scope. this program will readout NUM_WAV waveforms. I also send you the Makefile to compile the program, under Linux.

Please send me your comments.
Download All
0 Kudos
Message 3 of 7
(5,540 Views)
Hello Gámez,

Thank u very much for your timely suggestion. But the instrument that we are using is Tektronix DSA602 scope and PC platform is windows. Can u suggest a solution for the above scenario and please do send in source code also, if u r sending any programs.

Please reply..

Regards,
Babu
0 Kudos
Message 4 of 7
(5,540 Views)
Why don't you try first with "wibic" or "ibic" programs, with those you can introduce interactively the commands and you can check out the results.

Unfortunatly I'm not good enough with Windows, but if your scope accept the commands for the TDS220 you can also use the scp.c program just changing the header files by:
windows.h
and
decl-32.h
and you can compile it with,
cl scp.c gpib-32.obj
if you're using Microsoft Visual C/C++
if you're using Borland C/C++ its
bcc32 -w32 scp.c borland_gpib-32.obj
at least this is what my (GPIB) manual says.

There's also aprogram called "Interactive Control Utility" wich also lets you cominicate with the GPIB devices interactively.
0 Kudos
Message 6 of 7
(5,540 Views)