Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

display gpib device identification string and more documentation

I'm relatively new to the Ni measurement studio classes and I'm struggling to find any documentation and examples other than the help files installed in the measurement studio directory (eg NIVCvisa.chm and NI-visa.hlp (inVXIpnp\nivisa)). I've downloaded the NI VISA User Manual, which has plenty of info, but not about the c++ wrapper classes provided by CNiVisa. Please suggest some places to look for examples etc
 
Specific question: how can I read the identification string of a device which is displayed for the attached gpib instruments in MAX.
I can find out what resources are available using
CNiVisaResourceList list;
CNiString str;
list.Find("?*INSTR");
but I would like to read the identification string to display the make and model of the attached scopes, for example.
 
Thanks
0 Kudos
Message 1 of 5
(3,815 Views)
I have worked out how to query the instrument using c++ wrapped visa functions now, but I would still like to hear of any sources of documentation or examples. THanks
0 Kudos
Message 2 of 5
(3,812 Views)

The primary source of documentation for the Measurement Studio VISA C++ library is, as you mentioned in your original post, the NIVCVisa help file that is included as part of the Measurement Studio help. Can you tell me a little more about what you'd feel is missing from the online help? You can also find some example programs that demonstrate using the Measurement Studio VISA C++ library in the VCNET\Examples\Visa directory under your Measurement Studio directory.

Since you referenced the .chm help file in your original post, I assume you're using Measurement Studio 6 - is that correct?

0 Kudos
Message 3 of 5
(3,809 Views)

Thanks for your quick reply.

An example for all (non-trivial) functions and constructors in the help would be useful - eg you could show an example for creating a visa session using CNiVisaSession and send an *IDN? string and read it back. That sort of short example would be very useful in the help to provide a basis for getting started.

Excpetion handling would benefit from more examples - eg How does the GetErrorCode() function work on the CNiException template? Take a simple case, trying to find the error code when a visaresourcelist couldn't find any instruments (ie all instruments turned off)... using this function ,the returned code did not match the one generated by GetErrorMessage().

After 2 days ploughing through the documentation I could find, I'm still not clear what viStatus data type is and how it is used - this is used all over the CNiVisa classes. Looking in help visa>constants>attributes>status codes, I can see lots of different codes - but I don't know what to do with them! Again a few examples of handling this return value would be useful.

In my installation I don't have any examples in \vcnet. I am using version 6 with vc6. I seem to remember opting not to install the .net stuff. I'll rerun the installer and see if I can find these examples you mentioned. There are examples in \vc, but nothing obviously related to visa

0 Kudos
Message 4 of 5
(3,806 Views)
So have you been able to find the example programs, and were they useful to you?
 
I also was hoping you could clarify something from your last post - you said that you ran into a case where "the returned code did not match the one generated by GetErrorMessage()."  GetErrorMessage returns a string - did you mean that the message returned did not match the error code that was returned? If so, could you tell me exactly what code and message you received? I would expect those two pieces of information to always be in sync on the exception object, since the error message is retrieved by requesting the message associated with the error code. Could you possible post the code you used that produced this case?
0 Kudos
Message 5 of 5
(3,785 Views)