Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

NIDMM.vb and NISWITCH.vb wrapper warning

I am writing an application in VB.net (VS2005 & MeasStudio 8.2.1) where I want to control a PXI-4065 DMM and a pair of PXI-2575 196 channel multiplexers to take various voltage and resistance measurements on a demand basis (table driven).  I've created my vb.net application with measurement studio and added to the project the NIDMM.vb and NISWITCH.vb wrappers as specified in the KB article "Microsoft Visual C# and Visual Basic .NET Wrappers for National Instruments Modular Instruments Drivers".
 
After I added the two wrappers, I get many warning messages as follows...
 
Warning 1 XML comment parameter 'Instrument_Handle' does not match a parameter on the corresponding 'sub' statement. XML comment will be ignored. C:\Documents and Settings\georgep9164\My Documents\Visual Studio Projects\QCT01\QCT01\niDMM.vb 80 8 QCT01
Am I missing something that should be added to the project?
 
Also, I've not used the "XML documentation" feature used in the two wrappers.  How can I "process" the two files to get the documentation?  Will this work properly with VS2005?
 
Lastly, assuming that I am going about this application in the correct method, are there some examples that would show me how to set a specific switch channel(s) and then take a voltage or resistance measurement with the DMM?  I've been looking around but Ihaven't found any examples.
 
Thanks!
 
0 Kudos
Message 1 of 8
(5,226 Views)

OK, going back to the NIDMM.vb class that NI provides, the first instance of the warning comes from the line "<param name="Instrument_Handle">"  in the XML comments listed below.

    '''<summary>
    '''
    '''Creates a new IVI instrument driver session.
    '''Opens a session to the device you specify for the Resource_Name parameter.
    '''If the ID Query parameter is set to TRUE, this function queries the instrument ID and checks that it is valid for this instrument driver.
    '''If the Reset parameter is set to TRUE, this function resets the instrument to a known state.
    '''Sends initialization commands to set the instrument to the state necessary for the operation of the instrument driver.
    '''Returns a ViSession handle that you use to identify the instrument in all subsequent instrument driver function calls.
    '''
    '''Note:  This function creates a new session the first time you invoke it for a device. If you call niDMM_Initialize on the same resource, the original session is returned. You can use the same session in multiple program threads. You can use the niDMM_LockSession and niDMM_UnlockSession functions to protect sections of code that require exclusive access to the resource.
    '''
    '''
    '''</summary>
    '''<param name="Resource_Name">
    '''Contains the resource name of the device to initialize.
    '''
    '''Valid Syntax:
    '''
    '''-NI-DAQmx name
    '''-DAQ::NI-DAQmx name[::INSTR]
    '''-DAQ::Traditional NI-DAQ device number[::INSTR]
    '''-IVI logical name 
    '''
    '''Caution  All IVI names for the Resource Name, such as logical names or virtual names, are case-sensitive. If you use logical names, driver session names, or virtual names in your program, you must make sure that the name you use matches the name in the IVI Configuration Store file exactly, without any variations in the case of the characters in the name.
    '''
    '''
    '''
    '''
    '''</param>
    '''<param name="ID__Query">
    '''Specifies whether the driver performs an ID query. When this parameter is set to VI_TRUE, the driver verifies that the instrument is of a type that this driver supports.
    '''
    '''
    '''Defined Values:
    '''
    '''
    '''VI_TRUE (1) - Perform ID Query (default)
    '''VI_FALSE (0) - Skip ID Query
    '''
    '''
    '''</param>
    '''<param name="Reset_Device">
    '''Specifies whether to reset the instrument during the initialization procedure.
    '''
    '''
    '''Defined Values:
    '''
    '''
    '''VI_TRUE (1) - Reset Device (default)
    '''VI_FALSE (0) - Don't Reset
    '''
    '''
    '''</param>
    '''<param name="Instrument_Handle">
    '''Returns a ViSession handle that you use to identify the instrument in all subsequent instrument driver function calls.
    '''
    '''
    '''
    '''
    '''</param>
    Public Sub New(ByVal Resource_Name As String, ByVal ID__Query As Boolean, ByVal Reset_Device As Boolean)
        MyBase.New
        Dim pInvokeResult As Integer = PInvoke.init(Resource_Name, System.Convert.ToUInt16(ID__Query), System.Convert.ToUInt16(Reset_Device), Me._handle)
        PInvoke.TestForError(Me._handle, pInvokeResult)
        Me._disposed = false
    End Sub

