beautypg.com

Source code example gpib-1, Use the interactive gpib program “ibic – Teledyne LeCroy X-STREAM OSCILLOSCOPES Remote Control User Manual

Page 266

background image

A

P P E N D I X

I :

Program Examples

260

ISSUED: February 2005

WM-RCM-E Rev D

SOURCE CODE PROGRAMS

These programs can be divided into two types, those using National Instruments GPIB software and hardware,

and those using ActiveDSO, which for GPIB also connects to National Instruments software and hardware. A
great benefit of ActiveDSO is that the code written by the user is completely independent of the hardware

connection. The selection of GPIB, LAN, or RS232 (for earlier DSOs) is made by a single command near the
start of a program.

Programming examples can be found on LeCroy’s Web site at

http://www.lecroy.com/tm/library/software/

.

SOURCE CODE EXAMPLE GPIB - 1

Use the Interactive GPIB Program “IBIC”

This example assumes the use of an IBM PC (or compatible) computer equipped with a National Instruments

GPIB interface card. The GPIB driver is left in default state so that the device name “dev4” corresponds to the
GPIB address 4, the oscilloscope address. All text is entered by the user. Bold type represents prompts from

the program.

IBIC
program announces itself
: ibfind
enter board/device name: dev4
dev4

: ibwrt

enter string: “tdiv?”
[0100]

( cmpl )

count: 5
dev4

: ibrd

enter byte count: 10
[0100]

( cmpl )

count: 10
54 44 49 56 20 35 30 45

T D I V

5 0 E

2D 39

− 9

dev4

: ibwrt

enter string: “c1:cpl?”
[0100]

( cmpl )

count: 7