Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Using GPIB control in VB...

Hello,

I am re-designing some T&M applications using a proper n-tier architecture.
I would like to utilize the functionality of the CW GPIB control from a
DLL (no user interface). I don't want the presentation layer to pass a reference
to a GPIB control to the DLL as it would violate the encapsulation I am attempting
to achieve. Is there a GPIB object that can be instantiated and utilized
programmatically (w/out a container)? Does anyone know how this might be
accomplished?

Thanks in advance for your help.

Jim Mosher
Andrew Corporation
0 Kudos
Message 1 of 3
(3,546 Views)
Jim:

If you are looking for a GPIB interface without using an ActiveX container, then I would suggesting using the NI-488.2 (GPIB) driver directly. This driver is a DLL that ships with a Microsoft Visual Basic interface, complete with some examples in VB. Of course, the programming model is going to be different than that offered by the ComponentWorks CWGPIB control, but this method may be the best for your application.

Good Luck,

Chris Wood
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,546 Views)
You could also use an invisible container. In VB, add a form to your I/O-level DLL project, and set its Visible property to false. By default, all contained controls are on the form's public interface, so you can access the control from other modules in the DLL. You will, however, need to define delegators for events of interest (see attached sample).

In VC++, you can do the same thing with a CDialog - the key is to make it invisible at run time.

Bruce Landreth
Lexmark
0 Kudos
Message 3 of 3
(3,546 Views)