Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB-USB-HS and C++builder sample code problem

The sample code was written in Borland C++ Builder 3.  But I run it in Borland C++ Builder 6 and encountered problem as said in the attached file.  Please help.
Thnks
0 Kudos
Message 1 of 15
(7,873 Views)

Imai,

Here are are couple of things you can try:

1. Remove the missing bpi modules:

    A. Go to Project -> Options -> Packages.

   B. Then go to the  "Runtime packages" groupbox (at the bottom of the tab).

   C. Go to the end of the packages list edit box and remove all the missing bpi modules.

2. Use 'Find' to find the package(s), then copy them to 'Cbuilder6/Lib' directory.

Hope this information helps!

gpibtester

0 Kudos
Message 2 of 15
(7,847 Views)

Thanks, Make and build project work.  Now I have 8116A pulse/function generator HP (turned on) (switch IB address set 00001) connected to GPIB-USB-HS.  When I run program I get error message: 

Unable to open device

ibsta = 0x8000

iberr = 7 (ENEB).

Please help.

if you have  any sample code for either 8116A HP pulse/function generator , 33256A function arbitary waveform generator,  8648C signal generator interface with GPIB-USB-HS in builder6 c++ will be appreciated. 

GPIB-USB-HS  is new to me.

 

 

0 Kudos
Message 3 of 15
(7,836 Views)

Imai,

The Error Code you listed, ENEB, indicates that a call to a non-existent board was made- ENEB Error defined. It could be as simple as the Borland C++ Builder application assuming that the GPIB-USB-HS interface is set up as something other than GPIB0, which is the default.

To figure out which GPIB Number the GPIB-USB-HS is assigned as, use Measurement & Automation Explorer. Then do a Scan for Instruments to see how the instruments are listed.

To manually verify the setup, use Interactive Control. Once communication is established using the Interactive Control program, compare how the ibfind/ibdev calls are made in the Borland C++ Builder application and make any necessary changes.

gpibtester 

0 Kudos
Message 4 of 15
(7,832 Views)

Thank you, It works.  After Scanning for instrument I found different Primary addr between Hardware and program code.

Cheers

0 Kudos
Message 5 of 15
(7,817 Views)
You're very welcome. It is good that it is a simple fix that needed to be made to the application!
 
gpibtester
0 Kudos
Message 6 of 15
(7,813 Views)
Please see new problem in attached file.  Thanks
0 Kudos
Message 7 of 15
(7,794 Views)
Imai,
 
The "OUTP" in the command "OUTP: STAT ON" is part of the HP BASIC command to output to a port. I found it in the GPIB Programming section of the Operation and Service Guide  manual for the 8648D. Seeing as you are not using HP BASIC, simply try using the command "STAT ON".
 
gpibtester
0 Kudos
Message 8 of 15
(7,787 Views)
on page 2-4 Operation and Service Guide  manual for the 8648D,
I typed and clicked RUN:    POW:AMPL -47 DBM
the same ERR, and program terminates:

same meassage on instrument:  -420 Query UNTERMINATED.  But  power level changes to - 47 dBm..

 

If using Basic language (to me): is OUTPT 719; "POW:AMPL -47 DBM;:OUTPUT:STAT ON".

Please help 

 

0 Kudos
Message 9 of 15
(7,775 Views)

Sorry gpibtester, the 'OUTP' is not an HP Basic command. The HP Basic command for output to a port is just 'output'. :OUTP: STAT ON is a valid command. It's in the LabVIEW driver just like that.

Imai,

The command you are sending is not a query and there will be nothing returned from the instrument when it is issued. You should only do a read when a command is issued with a '?'.

0 Kudos
Message 10 of 15
(7,776 Views)