01-28-2008 06:48 AM
01-28-2008 08:41 AM
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.
01-29-2008 05:22 PM
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
01-30-2008 05:42 AM
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
01-30-2008 05:46 AM
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
01-31-2008 05:37 PM
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.
02-01-2008 05:13 AM
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
03-04-2014 09:56 AM - edited 03-04-2014 09:57 AM
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!