From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Internal Routing Capabilities of USB 6212

Hi,

 

I am transitioning legacy NI-DAQ VB6 code written for the NI-6062E to DAQmx VB6 code which will now utilize the USB-6212.    From what I understand, the constant "ND_INT_AO_CH_1" (which is utilized in my legacy code) internally routes analog output channel 1 to the analog to digital converter.  Similiarly my understanding is the constant "ND_INT_AI_GND" internally routes analog input ground to the analog to digital converter.  I thought that I would be able to acheive a similiar result in DAQmx by utilizing the set of constants shown below (src: http://zone.ni.com/reference/en-XX/help/370466V-01/mxdevconsid/mseriesinterchan/).  However, I wanted to confirm whether this approach is correct and if so, what are the appropriate contants in DAQmx that I should be utilizing in my code?  

 

 

Capture.JPG

 

 

Below is the relevant code snippet that I am rewriting.  

 

 

Public Function VoltageGet(ND_INT_AO_CH_1, Voltage As Double, Optional ResetCh As Boolean = True) As String
'// Returns the voltage measured on a given channel
    '// Configure channel for single-ended, bipolar operation
    iStatus = AI_Configure(iDevice, ND_INT_AO_CH_1, 1, 0, 0, 0)
    If iStatus <> 0 Then
        VoltageGet = "ERROR_DAQ - " & iStatus & " " & GetDAQError(iStatus)
        Exit Function
    End If
    
    If ResetCh Then
        '// Read in internal ground reference to dissipte any capactive charge left on the mux
        iStatus = AI_VRead(iDevice, ND_INT_AI_GND, -1, Voltage)
        If iStatus <> 0 Then
            VoltageGet = "ERROR_DAQ - " & iStatus & " " & GetDAQError(iStatus)
            Exit Function
        End If
        Delay 0.1
    End If
    '// Read in voltage of specfied channel
    iStatus = AI_VRead(iDevice, ND_INT_AO_CH_1, -1, Voltage)
    If iStatus <> 0 Then
        VoltageGet = "ERROR_DAQ - " & iStatus & " " & GetDAQError(iStatus)
        Exit Function
    End If
    VoltageGet = "PASS"
    Exit Function
End Function

 

0 Kudos
Message 1 of 6
(7,600 Views)

Hi, gears46a. Just so you know, VB6 is a legacy product for National Instruments so we have limited resources regarding its implementation. With this being said, I believe the constants you've found are the appropriate internal channel names for DAQmx that you can utilize in your code. _ao1_vs_aognd should internally route the voltage difference between AO channel one and AO ground to the analog to digital converter. Since VB6 is a legacy product for both NI and Microsoft, you may want to consider updating your programming language as you are also updating your DAQ driver.

 

Christine S

Applications Engineer

0 Kudos
Message 2 of 6
(7,586 Views)

Hi Christine,

 

Thanks for the quick reply.  I agree that updating my VB6 code to a non-legacy product would make sense.  Unfortunately the client I am assisting still wants to stay with VB6 for the time being.  Regarding the constants in the table I provided in my original post, I am not sure whether I can utilize them as they don't seem to appear under any of the enumerations provided in the NIDAQmxCAPI.  In the legacy NI-DAQ library, the "ND_INT_AI_GND" constant has a value of 21210.  In the NIDAQmxCAPI, none of the global constants seem to equate or relate to internal routing.  None of those constants have names which would indicate they pertain to internal routing.  Is there a way (aside from visual inspection) to verify what global constant would relate to " _ao1_vs_aognd"?

 

Thanks,

 

Scott

0 Kudos
Message 3 of 6
(7,578 Views)

Did you install NI-DAQmx with support for Visual Basic 6?

 

I have a help file called NI-DAQmx C API Visual Basic 6.0 Help

 

 

By the way, this is the wrong forum for your question.

You should be asking in Multifunction DAQ; though I don't know how many people are still programming in VB6.

 

 

 

0 Kudos
Message 4 of 6
(7,559 Views)

Yeah, I have reviewed the examples included with a DAQmx install.  There aren't too many (the list is shown below) and none of them show an example of the functionality that I am trying to utilize.

 

List of VB6 examples

If this functionality is not available in VB6, than that's fine (VB6 is a legacy language).  However, I just wanted to confirm to make sure I wasn't misssing anything.

 

Thanks,

 

Scott

 

0 Kudos
Message 5 of 6
(7,503 Views)

As I wrote before, this isn't the forum for your question.

Try the DAQ forum.

I didn't see any internal routing available for the USB 6212 listed in the Help file, but I could be wrong.

 

 

0 Kudos
Message 6 of 6
(7,479 Views)