--> August 2011 | Delphi Tips Trick

For Newbie

Thursday 25 August 2011

How To ( STEP BY STEP )Install The Small Port Component In Borland Delphi 7.0

How To ( STEP BY STEP )Install The Small Port Component In Borland Delphi 7.0

How To ( STEP BY STEP )Install The SmallPort Component In Borland Delphi 7.0
Small port component in Borland Delphi 7.0 has function as component to write and to read data in parallel port in PC. Usually the used of reading data in parallel port data is as media to conduct interfacing by using PC outside tool which is connected to PC through parallel port.
Steps of Small Port Installation Component are as follow:
Make sure the Delphi Program has been install in computer
Extract file small port14.zip which has been downloaded.  
Picture1. How To ( STEP BY STEP )Install The Small Port Component In Borland Delphi 7.0 : Extract small port14.zip file
Open smallport14 folder (extract result), then copy smallport.vxd and smport.sys file then move to the fourth step.  
Picture2. How To ( STEP BY STEP )Install The Small Port Component In Borland Delphi 7.0 :Install Smallport / smport delphi : copy smallport.vxd and smport.sys file.
MAKESURE: paste the smallport.vxd and smport.sys fle to the directory
C:\WINDOWS\system32\drivers 
 
Picture3. How To ( STEP BY STEP )Install The Small Port Component In Borland Delphi 7.0 Paste file smport.sys and smport.vxd
Open Borland Delphi 7, start à Borland Delphi 7.0àdelphi7.0 so that the visualization in the monitor become as follow. 
Picture4. How To ( STEP BY STEP )Install The Small Port Component In Borland Delphi 7.0 Vizualization IDE Borland Delphi 7.
Going to the important step in installing process
IMPORTANT: copy the result of extract folder (smport14 folder) to C:\Program Files\Borland\Delphi7\Lib
 Gambar 5. Install Smallport / smport delphi : Paste folder smallport14
Back to Delphi , open page tool à environment option à click the library tab
Picture 6. Install Smallport / smport delphi : going to the smallport14 source path
Pointed the browsing path to  

 Picture 7. Install Smallport / smport delphi : Directing browsing path
After clicking the button in picture 7, it will appear dialog brain directories as follows:
Picture8.Install Smallport / smport delphi : dialog box directories
In picture 8, click the button which in the red circle, next is pointed to the directory C:\Program Files\Borland\Delphi7\Lib\smport14 then click OK, the picture is as follows:

Picture 9. Install Smallport / smport delphi : Pointing directory smallport14
Open component page  Install component:  
 
Picture 10. Install Smallport / smport delphi : Page Component.
Will appear as follow:  
Picture 11. Install Smallport / smport delphi : dialog box install component
In picture 11, click the browse button beside the Unit file name  
 
Picture 12. Install Smallport / smport delphi : Dialog box Unit File name 
in Picture 12 above, open folder smport14 the double click in smallport.pas
 Picture13. Install Smallport / smport delphi : Choose smallport.pas, 
will appear dialog box like the following below, then click OK

Picture 14. Install Smallport / smport delphi : Install the smallport componet
will appear dialog box as follows:
Picture 15. Install Smallport / smport delphi : Confirm Dialog box smallport componet installation

If the smallport component is successfully installed, then it will appear information box as follows
Picture 16. Install Smallport / smport delphi : Information box,
installation process is success
Then please open component pallete “system” you will find a component named Small Port that has been installed in that component pallete:

Picture 17. Install Smallport / smport delphi : Smallport component is Component Pallete “System”

 I hope this article can give benefit to the visitors, readers, developer and me. Thanks for visiting and availability for sharing this article by pressing 
Share this on Facebook
or just press like button under this posting

How To (Step by step) to Install DSPack Component In Borland Delphi 7

How To (Step by step) to Install DSPack Component In Borland Delphi 7

