Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for examples of 488.2 .NET API library in C# without using the Measurement Studio

Are there any examples to illustrate the use of 488.2 .NET API library without using Measurement Studio?Like for example,create your own GPIB fuctions for open,close,write and read()?
0 Kudos
Message 1 of 12
(9,796 Views)
Hello Ithsin:

The examples should be in a path similar to this:

C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Examples\NI-488.2

Though it is in the Measurement Studio folder it does not have to be opened with Measurement Studio. I hope this information helps.

Regards,

Roland A.
Applications Engineer
National Instruments

Check out VI Roadshow
0 Kudos
Message 2 of 12
(9,779 Views)
Thanks,but I am looking for a more complete documentation.For example what is the difference between a Board class and Device class.
I am running NI 488.2 .NET API library using Microsoft Express Visual C# and if would be useful if I can get the complete documentation.
For example, in Labwindows C there is this function called ibconfig().How is it being represented by the API library.Is there any documentation of comparison?The HELP topic on NI Measurement Studio .NET Class Library didn't help much either.Some of the help topics even directed me to a broken link.
What is the best way and fastest way to learn how to use NI 488.2 .NET API library in C#?
0 Kudos
Message 3 of 12
(9,768 Views)

Hi lthsin,

Do you remember which help topics sent you to broken links? The Visual Studio Express Editions don't allow for 3rd party integration so I that might have something to do with the behavior you are seeing.  As far as complete documentation for the NI 488.2 .NET API, the best resource is the examples that Roland send you and the Using the Measurement Studio NI-488.2 .NET Library concept help topic under the NI Measurement Studio .NET Class Library category. That talks about using devices and boards, using I/O operations, handling service requests, etc. Just as a side note, Measurement Studio does provide several helpful features with regards to programming the NI-488.2 driver in .NET such as Instrument I/O Assistant which generates VISA or GPIB code, walkthroughs of creating instrument I/O applications, as well as other help topics.

Right now we don't have a 1-1 mapping C-to-.NET API help topic but we are considering adding this feature in the future. Could you please submit a product suggestion so we have a record of this request in our database?  I assume you have been working with the 488.2 C API for a while and want an easier transition to .NET? Is that a correct assumption? If not, please elaborate on your situation. 

If you have any suggestions on improving our help, please submit a product suggestion.

Thanks and Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 4 of 12
(9,760 Views)
Jonathan,thanks for your reply.

Yes,I have been working with the 488.2 C API for a while and want an easier transition to .NET. Currently I am finding it difficult to do it in C# .NET using the 488,2 .NET API library because of the problems that I mentioned in my previous post.

I will submit a product suggestion on the 488.2 .NET API libary.

Thanks.

-lthsin

0 Kudos
Message 5 of 12
(9,749 Views)
I will go back to using NI 488.2  Windows Language Interface wrapper.May I know the latest version?
The one that I downloaded from NI site is version 1.0.1532.22842 runtime version 1.1.4322
Is this the latest version?Just wanna make sure.
 
Thanks.
0 Kudos
Message 6 of 12
(9,740 Views)
I am facing the same issue here.
 
I wish to convert my GPIB application (written in VS 2002 by using LangInt.dll) to Visual Studio 2005 using C#.
I read thru the NI Measurement Studio .NET Class Library Help, but it confusing me.
 
I also try to read the examples provided, but it doesn't help much. The examples are too simple and most of the function not covered.
 
Here are some questions I wish to ask:
1. How to make a service request from controller (I mean trigger the ibrsv command)?
2. What does Notify() method use for?
3. I am struggled for using Device class or Board class. What are the differences between these 2 classes? How should I determine which class to use?
4. When communicate between 2 devices, is that both devices must use the same driver version?
 
 
I hope someone could answer my questions so that I can continue with my project. Thanks in advance.
0 Kudos
Message 7 of 12
(9,534 Views)
Hi mau_horng,
 
The first 2 questions can be answered in the NI-488.2 help file installed with the NI-488.2 drivers.  In Windows, browse to Start>>All Programs>>National Instruments>>NI-488.2>>NI-488.2 Help.  Click on the "Search" tab and search for "ibrsv".  You will then see a detailed description on how to use it.  Do the same thing with "Notify" and you can browse through some help documents. 
 
For question 3, board level commands send a command to your GPIB interface (for example, your PCI-GPIB, or USB-GPIB-HS).  An example of a board level command would be ibfind, which will find a GPIB interface, or ibcmd which allows the bus to send multi-line messages.  Device level commands are used to directly communicate with an instrument attached to the GPIB board, for example an oscilloscope with a GPIB cable attached to your GPIB board.  Examples of a device level command are ibwrt and ibrd which write and read to/from an instrument.
 
For question 4, I am not sure what you are asking.  What type of devices are you communicating with each other?  If you have one GPIB controller card and one instrument, then there will be only one controller, thus one driver version.  Even if you had multiple instrument attached to your GPIB card, you will still have only one controller and thus, only one driver version.  If you are communicating between 2 PCs for example, and both PCs will be sending commands over the bus, it is best to have the same driver version, but the basic GPIB commands will still be the same. 
 
I hope this gets you going on your project.  Best of luck!
Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 12
(9,510 Views)
Hi Chris_R. ,
 
Thanks for your reply.
 
For the "ibrsv", I had read thru NI-488.2 Help, but it just tell me how to write in C. My main problem in how to implement it in C# with Visual Studio .Net 2005. Should I implement the "ibrsv" with Notify() in C#? Which documents I need to refer to?
 
For question 4, what I mean is communication between 2 GPIB interface devices. For example, I have 2 PCs with GPIB card installed, and I want both to communicate and send data to each other thru the GPIB interface. So, do I need to use the same driver for both PCs?
 
Your answer for question 3 is good for me to understand the concept. Thanks a lot.
0 Kudos
Message 9 of 12
(9,488 Views)
Hi mau_horng,
 
There should be some C# examples for GPIB installed with the NI-488.2 driver IF you select the .NET Assemblies and the Measurement Studio support to be installed in the installation of the drivers.  This will not be installed automatically.  Here is what the installation screen looks like:
 
 
Once you install these components, you can locate some C# examples in the following Windows directory:
 
"C:\Documents and Settings\All Users\Documents\National Instruments\NI-488.2\Languages"
and/or
"C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Examples\GPIB"

 
Check these out to see if you can find anything you can use.  A document that may also be helpful for this process is located here.
 
As for question 4, you should not have to have the same version of the 488.2 drivers on each computer since the GPIB command set is a standard.  If you want maximum compatiblity with non-standard features of each PC, it is a good idea to have them both use the same version, but again, you should have no trouble if the PCs have different versions of NI-488.2.
 
I hope this helps!

Message Edited by Chris_R. on 10-25-2007 01:43 PM

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 12
(9,474 Views)