I noticed that the XML comments specify four parameters, but the SUB only has three parameters defined.  Hence, the warning!  A question for NI... Why the mismatch?  Has NIDMM.vb changed?

I would still like to know how to print the XML comments for the class documentation.

 

0 Kudos
Message 2 of 8
(5,222 Views)

Hi psgeorge,

Since a native API for modular instruments products such as Switches and DMMs is not currenly available in .NET, we therefore have no example programs in the .NET languages. Feedback on this API, and requests for support such as examples programs is appreciated and can be made to the Product Suggestion Center on the Contact Us page of ni.com.

You could, however, look at the example programs for C and VB to possibly get an idea of the flow and how a Switch or DMM session works. The examples that you will be interested in are the niSwitchDMMSwitchSynchronousScanning and niSwitchSMMSwitchHandshaking. These examples can be found under Programs>> National Instruments>> NI-Switch>> Examples>> VB or C. These examples demonstrate how to scan a series of channels on a switch module and take measurements with an NI digital multimeter.

With regards to the XML comments warning, I opened the wrapper and noticed the same issue, where there were four parameters specified but only three asked for. When you received this warning, was your program still able to run, or did it stop completely?

Regards, Mallori

Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
0 Kudos
Message 3 of 8
(5,200 Views)

Hi Mallori,

Thanks for the response.  I'll take a look at the examples you suggested.  I've spec'd up and received a quote from NI for a PXI based system (PXI-1033 chassis, PXI-4065 6 1/2 digit DMM and two PXI-2575 196 channel multiplexers) and I want to make sure that I'm going to be able to properly measure voltages and resistences from a specified channel combination properly from a vb.net (vs2005 & measurement studio 8.1.2) application before I go ahead with the purchase.  As you mentioned, examples for this hardware/software combination are hard to find.  The other problem is that I don't have the hardware to actually test the code on.

As far as the wrapper warnings... again, the warnings won't cause any problem in the build but, without hardware, I just cannot see what is going on.

I guess what I'm trying to do here is get a "warm and fuzzy" feeling from the examples that if I go ahead and purchase the hardware, everything will work as I assume it will.

Just as a bit of background, I have the test application (vb.net) running properly on old HP75000 GPIB based hardware (DMM & switches) and it works great.  I have a number of these systems in several plants.  The problem is that this hardware is essentially obsolete and replacement parts are starting to become an issue so I am looking to move my various applications to a new hardware platform.

Anyway, thanks for the examples code references... I'll take a look at them.

 

Regards... Paul

0 Kudos
Message 4 of 8
(5,196 Views)

Mallori,

I just looked under Programs>> National Instruments>> NI-Switch and I do not have the NI-Switch directory because I haven't purchased the package yet... duh!  Anyway, is this code available on the NI website?  I'll do a search and see if I can find them.

Thanks!

Paul

0 Kudos
Message 5 of 8
(5,195 Views)

Hi Paul,

Sorry I didn’t point this to you last post, but the device drivers can be found online at ni.com under the  Support tab by selecting Drivers and Updates. You can search for NI-DMM and NI-Switch. The drivers will also come on the CDs included with the hardware.

I was searching online at ni.com and I was able to find two VB.NET examples in the Developer Zone. Continuous Acquisition with NI-DMM in VB.NET and VB.NET niSwitch - Making Connections on a Switch. The examples can be integrated and the DMM measurement changed from continuous to one point to accomplish your measurement task.

Hope these help in your application, Mallori M.

Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
0 Kudos
Message 6 of 8
(5,167 Views)

Mallori,

Thanks so much for your response and interest.  This information will be most helpful.  I did find the two vb.net examples you indicated and, with a little effort, I believe I'm good to go!

Thanks again! (until my next question!)

Paul

0 Kudos
Message 7 of 8
(5,161 Views)

I realize this is an old post, but I wanted to post an update. It appears a CAR (Corrective Action Request) #103668 was filed to fix this issue back in 2008. If anyone is experiencing this error, I recommend downloading the latest version of NI-SWITCH for Visual Studio 2010 and 2012. It contains support for .NET 4.0 and 4.5: Download NI-SWITCH .NET Support v1.1

 

This driver installs with example projects, which can be found at this location: 

C:\Users\Public\Documents\National Instruments\NI-SWITCH\examples

 

The VB examples do not have this XML warning. If the warning is discovered again, National Instruments is open to customer feedback about products. Hope this helps!

Taylor B.
National Instruments
0 Kudos
Message 8 of 8
(3,716 Views)