You know, I have been reading alot of the posts in this section, but I just cannot understand what or how I can use VB to control or monitor anything on my car. It just doesn't seem clear to me about how you guys are using VB for anything automotive. I went to school and learned how to use VB, but I never imagined that I could use it for anything engine related.
I guess that one could create a tachometer with VB, but as far as controlling ecu parameters, I just cannot see it.
Someone just please give me a little bit of insight about the potential usage of VB for cars.
I have Visual Basic 6, C++, Turbo C, Java Script, and I think that's about it as far as the languages that I have. But as far as using them for controlling automotive devices, WTF?
i think your missing a key concept. we dont use our code to control the ecu, we use our code to modify a binary file that is then burnt to a chip that controls the ecu. or, we open a serial connection to the ecu and send/recieve a few bytes back and forth to datalog. as far as VB goes, I can't help, im a C, C++, Objective-C, Java person (their are others, but none worth mentioning in terms of ECU stuff).
I'm assuming your a windows guy since you use VB. If youd like to use linux/unix/macosx id be happy to point you to the code I use in my editor/datalogger. The datalogging code is quite simple and easy to follow if your interested.
another question i have for you is that you say you have...do you know any of the following langauges?
It's soo easy it's friggin pathetic! I applaud Blundar's genious and wish I'd have had the guts to sit down and figure this out 10 years ago with MY first car..
All you need to know is how to perform math related to engine characteristics, how to convert data and how to communicate to the engine's control module. VB6 is plenty powerful, as I have proven with FreeLog.
There's a big difference from 'taking a class' on VB, and actually applying knowledge to put VB to work for you. I had cursory knowledge of Pascal & Quickbasic (Back in the DOS days) and that was more than enough for me to thumb through a book on VB to figure out what I needed to do in a matter of weeks. If you can't think 'outside the box'.. then you will never 'get it'..
When you say "we use our code to modify a binary file that is then burnt to a chip that controls the ecu," isn't that sort of what one would do when using Uberdata? I mean, are the same principles involved?
I have never considered using any of my languages to control or communicate with external devices, probably because I don't know how. I have studied up on instances where people use a language to control electric motors by means of pulse-width modulation. But that's about it.
I am really freakin interested though. I wouldn't mind creating something that displays live engine data, or something similar such as a tach. I know it won't be easy, but I suppose that it's just a matter of figuring out how to do it. I do understand that there is way more to it than meets the eye.
Like I said, I just don't really understand how to communicate with external devices, or how to retrieve data from those devices and be able to use this retrieved data for something useful.
yes, what i meant is the same concept, hondata, crome, uberdata and neptune all use.
getting data from the ecu for datalogging and live display of info isnt like controlling an electric motor. its very simple. You use your programming language to open the serial port (in C its something like open( "/dev/tty0" ); ) and then send it a small command (like 0x01 0x02) or something and wait for it to send data back to the serial port. its all quite easy once you get into it, you just have to get the conceptual model in your head first.
For one thing.. you need either Enterprize edition or Professional just to access the serial port. the version you usually get at schools(IE Learning Edition) may not have a license for MSCOMM..
You simply add a component,(IE MSCOMM32.OCX) to your project.
Assign it some parameters
mscomm.commport=1
mscomm.settings="19200,8,1,N"
open the port
mscomm.portopen=true
send a command
mscomm.output = chr(20)
do a little waiting and then check for a response
Buffer=mscomm.input
convert the data
MyInt=asc(left(buffer,1))
Do some math to make it a real-world value
MyMath=.61*MyInt
display it
MyLabel1.caption="My Speed is:" & MyMath
loop, continue!
When you're done
Close the port
mscomm.portopen=false
if you don't have a license for MSCOMM you can buy a different version of VB or buy a license... SaxComm, for instance, is another comms utility
Where can I get more info on this kind of coding (such as communicating with devices or whatever through the serial port)?
Itdannear, your last post sort of makes sense to me, but I imagine that it will take a little time for me to get a grasp on writing these types of programs.
Your best bet is to take what I showed you and dig into your MSDN help (or go to msdn.com online and browse).
This isn't something you are gonna crack in 2 days with no sleep. I worked for months to get a good useable base application written, and a year of fine-tuning it, yet I'm still not done!
Buy a good, thick VB book and use it for reference.\
Read up in the PGMFI WIKI and the various forums here to learn how to modify your ECU for communications.
Get a loopback connector (Hook pin 2 to pin 3 on your DB9 serial port)
Make a sample application to send and receive text from the serial port, using the loopback to provide a 'known' response.
get a portable supply so you can sit in your car and code. Make a sample app and try it in the car..
Start small, work your way up!