Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

gpib hp34401 visual basic 6

Hello,

I use a HP34401 to make some voltage acquisitions.
I control my HP34401 with a VB6 application on a computer using National Instrument Driver ans DLL : NI-488.2
I want to launch several acquisitions successively on my HP34401 using for example :

SAMPle:COUNt 3 -> definition of the number of acquisitions

INITiate -> read the 3 acqusitions and save them on the memory of the HP34401

FETCh? -> read the 3 acquisition of the HP34401 memory and download them by GPIB on the computer

So in the NI module VBIB32 I use the ilrd function but it only works with a single acquisitions. I can't download several acquisitions in my buffer.

I use :

Dim S As String
Dim NbAcq as Integer

NbAcq = 3
Hdl = ildev(0, 22, 0, 12, 1, &H10A&)

... -> 'Configuration and Initialisation (No Problem)

S = Space(255)
ilwrt(Hdl, "SAMPLE:COUNT " & NbAcq & "; :INITiate", 25)
ilrd(Hdl, S, 255)

It works fine for a single acquisition.
For more than 1 acquisition I can see in the HP34401 display that several acquisitions occur and I can read them in its control panel but I can't download more than only one.
I have tried to use the ilrdi function that accept Tables but it works only with Integer and I need Double.

Can you help me please to solve my problem ?
Thanks a lot

Julien
0 Kudos
Message 1 of 3
(3,484 Views)

Hello,

NI provides a wizard to help you troubleshooting  your devices, you can try to use it for your problem. I give you a link how to use the wizard:

http://www.ni.com/support/gpib/max/commutil.htm

 

Hope it will help you for your problem.

 

Regards,

 

ClémentG
0 Kudos
Message 2 of 3
(3,432 Views)

Julien,

To read an array of doubles, you can either modify the ilrdi function prototype for integers to accept an array of doubles instead. Or you can create a new subroutine based on ilrdi.

To modify the existing ilrdi, open the vbib-32.bas module. Go to the ilrdi subroutine and change the Integer to Double, as shown below is a code snippet:

Sub ilrdi(ByVal ud As Integer, ibuf() As Double, ByVal cnt As Long)

But if you want to leave ilrdi intact, you could copy and paste the ilrdi subroutine, give it a different name, such as ilrdd, and change the ibuf to be a Double.

I would suggest copying the original ilrdi and creating a special subroutine that handles an array of doubles only.

Hope this information helps.

0 Kudos
Message 3 of 3
(3,427 Views)