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.

Please check my error in coding

Status
Not open for further replies.

saathis

Member level 1
Joined
Dec 11, 2010
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,601
dear helpers,

Hi i nit help some vb6 expert...anyone can check for me the coding below... it are the code set D1 goes high for Open button... im not sure whether D1 set for goes high or not for this button....please check and give solution for me? :|

Private Sub Open_Click(Index As Integer)

Value = 1
Out PortAddress, 2
Shape1(0).FillColor = vbWhite

End Sub
 

saubhik

Full Member level 3
Joined
Apr 27, 2007
Messages
162
Helped
18
Reputation
36
Reaction score
11
Trophy points
1,298
Location
India
Activity points
2,210
Hi Saathis,
the answer for this is "no" , it will not work, because you are accessing the parallel port of your hardware in windows platform, so at-first you have to have the access to that port before outing the data to that port , so you have to add a .dll(dynamic link library) file inside your application to access your parallel port , then using the function available inside the dll file you can use them directly in your code ,what you have already used .
The standard dll available for parallel port are "inpout16.dll" & "inpout32.dll",download them (check which one your pc requires).
Anyway , the procedure for adding dll and programming a parallel port is readily available in the below mentioned websites -
1.Parallelport Programming
2.Programming and access to ports
3.Programming The Parallel Port In Visual Basic

Hope it is sufficient to solve your need,else feel free to contact me , :)

Regards,
Saubhik
 

saathis

Member level 1
Joined
Dec 11, 2010
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,601
Hi Saubhik i 4got in4m as u say i have declare .dll in 1 module which contain coding below:

Private Declare Function Inp Lib "inpout32.dll" _

Alias "Inp32" (ByVal PortAddress As Integer) As Integer


Private Declare Sub Out Lib "inpout32.dll" _

Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)

ans also declared a variable to hold the value of the port address by type code

Dim PortAddress As String



Private Sub Form_Load ()

PortAddress = &H378


the coding where i type ask to check is inside the button.....coz i want set D1 goes high.... tat y i ask to check someone whether coding inside button is D1 goes high or not.... please check me again n answer again... tq saubhik..
 

saubhik

Full Member level 3
Joined
Apr 27, 2007
Messages
162
Helped
18
Reputation
36
Reaction score
11
Trophy points
1,298
Location
India
Activity points
2,210
Let me guess,
I assume you are using binary pattern - if yes then you have done-
Private Sub Open_Click(Index As Integer)

Value = 1
Out PortAddress, 2
Shape1(0).FillColor = vbWhite

End Sub

means you made 00000010 (2nd bit high) , check it is connected to your D1 or not.
else code is fine from implementation purse.
 

saathis

Member level 1
Joined
Dec 11, 2010
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,601
absolutely correct bro... im using binary string.... ya in te circuit it connect to D1 i check d.... so if i want make D2 goes to low te code is like tis: please check me again:

Private Sub Open_Click(Index As Integer)

Value = 0
Out PortAddress, 4
Shape1(0).FillColor = vbWhite

End Sub

---------- Post added at 01:17 ---------- Previous post was at 01:17 ----------

absolutely correct bro... im using binary string.... ya in te circuit it connect to D1 i check d.... so if i want make D2 goes to low te code is like tis: please check me again:

Private Sub Open_Click(Index As Integer)

Value = 0
Out PortAddress, 4
Shape1(0).FillColor = vbWhite

End Sub
 

saubhik

Full Member level 3
Joined
Apr 27, 2007
Messages
162
Helped
18
Reputation
36
Reaction score
11
Trophy points
1,298
Location
India
Activity points
2,210
Yes boy, you are now a man ..... :)
 

saathis

Member level 1
Joined
Dec 11, 2010
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,601
Ya bro heihei im man d..... thnks alot bro
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top