Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using NiVisa with/from Borland Delphi?

Hi.
 
Is there any information available, to allow me to convert some of our existing GPIB tools and utilities written in Borland Delphi, using GPIB32.DLL, to use the Visa IO routines?
 
This is brought on with the advent of some USB instruments from a supplier, that I need to test and validate before passing on to a customer.
 
I've found and installed NiVisa on one PC, and it all works OK through NiMax, but it's a right faff to use.  So, idealy, I'd like to re-write some if not all of my own stuff (that currently uses either GPIB or RS232) to use Visa, so that existing and future instruments can be controled, regardless of if they use GPIB, serial or USB.
 
I also downloaded the Visa Help zip file.  L o t s  of information in there, but where to start?  Guess what I'm asking, is what documentation is available to use the generic Visa API, if such a thing exists, is there a Visa equivelent of GPIB32.DLL?  Also, what sort of documentation, any example, even simple stuff would be a start.  VB and C are alien to me, so not a lot of use.
 
Oh yes, I was plesantly surprised to find that NiSpy also interceps Visa call's!  Very nice....
 
Any more info needed, just ask.
 
Dave B.
 
OK... Who let the smoke out?
0 Kudos
Message 1 of 6
(9,676 Views)
Hi Dave,
Unfortunately Delphi is not officially supported by VISA but it should be a matter of either calling directly the dll (visa32.dll) or another option is to use an Active X component called CWVISA. WIthout a copy of Delphi here to try it with, I can only suggest trying it.
 
In terms of converting the GPIB to VISA, there are a few comparable calls, such as the writes and reads, but the callbacks are different so it may require  a slight architectural change to your code.
 
Hope that helps
 
Sacha Emery
National Instruments (UK)



Message Edited by SachaE on 03-15-2006 12:43 PM

// it takes almost no time to rate an answer Smiley Wink
Message 2 of 6
(9,667 Views)

Hi Sacha

Thanks for the pointer.  I've also found some VB and C examples.  One of the other guys here has messed about with VB, so hopefully we'll figure out something between us.  Luckily, we dont need much more than to find the instrument, talk and listen to it, and maybe poll it from time to time.  All low bandwidth text based stuff.

Thanks again.

Dave.

 

OK... Who let the smoke out?
0 Kudos
Message 3 of 6
(9,638 Views)

I use (NI) VISA control with Delphi5 (and plan to work with Delphi 2010). I simply make use of the VisaCom DLL interface from IVI.

I simply import the DLL and being honest ... you might appreciate some example code. But it is pretty simple. Please contact me when you need more information. It needs some special care with the string format.

 

In the coming weeks I will gain more experience.

 

William.Kuipers@tiscali.nl

0 Kudos
Message 4 of 6
(8,044 Views)

Hi William.

 

I'd be interested to see what and how you did, what you did.

 

Here, in the end we used (well, a collegue did) VB to do what we needed.

 

I still use Delphi(7) for many things though, so as above would be interested in learning from you.

 

Cheers.

 

DaveB.

 

OK... Who let the smoke out?
0 Kudos
Message 5 of 6
(7,073 Views)

Hi Mr. Kuipers.

 

I'm experience the same necessity to develop a Delphi Unit to access the Visa32 (or Visacom) dlls to comunicate to a USB interface of a Tektronix Oscilloscope(I have NI-VISA drivers installed in my machine). I would apprecciate your help in that matter. What you've done using Delphi5 seems to be a very good example point to start once I'm working with Delphi 7.

 

I wrote a e-mail outside for your but no answer yet. Hope you could help me. Thanks

 

Message 6 of 6
(6,510 Views)