How To (Step by step) to Install DSPack Component In Borland Delphi 7
There are some ways how to install the DSPack component in Borland Delphi 7:
1.      First, download the DSPack component by CLICK HERE, extract the file then rename it into DSPACK234
2.      Copy the DSPack file to a folder where you install the Delphi program, for example in C:\programFiles|Borland|Delphi7|DSPACK234
3.      Open Delphi then open page tool àenvironment option, in the environment dialog box that appear, click in the tab library, add library where the source DSPack component exist, which is in the folder
Picture.  Install Ds Pack  in Borland Delphi DrectX9 package
4.       \{rootDSPack}\src\DirectX9 and \{rootDSPack}\src\DSPack
5.      Look at the visualization below
Picture. Install Ds Pack  in Borland Delphi DSPack : Design Package

6.      Double click in Direct X9-D7.dpk file (for Borland Delphi 7) à in open dialog in Delphi, click compile button. DirectX9-D7.dpk is in “packages” folder,
7.      Double click the DSPAck-D7.dpk file (for Borland Delphi 7)à in open dialog in Delphi click the compile button. The DSPack-D7 is in “packages” folder,
8.      Double click the DSPackDesign-D7.dpk file (for Borland Delphi 7) à click install button. The DSPackDesign-D7.dpk id is in “packages” folder, look the picture below
Install Ds Pack  in Borland Delphi : Component View.
9.      After the installation process, you will get the component in the pallete DSPack component shows in the picture above.

 I hope this article can give benefit to the visitors, readers, developer and me. Thanks for visiting and availability for sharing this article by pressing 
Share this on Facebook
or just press like button under this posting

Wednesday 24 August 2011

Recording Video Using Borland Delphi 7+Dspack

Recording Video Using Borland Delphi 7+Dspack


Beside to capture picture, the DSPack component also can be used to record or capture video. Besides, the DSPack component still have a lot of function, such as to detect a movement (motion detect), to recognize face (face recognition), to detect the edge of picture (edge detection) etc.
To make video recorder using DSPack, enter the component below:

No. Component  Pallete Component Name Property Value
1 Ds Pack Filter1 FilterGraph FilterGraph1
VideoWindow1 FilterGraph FilterGraph1
FilterGraph1 Mode gmCapture
Standard Button1 Caption
Choose Folder
Name Buttonsavefolder1
Standard Button2 Caption Start Save Video
Name Buttonsave1
Standard Button3 Caption Close
Name ButtonClose
Win32 StatusBar1 Check the note under the table

Double click the component and then will appear,




Then Click the object inspector and type Video1 on Text Property



Manage the image detail become as follows:

  
Picture1. Image Program Design.


Before type the source code, please declare this following global variable

After that enter the source code program as follows:

No Component Name Event Source Code
Form1 OnCreate var
i : integer;
begin
CapEnum:= TSysDevEnum.Create(CLSID_VideoInputDeviceCategory);
for i := 0 to CapEnum.CountFilters - 1 do
begin
combobox1.Items.Add(CapEnum.Filters[i].FriendlyName);
buttonsave1.Enabled:=false;
buttonsavefolder1.Enabled:=false;
end;
ComboBox1 OnChange   FilterGraph1.ClearGraph;
FilterGraph1.Active := false;
Filter1.BaseFilter.Moniker := CapEnum.GetMoniker(combobox1.ItemIndex);
FilterGraph1.Active := true;
with FilterGraph1 as ICaptureGraphBuilder2 do
Renderstream(@PIN_CATEGORY_PREVIEW, nil, Filter1 as IBaseFilter,nil, VideoWindow1 as IbaseFilter);
FilterGraph1.Play;
buttonsavefolder1.Enabled:=true;
Buttonsavefolder1 OnClick if savedialog1.Execute = true then
buttonsave1.Enabled:=true;
Buttonsave1 OnClick var multiplexer: IBaseFilter;
Writer: IFileSinkFilter;
i:integer;
begin
VideoMediaTypes.MediaDescription[i];
savefile1:=savedialog1.FileName   ;
 if FilterGraph1.Active then FilterGraph1.Active:=false;
FilterGraph1.ClearGraph;
//active filter graph
FilterGraph1.Active:=true;
  // now render streams
with FilterGraph1 as IcaptureGraphBuilder2 do
begin

    // set the output filename
SetOutputFileName(MEDIASUBTYPE_avi, PWideChar(saveFile1), multiplexer, Writer);
// Connect Video preview (VideoWindow)
if Filter1.BaseFilter.DataLength > 0 then
RenderStream(@PIN_CATEGORY_PREVIEW, nil, Filter1 as IBaseFilter,
nil , VideoWindow1 as IBaseFilter);
// Connect Video capture streams
if Filter1.FilterGraph <> nil then
RenderStream(@PIN_CATEGORY_CAPTURE, nil, Filter1 as IBaseFilter,
nil, multiplexer as IBaseFilter);
end;
FilterGraph1.Play;
//show folder penyimpanan file
StatusBar1.Panels.Items[0].Text:= saveFile1;
ButtonClose OnClick application.Terminate;


The Result Of The Program Execution is as follows:
 
 Picture2. Result of Application  Execution

 I hope this article can give benefit to the visitors, readers, developer and me. Thanks for visiting and availability for sharing this article by pressing 
Share this on Facebook
or just press like button under this posting



Accessing SMS With Borland Delphi 7: Sending and  Receiving SMS In Nokia Mobile Phone Easily Using Oxygen SMS Component On Borland Delphi 7.0 (The Basic Concept)

Accessing SMS With Borland Delphi 7: Sending and Receiving SMS In Nokia Mobile Phone Easily Using Oxygen SMS Component On Borland Delphi 7.0 (The Basic Concept)


Human necessity to make connection between PC and Mobile Phone usually needed as media to access SMS on mobile phone which later on will be used to certain need, for example; SMS which is got will became input parameter an Auto Responded System R, Activator System, long distance controller system, etc.

 I hope this article can give benefit to the visitors, readers, developer and me. Thanks for visiting and availability for sharing this article by pressing 
Share this on Facebook
or just press like button under this posting

 
Controlling Electrical Equipment with 220 Volt Alternating Current (AC) With Delphi through Parallel Port Using Small Port Component.

Controlling Electrical Equipment with 220 Volt Alternating Current (AC) With Delphi through Parallel Port Using Small Port Component.

Basically, controlling electrical equipment 220 Volt Alternating Current (AC) with Delphi through parallel port using Small Port component has similarities with the article entitled controlling the Light Emitting Dioda (LED) flame with Delphi through parallel port which can be accessed CLICKHERE. The difference is on the Hardware which is used. In this case, the series is replaced with transistor series as electrical switch which able to activated and non-activated relay with 12 volt DC/220 volt AC. The series which able to replace LED is as follows:


Figure. Series  of  Controlling Electrical Equipment with 220 Volt Alternating Current (AC) With Delphi through Parallel Port Using Small Port Component.

The Component listed Below:


       
No Component Name
1 Dioda 1N 4001
2 Resistor 2,2K Ω
3 Transistor BC 107
4 Vcc 12 Volt DC


 I hope this article can give benefit to the visitors, readers, developer and me. Thanks for visiting and availability for sharing this article by pressing 
Share this on Facebook
or just press like button under this posting

Controlling The Light Emitting Dioda (LED) Flame With Delphi Through Parallel Port

Controlling The Light Emitting Dioda (LED) Flame With Delphi Through Parallel Port

Light Emitting Dioda (LED) is electronic component which able to change electrical energy into light energy. Basically, this component can be used as indicator that LED series is actively flowed current.
In this case, LED will have function as indicator in pin-pin LPT port which will be accessed through small port component in Delphi. If pin LPT port have logical 1 so LED will turn on, and vise versa, if the logical is 0 then LED will off, the series are as follows:


Figure. t he LED controller series through Parallel Port / LPT Port
 
Figure. The series of Controlling The Light Emitting Dioda through parallelport
The program which is used to control the LED is discussed in the writing entitled Accessing Parallel Port Personal Computer (LPT Port) with Borland Delphi 7.0 using Small Port component which can be accessed CLICKHERE.

 I hope this article can give benefit to the visitors, readers, developer and me. Thanks for visiting and availability for sharing this article by pressing 
Share this on Facebook
or just press like button under this posting

Accessing PC Parallel Port (LPT Port) With Borland Delphi 7.0 Using Small Port Component

Accessing PC Parallel Port (LPT Port) With Borland Delphi 7.0 Using Small Port Component

This article will lead you how to make a program to access input output data in parallel port, simple example, this program is used to turn on and turn of LED which is set in Parallel Port, Data Register in computer (Pin D2 until pin D9) in Parallel Port/ LPT.
The steps are as follows:
Enter the following component in Form 1:

No Component Property Value
1 Shape1 Name ShpLED1
Shape stCircle
Height 41
Width 41
Brush Color clWhite
Brush Style bsSolid
2 Shape2 Name ShpLED2
Shape stCircle
Height 41
Width 41
Brush Color clWhite
Brush Style bsSolid
3 Shape3 Name ShpLED3
Shape stCircle
Height 41
Width 41
Brush Color clWhite
Brush Style bsSolid
4 Shape4 Name ShpLED4
Shape stCircle
Height 41
Width 41
Brush Color clWhite
Brush Style bsSolid
5 Shape5 Name ShpLED5
Shape stCircle
Height 41
Width 41
Brush Color clWhite
Brush Style bsSolid
6 Shape6 Name ShpLED6
Shape stCircle
Height 41
Width 41
Brush Color clWhite
Brush Style bsSolid
7 Shape7 Name ShpLED7
Shape stCircle
Height 41
Width 41
Brush Color clWhite
Brush Style bsSolid
8 Shape8 Name ShpLED8
Shape stCircle
Height 41
Width 41
Brush Color clWhite
Brush Style bsSolid
9 EditText1 Name EdLED1
Text -
10 EditText2 Name EdLED2
Text -
11 EditText3 Name EdLED3
Text -
12 EditText4 Name EdLED4
Text -
13 EditText5 Name EdLED5
Text -
14 EditText6 Name EdLED6
Text -
15 EditText7 Name EdLED7
Text -
16 EditText8 Name EdLED8
Text -
17 Button1 Name BtnNyalaLED1
Caption NyalakanLED1
18 Button2 Name BtnNyalaLED2
Caption NyalakanLED2
19 Button3 Name BtnNyalaLED3
Caption NyalakanLED3
20 Button4 Name BtnNyalaLED4
Caption NyalakanLED4
21 Button5 Name BtnNyalaLED5
Caption NyalakanLED5
22 Button6 Name BtnNyalaLED6
Caption NyalakanLED6
23 Button7 Name BtnNyalaLED7
Caption NyalakanLED7
24 Button8 Name BtnNyalaLED8
Caption NyalakanLED8
25 Button9 Name BtnMatiLED1
Caption MatikanLED1
26 Button10 Name BtnMatiLED2
Caption MatikanLED2
27 Button11 Name BtnMatiLED3
Caption MatikanLED3
28 Button12 Name BtnMatiLED4
Caption MatikanLED4
29 Button13 Name BtnMatiLED5
Caption MatikanLED5
30 Button14 Name BtnMatiLED6
Caption MatikanLED6
31 Button15 Name BtnMatiLED7
Caption MatikanLED7
32 Button16 Name BtnMatiLED8
Caption MatikanLED8
33 Button17 Name BtnOpenPort
Caption Open Port
34 Button18 Name BtnClosePort
Caption CloseProgram
35 SmallPort1 Name SmPort1





In the monitor will appear image like the following;  
 
Picture1. Accessing PC Parallel Port (LPT Port) With Borland Delphi 7.0 Using Small Port Component : Visualization of the Program which will be made.
Before making listing program (source code) first we decide 2 variables which will be used; those are “data” and “NewData” which mean:
NO. NAMA KOMPONEN SOURCE CODE
1 BtnMatiLED1 data := SmPort1.ReadByte($378);
baru := data AND 254;
SmPort1.WriteByte($378,baru);
ShpLED1.Brush.Color := clBlack;
EdLED1.Text:='OFF';
2 BtnMatiLED2 data := SmPort1.ReadByte($378);
baru := data AND 253;
SmPort1.WriteByte($378,baru);
ShpLED2.Brush.Color := clBlack;
EdLED2.Text:='OFF';
3 BtnMatiLED3 data := SmPort1.ReadByte($378);
baru := data AND 251;
smport1.WriteByte($378,baru);
ShpLED3.Brush.Color := clBlack;
EdLED3.Text:='OFF';
4 BtnMatiLED4 data := SmPort1.ReadByte($378);
baru := data AND 247 ;
SmPort1.WriteByte($378,baru);
ShpLED4.Brush.Color := clBlack;
EdLED4.Text:='OFF';
5 BtnMatiLED5 data := SmPort1.ReadByte($378);
baru := data AND 239;
SmPort1.WriteByte($378,baru);
ShpLED5.Brush.Color := clBlack;
EdLED5.Text:='OFF';
6 BtnMatiLED6 data := SmPort1.ReadByte($378);
baru := data AND 223 ;
SmPort1.WriteByte($378,baru);
ShpLED6.Brush.Color := clBlack;
EdLED6.Text:='OFF';
7 BtnMatiLED7 data := SmPort1.ReadByte($378);
baru := data AND 191;
SmPort1.WriteByte($378,baru);
ShpLED7.Brush.Color := clBlack;
EdLED7.Text:='OFF';
8 BtnMatiLED8 data :=SmPort1.ReadByte($378);
baru := data AND 127;
SmPort1.WriteByte($378,baru);
ShpLED8.Brush.Color := clBlack;
EdLED8.Text:='OFF';
9 BtnNyalaLED1 data := SmPort1.ReadByte($378);
baru := data or 1;
SmPort1.WriteByte($378,baru);
ShpLED1.Brush.Color := clRED;
edLED1.Text:='ON';
10 BtnNyalaLED2 data := SmPort1.ReadByte($378);
baru := data or 2;
SmPort1.WriteByte($378,baru);
ShpLED2.Brush.Color := clRED;
edLED2.Text:='ON';
11 BtnNyalaLED3 data := SmPort1.ReadByte($378);
baru := data or 4;
SmPort1.WriteByte($378,baru);
ShpLED3.Brush.Color := clRED;
edLED3.Text:='ON';
12 BtnNyalaLED4 data := SmPort1.ReadByte($378);
baru := data or 8;
SmPort1.WriteByte($378,baru);
ShpLED4.Brush.Color := clRED;
edLED4.Text:='ON';
13 BtnNyalaLED5 data := SmPort1.ReadByte($378);
baru := data or 16;
SmPort1.WriteByte($378,baru);
ShpLED5.Brush.Color := clRED;
edLED5.Text:='ON'
14 BtnNyalaLED6 data := SmPort1.ReadByte($378);
baru := data or 32;
SmPort1.WriteByte($378,baru);
ShpLED6.Brush.Color := clRED;
edLED6.Text:='ON';
15 BtnNyalaLED7 data := SmPort1.ReadByte($378);
baru := data or 64;
SmPort1.WriteByte($378,baru);
ShpLED7.Brush.Color := clRED;
edLED7.Text:='ON';
16 BtnNyalaLED8 data := SmPort1.ReadByte($378);
baru := data or 128;
SmPort1.WriteByte($378,baru);
ShpLED8.Brush.Color := clRED;
edLED8.Text:='ON';
17 BtnOpenPort SmPort1.Opened:=true;
18 BtnCloseProgram Close;
            “Data” is value that will be read from parallel port in the form of 8 bit data (1 byte)
“New data” is value that will be written to the parallel port after conducted

“Modification” with logical “and” or “or” to conduct bit setting or bit clearing data which is written in the form of 8 bit data (1 byte)
Variable writing decision is conducted under the writing:
var
Form 1:Tform1;
The result is as follows: 
Picture 2. Accessing PC Parallel Port (LPT Port) With Borland Delphi 7.0 Using Small Port Component : variable declaration
The next step is how to make source code program comprehensively so that the program can be used:
Type source code below, appropriate with each component which mean:




result of program execution is like this:  


Picture 3. Accessing PC Parallel Port (LPT Port) With Borland Delphi 7.0 Using Small Port Component : The Result of Program Execution.

 I hope this writing can give benefit to the visitors, readers, developer and me. Thanks for visiting and availability for sharing this article by pressing Share To Facebook, Twitter button or just press like button.