GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 28-Jun-2007, 14:13
TEAMTWF8 TEAMTWF8 is offline
New Member
 
Join Date: Jun 2007
Posts: 11
TEAMTWF8 is on a distinguished road

RPM collection by parallel port


Hi 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
Attached Files
File Type: zip MotorTest.zip (3.5 KB, 30 views)
  #2  
Old 07-Jul-2007, 00:34
TEAMTWF8 TEAMTWF8 is offline
New Member
 
Join Date: Jun 2007
Posts: 11
TEAMTWF8 is on a distinguished road

Re: convert .cpp to .dll


Hi, 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  
Old 09-Jul-2007, 05:00
ahbi82 ahbi82 is offline
Member
 
Join Date: Jul 2006
Posts: 114
ahbi82 will become famous soon enough

Re: convert .cpp to .dll


Hi 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  
Old 09-Jul-2007, 05:28
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 890
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough

Re: convert .cpp to .dll


You 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  
Old 09-Jul-2007, 12:49
TEAMTWF8 TEAMTWF8 is offline
New Member
 
Join Date: Jun 2007
Posts: 11
TEAMTWF8 is on a distinguished road

Re: convert .cpp to .dll


Hi 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  
Old 09-Jul-2007, 13:45
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 890
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough

Re: convert .cpp to .dll


Quote:
Originally Posted by TEAMTWF8
Hi 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

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  
Old 09-Jul-2007, 14:53
TEAMTWF8 TEAMTWF8 is offline
New Member
 
Join Date: Jun 2007
Posts: 11
TEAMTWF8 is on a distinguished road

Re: convert .cpp to .dll


Hi 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  
Old 09-Jul-2007, 15:05
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 890
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough

Re: convert .cpp to .dll


Quote:
Originally Posted by TEAMTWF8
Hi 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

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  
Old 09-Jul-2007, 15:17
TEAMTWF8 TEAMTWF8 is offline
New Member
 
Join Date: Jun 2007
Posts: 11
TEAMTWF8 is on a distinguished road

Re: convert .cpp to .dll


Hi 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  
Old 10-Jul-2007, 14:17
TEAMTWF8 TEAMTWF8 is offline
New Member
 
Join Date: Jun 2007
Posts: 11
TEAMTWF8 is on a distinguished road

Re: convert .cpp to .dll


Lucian,

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 GIDBlogWelcome to Baghdad by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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

All times are GMT -6. The time now is 14:22.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.