Measurement Studio for VB6

Showing results for 
Search instead for 
Did you mean: 

CWAIPoint, CWDIO VB6 on windows 10



I have a project using vb6 running on win7 using the CWAIPoint and CWDIO 


using the code example:


Option Explicit

Private Sub Form_Load()
    CWAIPoint1.Device = 1
    CWAIPoint1.channels(1).ChannelString = 0
End Sub
Public Function GetVoltageRead(Ch As Integer, Current As Double, Connected As Integer, Optional AvgN As Integer = 1) As Variant
Dim Measurement As Variant, I As Integer, MeanV As Single, Reading As Single
If Not No_NIDMM Then
    If AvgN <= 0 Then AvgN = 1
    Delay 0.15
    OutToPort Ch, Current, Connected
    Delay ReadDelay ' 0.35 '0.25 '0.2
    For I = 1 To AvgN
        CWAIPoint1.SingleRead Measurement
        Reading = Measurement
        MeanV = MeanV + Reading
    Next I
    V(Ch) = Val(Format(MeanV / AvgN, "###0.0###"))
    GetVoltageRead = V(Ch)
    V(Ch) = Rnd * 1.5 + 1.8
    GetVoltageRead = Val(Format(V(Ch), "###0.0###"))
    Exit Function
End If

End Function




I have to rewrite the part of the code that using 

CWAIPoint and CWDIO that use Read the Measurement on win10 


That is possible? There is an example of that?


0 Kudos
Message 1 of 2



What NI hardware you are using?

The best way to thank, is to give KUDOS
0 Kudos
Message 2 of 2