Example Code

Archived: Performing Simple GPIB Communication in Visual C# .NET with Measurement Studio Active X

Code and Documents

Attachment

Overview


This document has been archived and is no longer updated by National Instruments.

This example demonstrates how to use the Measurement Studio GPIB (CWGPIB) control to write to and read from a GPIB instrument. Be default, the example configures an instrument at primary address 2 and secondary address 0 on GPIB board number 0.

To read or write from a specified GPIB instrument, you must configure the system for the specified board and instrument address.

NOTE: The Measurement Studio ActiveX controls were designed for use in Visual Basic 6. When using these controls in Visual Studio .NET, keep the following differences in mind.
--Visual Studio .NET generates a Runtime Callable Wrapper (RCW) around each control, and you must go through the Interop layer to use the controls. As a result, some class names are different.
--Hosting an ActiveX control in Visual Studio .NET requires unmanaged code permissions.
--Hosting an ActiveX control in a Windows Form increases the size of your project files because the entire control is embedded in the form.

For more information about using ActiveX controls in Visual Studio .NET, refer to the Visual Studio .NET help.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors