Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

need help for PC control application source code

Status
Not open for further replies.

cvhow1127

Newbie level 5
Joined
Apr 23, 2010
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Malaysia
Activity points
1,341
i need to use PC to control the switching frequency for an IGBT.
i use parallel port to communicate.
are there any one got sample software or source code for these can share with me.
 

What exactly you wish to do, how do you wish to control the frequency etc is not given. If you could elaborate to explain what exactly is needed, solution may appear faster.
 

If timing is the problem then the signals you are sending to the IGBT via printer port could be timed accordingly using the supporting functions in the program that is communicaing with the port (controlling program). Managing duration or delay between two consecutive pulses will control the frequency at which the IGBT receives pulses.
 

erm... what i am going to do is using computer to control the switching frequency for an IGBT through the parallel port. i need to build a software which in visual basic. i do not have any experience on using parallel port to do project. can i know how i am going to define the parallel port in using visual basic ( which command code needed to define)and which pin of the parallel port is suitable for control the switching frequency via computer
 

On PC priter port will have Base Address 378Hex or 278Hex it is an output port in SPP mode.
There are 2 more ports Status port at address Base + 1 and a control port at Adrress Base + 2.
I would select the output port at 378H (or 278H) for this purpose.
In VB there is no command to directly access Ports.
The solution is to use a DLL file (freely availible) INPOUT.DLL. This file is to be present in the current program folder or windows\command folder. This file supports two input and output commands. for output the syntax is:
Out (&H378), &H0D
&H378 is the port address 378Hex and &H0D is the value 0D Hex that is sent to the port address 378H.
for reading the current status of this port the syntax is:
a = Inp(&H378)
a is a variable that holds the value read (Inputed) from port address 378Hex.
Using this DLL file and these two commands you can read or write to the output port.
As you need only one output line say you are using bit 0 of the output port this has pin number 2 on the 25 pin Female D-type shell connector (you can even read the number on the connector or start counting from right hand side )
to make the pin high the command could look like:
Out (&H378), 1 or Out (&H278), 1
the output value here is in decimal so '&H' not used.
to make it low the command could look like:
Out (&H378), 0 or Out (&H278), 0
The two port addresses are shown because the port address could differ tha you can find from device manager or otherwise.
Now for timeing putpose, you would like to generate a delay for the time it is to remain HIGH and another delay for the time for which it has to remain LOW. This will allow you to generate a pulse train of desired frequency at pin 2 of the Printer port D-type shell connector.
For this purpose you can use VB timer control.
Hope this suffices and serve your purpose.
 

a VB timer can only work over 21ms delay.. (mostly 50ms and more) and isn't very accurate...

If you need very accurate pulses (exact frequency) I recommend using external circuits, which you could command easily (with out worring about small delays) with a parallel port over VB.
 

Dear ark5230:
-------------------------------------------------------------------------------------------------
Option Strict Off

Option Explicit On

Module porting

Public Declare Function Inp Lib "inpout32.dll" _
Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Public Declare Sub Out Lib "inpout32.dll" _
Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)

End Module

-----------------------------------------------------------------------------------------------This is the part that i should declare right?

after this, i would like to ask, if i create a button in VB, the button is clicking for sending the signal to the parallel port(pin 2). what code i am going to define that the signal will send to the pin 2 after i clicked the button? Is it define like this ( Out (&H378), 1 )???
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top