10-20-2020 03:10 AM
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)
ResetAddress
Else
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?
Thanks
11-08-2020 01:20 PM
Hello
What NI hardware you are using?
12-29-2020 06:21 AM
I have using https://documentation.help/NI-DMM-C.CVI.VB/ this method
and I have to replace CWAIPoint, CWDIO components from
for example I have the next code :
Public Sub OutToPort(iCellNumber As Integer, sCurrentVal As Double, iA8 As Integer, Optional iA10 As Integer = -1)
Dim iCurrentVal As Long, Apa_, Apb_, Bpa_, Bpb_, ICellNumber_ As Integer, C As Integer
Dim Cab1 As Integer, On_%, Off_%
If Lt = True Then
On_% = iStateON%
Off_% = iStateOFF%
Else
On_% = iStateOFF%
Off_% = iStateON%
End If
If Not (Lt = True) Then iCurrentVal = mA2Bit(sCurrentVal, iCellNumber)
If Lt = True Then iA8 = iA8 Xor 1
If Not No_NIDMM Then
If iCellNumber <= FirstCell + NFC / 2 - 1 Then
Apa_ = APA '0
Apb_ = APB '1
Bpa_ = BPA '3
Bpb_ = BPB '4
ICellNumber_ = iCellNumber - FirstCell
Else
Apa_ = CPA '6
Apb_ = CPB '7
Bpa_ = DPA '9
Bpb_ = DPB '10
ICellNumber_ = iCellNumber - NFC / 2 - FirstCell
End If
If Lt = False Then
Dmm.OutputBits.Ports.Item(Bpa_).SingleWrite iLowPart(iCurrentVal)
Dmm.OutputBits.Ports.Item(Bpb_).SingleWrite iHighPart(iCurrentVal)
End If
Dmm.OutputBits.Ports.Item(Apa_).SingleWrite ICellNumber_ 'aDDRESS=0
Dmm.OutputBits.Ports.Item(Apb_).Lines(CellConnect).SingleWrite iA8
Delay 0.05
Dmm.OutputBits.Ports.Item(Apb_).Lines(cSync).SingleWrite Off_%
If iA10 <> -1 Then
Dmm.OutputBits.Ports.Item(Apb_).Lines(PowerRelay).SingleWrite iA10
End If
End If
End Sub
I have to replace by this methods https://documentation.help/NI-DMM-C.CVI.VB/
the parts of Dmm.OutputBits.Ports.Item(X) .....
Dmm is a form that look like
Thanks
01-10-2021 11:08 PM
someone?
06-28-2021 01:53 AM
I'm trying to install Visual Basic 6.0 Professional Edition in Windows 10 Home. I've run VB6 with Windows XP (SP3) for years with no problems. However, when I try to install VB6 in Windows 10, the installer stalls after a short time and becomes not responding.
10-23-2021 02:06 PM
Two weeks ago i had the same issue installing VB6 on Win 10 Pro 64-Bit (setup.exe did not finish registering components).
In the net i found a tip which solved the problem:
Choose Custom Installation at the beginning und deselect Data Objects (including ADO, OLE, DAO).
I dont know why, but i think those runtimes are already part of the operating system and more up to date and cannot be overwritten on the fly.
After this i installed Service Pack 6. Then VB6.EXE need some Compatibility settings, so the IDE respons smoothly when moving custom controls on a form (XP SP3 compatibility mode or similar).
I am using VB6 still on Win 10 for several applications including Measurement Studio 8.6.11 applications.
For me it works.