![]() |
|
#1
|
|||
|
|||
RPM collection by parallel portHi I am new here and hope someone well known to C++ and parallel port scanning can shed a light on my problem.
I am working on a home made build cheap (poor mans version for rebuild) model car engine dyno. To produce graphs and figures of power and torque I need to log RPM from the engine and flywheel. We tried USB dataloggers but they failed in accuracy. Then someone said to use the PC's parallel port. He also made a sample MotorTest.cpp file that he said he would convert into a .dll so I could call this .dll to record rpm in my already made VB program. But he never converted it to a .ddl file. The person in question does not respond any more and I am left with an unfinished project. I know how to do some VB programming after a fresh start 1,5 years ago. To start all over again but then learning with C++ would cost me more time then I have and I like the project to be finished and test engines. Can someone tell me if it is possible to convert the MotorTest.cpp file into a working .dll where RPM can be called from LPT1 port on data adress &H379,5 and &H379,4? I have ran through the .cpp file and see things known to me compared to VB 6.0 but C++ skills are lacking me to work on it. The MotorTest.cpp file is attached A view on the whole dyno project: http://www.twf8.ws/ follow the DTTS link to the manual Any help in the right direction would be appriciated. If I can manage to do it myselve with some back up I will always be willing to try and have a go on C++. But I first need to know if the MotorTest.cpp can be used at all. Many thanks in advance for reading, Paco Raap |
|
#2
|
|||
|
|||
Re: convert .cpp to .dllHi, I installed Microsoft Visual C++ 2005 Express edition.
Tried the help function to look for the convertion to .dll but cant find it inside the helpfuntion and also googled for it whit no result. Where to start to convert this .cpp file to .dll No one to give a start? I am willing to learn. No need for complete codes or steps just parts is OK. Thanks, Paco |
|
#3
|
|||
|
|||
Re: convert .cpp to .dllHi TEAMTWF8, i'm also interested in DLLs, but i haven't got the time exploring. BUT i got some web link tutorials which i search on the Net some time ago.
http://www.codeguru.com/cpp/cpp/cpp_...cle.php/c4019/ Hope this helps!! |
|
#4
|
||||
|
||||
Re: convert .cpp to .dllYou need to select "Win32 DLL" as the project type when you create it in Visual Studio. This will determine the linker to create a dll for you (instead of an .exe) as the binary output.
Please read this post about how to export stuff from dlls. If you really can't work it out with this info, please post back and we will attempt another approach... Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#5
|
|||
|
|||
Re: convert .cpp to .dllHi both,
Thanks for the links and the interest and time sofar to guide me. Had a quick look at luciWiz examples. Did not fully understand as I just read it only. Will try end of this week to read some times more over and see if I fully understand and learn from what the example shows. When I succeed or not I let you know. BTW I really do not know if the .dll is what I need but the guy said he would make a .dll if the .cpp code was OK so I could call it from the VB files I have. If you think this is a no go please tell me if I am on the wrong way. Thanks sofar, Paco |
|
#6
|
||||
|
||||
Re: convert .cpp to .dllQuote:
You can call a C++ dll from Visual Basic, yes. As I understand you are using VB 6, not .NET. I need to (re-)install VC 2005, as there seems to be an abundance of people using it. I asume you also have Visual Studio 6 or just VB 6 available, because you won't find an equivalent version in VS2005... I would like to help you build your dll; I downloaded the archive you attached and there is only a .cpp file. If you have the corresponding header please post it as well (you don't need to attach it, just copy & paste the code, in between [cpp] [/cpp] tags). Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#7
|
|||
|
|||
Re: convert .cpp to .dllHi LuciWiz,
Thanks for a fast answer and assistance. The motortest.cpp file is ALL I got from the guy who wrote this .cpp file. Nothing else I received. If you say it is not enough then we (I) have to stop? I designed all other programs for the DYNO in VB 6.0 not in ".NET". Sorry if that was what you thought. For looking in the .cpp file is use Visual C++2005 Express Edition. Is this program sufficient or do I need other FULL C++ programs? What is the "HEADER" you asked for, is this special to C++? Never heard it when doing VB. Sorry if my C++ new bie skills are insufficient. Thanks and regards, sofar. BTW. when you look in the motortest.cpp file do you understand what happens by reading the parallel port ON/OFF states as pulses and setting timestamps for those so they will become RPM values? Paco |
|
#8
|
||||
|
||||
Re: convert .cpp to .dllQuote:
I am pretty sure we can rebuild the header (the C/C++ somewhat specific .h file) just by looking at the source (.cpp) file. I haven't really looked through the code yet. I can tell you the developer used a Driver for the Parallel port called "DLPortIO", which is documented to be working on Win95 and WinNT. I don't know whether it will work on XP - or whether Win XP is your targeted platform for that matter. It's pretty late over here, so I will get back to you tomorrow; however, note that there are many people on this forum who can provide help on this matter, so don't think I am your only hope Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#9
|
|||
|
|||
Re: convert .cpp to .dllHi Lucian,
I think I might need to provide more info about what it is all about? The whole project needs to run on XP and future Vista. I know VB is problem under Vista but for intial try and error XP is the key. As far as I know the designer of motortest.cpp knew I was into XP and he tested this .cpp also as far as I know for accuraccy on a XP machine. If someone needs more back ground info first let me know and I will provide all I know and have. Here late too time to got to sleep. Thanks again, Paco |
|
#10
|
|||
|
|||
Re: convert .cpp to .dllLucian,
Someone has seen the problem i mentione don my homepage and told me he has professional experience in Parallel port and C++ and would assist if possible. He has promissed me to see if the .cpp is useable or not or need modification. Just wait and see what comes out of it. Thanks sofar for your ideas and assistence, Paco |
Recent GIDBlog
Welcome to Baghdad by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A Parallel Port Control Program with Hotkeys for each pin? | chemical | Miscellaneous Programming Forum | 1 | 05-Apr-2007 10:38 |
| Compiling errors in binary tree code | rahul_2550 | C Programming Language | 1 | 22-Mar-2007 15:07 |
| Hard drive/CPU Diagnoses Issues | binarybug | Computer Hardware Forum | 1 | 22-Jan-2007 19:23 |
| Could someone please look this over? | clarjon1 | C++ Forum | 4 | 10-Jan-2007 07:05 |
| Parallel Port I/O | markwalker84 | MS Visual C++ / MFC Forum | 1 | 26-Jul-2006 02:47 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The