Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an OCX for accessing the GPIB interface via a Scripting language, e.g. VBScript or JavaScript?

Our company has purchased the "NI GPIB Interface Card for PCI" (PCI-GPIB) and we were wondering if any of you have access to an OCX (COM DLL) for accessing the GPIB interface via a Scripting language, e.g. VBScript or JavaScript?

Your help would be greatly appreciated,

Thanks,

Jacob.
0 Kudos
Message 1 of 9
(6,190 Views)
Hi,

National Instruments provides a series of ActiveX controls in Measurement Studio.

Measurement Studio contains both GPIB and VISA ActiveX controls. These are ocx files and can be used in any ActiveX container (Visual Basic, LabVIEW). If VBScript or JavaScript are able to interact with ActiveX cotntrols, then you'll be able to use them.

For more information on Measurement Studio, go to:
http://sine.ni.com/apps/we/nioc.vp?cid=3769〈=US

Diego Funes.
National Instruments
0 Kudos
Message 2 of 9
(6,190 Views)
Hi Diego,

I have an evaluation version of ComponentWorks 2.0.1, that came with the GPIB card, purchased from National Instruments. This package contains a "cwinstr.ocx" file that includes a CWGPIB object. I am able to access this object's method's & members via VB, but cannot via VBScript or JavaScript, though they interact with other ActiveX controls with no problems whatsoever.

Your help would be greatly appreciated,

Jacob.
0 Kudos
Message 3 of 9
(6,190 Views)
Hi,

There's no difference between the CWGPIB control and the command button control. They both provide the same interface to the ActiveX container.
I tested the ActiveX GPIB control in a VBScript html file. To generate the page I used Microsoft's Control Pad, which is a free utility and can be downloaded at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaxctrl/html/cpad.asp

I'm attaching the html example code.

Hope this Helps out.

Diego F.
National Instruments
0 Kudos
Message 4 of 9
(6,190 Views)
Hi Diego,
I tried your link, but when I access it I receive the following pop-up message:
"Error loading control. A newer version needed. The default settings for the control will be used."

Where can I get this "newer version". I thought the one that came with the card should suffice.

Thanks,

Jacob.
0 Kudos
Message 5 of 9
(6,190 Views)
Hi,

You can check the version of the ocx file by looking at its properties. In any case, the best way for you to use the ActiveX control you have there is to make a test html file. Use the control pad utility provided by Microsoft.
Instead of opening my example, save it in your harddrive and then open it using a text editor or Control Pad. All the object initialization in the example was generated by control pad.

Diego F.
National Instruments.
0 Kudos
Message 6 of 9
(6,190 Views)
Hi Diego,

I have National Instruments CW Instr 6.0 (Ver 1.4).

When I try to access one of the members or methods of CWGPIB (from the cwinstr.ocx) via a scripting language, such as VBScript or JavaScript, I receive an Automation error: 0x8000FFFF, which is described in WINERROR.H as a "Catastrophic failure".

The attached script is written in VBScript and reproducues the problem.

I ran it via the command line using the Windows Scripting Host standard MS application. The command used is: wscript /E:vbscript gpibtest.vbs

The execution of the script resulted in the abovementioned error.

I would appreciate any help you might be able to provide on this issue.

Thanks,

Jacob.
0 Kudos
Message 7 of 9
(6,190 Views)
Hi,

I don't know what could be going on. I'm not familiar with VBScript. The control works in other ActiveX containers (Visual Basic, LabVIEW) and even in VBScript using the ActiveX Pad utility, which means that it is properly installed. It seems like something specific to VBScript and how it handles activex controls. There should be an utility on the web that would allow you to add ActiveX controls to a VBScript, automatically doing all the configuration. Something similar to the control pad.

Diego F.
National instruments.
0 Kudos
Message 8 of 9
(6,190 Views)
Hi Diego,

I have used several ActiveX components in VBScript and JavaScript via the standard Windows Scripting Host (cscript/wscript) with no problems whatsoever. Unfortunately, in this case, it seems like there is some sort of limitation with this specific component. Could it be possible that before accessing this component there are other components that need to be loaded within the scope of the Windows Scripting Host executable, i.e. within the script file itself? If so, I would very much appreciate knowing what they are in order to resolve this issue.

Thanks,

Jacob.
0 Kudos
Message 9 of 9
(6,190 Views)