Datalogging with VB 2005

fastcrxsi90

#1 ◈ 2024-03-01

has anyone been able to get this to work yet? to start, ive only been using vb for a few months now…so i am years behind the curve. im attempting to create a working copy of ecucontrol, using 2005 so that it may be edited by myself and others by just downloading a free copy of 2005 express. so far im not 100% sure its possible….

all the code ive seen, (except for ecucontrol.net) uses mscomm to control the serialport. from what ive read, you need a copy of vb6 in order to even use mscomm control.

ive added mscomm and tried using it, but on mscomm1.output i get an error “exception from HRESULT: 0x800A017C (CTL_E_INVALIDPROPERTYVALUE)”, i assume this is because its not registered with vb6…

since i cant get mscomm to work, ive been trying to use the serialport resource available in 2005, and i can read and write through the port (looping through a modem), but when connected to the ecu i don’t seem to be able to read anything… i know that there is incoming data when connected to the ecu, because the serialport.datarecieved event is firing….

i just don’t know if the data i am sending is formatted correctly, therefore im not really receiving anything?

original vb6 mscomm code
Code:
Me.MSComm1.Output = Chr(CByte(General.HextoLong(databyte)))

Buffer(sensor) = CByte(HextoLong(Hex(Asc(StrConv(Me.MSComm1.Input, vbUnicode)))))


vb 2005 serialport code
Code:
Me.SerialPort1.WriteLine(Chr(CByte(General.HextoLong((databyte)))))

Buffer(sensor) = CByte(General.HextoLong(Hex(Asc(Me.SerialPort1.ReadLine))))


Example, for the iat
Writeline -
databyte = “32” (hex)
HextoLong = Val("&h" & HexNum$) = val(“&h32”) = 50 (dec)
Cbyte(50) = 50
Chr(50) = 2 (ascii)

since im really new at this, im not sure what exactly im sending and recieving from the ecu...
im not really sure what the strconv(mscomm1.input, vbunicode) is doing either (if that is one of my problems)…its not supported in 2005…

anybody have any luck with 2005 or have any suggestions for me...ive tried doing my research, but i just cant get past this part...

thanks in advance, and sorry for the long drawn out post :oops:

Ltdannear

#2 ◈ 2024-03-01

I started to work in vb2005 express..
I haven't made it over the steep learning curve.. but if you find the answers, be sure to post here!

You might try reading the online help or searching sites like devx.com

arcksonn

#3 ◈ 2024-03-01

Re: Datalogging with VB 2005

Here is my current VB code that gets the data from the OnComm (thanks stan (for the txtbox code)):

face='Courier'>Private Sub MSComm1_OnComm()
Dim InBuff$ ' As String
Dim Data As Integer
If FrmDatalogger.MSComm1.CommEvent = comEvReceive Then
InBuff = FrmDatalogger.MSComm1.Input
' FrmDatalogger.LstData.AddItem InBuff$
With FrmDatalogger.LstData'place data into list box
.AddItem InBuff$ '
End With '
With FrmDatalogger.TxtData'place data into txtbox
.SelStart = Len(.Text)
.SelLength = 0
.SelText = InBuff$
End With
End If
End Sub </font></pre></code>
The data in the list box sort of wraps itself over two lines instead of one like in the txt box....
AnyIdeas guys

arcksonn

#4 ◈ 2024-03-01

Re: Datalogging with VB 2005

Here is my current VB code that gets the data from the OnComm (thanks stan (for the txtbox code)):

face='Courier'>Private Sub MSComm1_OnComm()
Dim InBuff$ ' As String
Dim Data As Integer
If FrmDatalogger.MSComm1.CommEvent = comEvReceive Then
InBuff = FrmDatalogger.MSComm1.Input
' FrmDatalogger.LstData.AddItem InBuff$
With FrmDatalogger.LstData'place data into list box
.AddItem InBuff$ '
End With '
With FrmDatalogger.TxtData'place data into txtbox
.SelStart = Len(.Text)
.SelLength = 0
.SelText = InBuff$
End With
End If
End Sub </font></pre></code>
The data in the list box sort of wraps itself over two lines instead of one like in the txt box....
AnyIdeas guys

RECOVERED SO FAR: 7,001 topics · 4,988 posts · 1,382 members

archive viewer · live · recovery in progress · content © original authors