pgmfi.org

Hacking up Honda's ECU
It is currently Sat Apr 21, 2018 5:30 am

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Datalogging with VB 2005
PostPosted: Sun Aug 19, 2007 4:40 pm 
Offline

Joined: Sat Apr 09, 2005 9:53 am
Posts: 625
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:


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Aug 19, 2007 9:09 pm 
Offline

Joined: Tue Jul 27, 2004 3:01 am
Posts: 2945
Location: Tampa bay, Florida
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 22, 2010 3:08 am 
Offline

Joined: Tue Jun 22, 2010 2:43 am
Posts: 3
Here is my current VB code that gets the data from the OnComm (thanks stan (for the txtbox code)):<code><pre><font size=2

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 22, 2010 3:09 am 
Offline

Joined: Tue Jun 22, 2010 2:43 am
Posts: 3
Here is my current VB code that gets the data from the OnComm (thanks stan (for the txtbox code)):<code><pre><font size=2

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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB® Forum Software © phpBB Group