Win7 Manejo de Puerto Paralelo en Windows XP desde Visual Basic 6.0

Todas las versiones, productos y servicios de Windows 7.

teroxice

Lanero Regular
17 Ago 2004
8
No he podido mandar datos por el puerto paralelo usando windows XP.
Necesito ayuda, si alguien sabe como hacerlo porfavor aviseme.
Estoy usando visual Basic 6.0
 
Hermano creo que debes usar el winshock no estoy seguro pero mira en este foro creo que por ahi vi algo parecido.
 
tienes que crear un modulo y copiar lo siguiente
********************************************************************
'Declarations for direct port I/O in 32-bit Visual Basic 6 programs.
' Funciona en W9x, ME, NT, 2000 y XP
'********************************************************************

Public Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Public Declare Sub PortWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Integer)
Public Declare Sub PortDWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Long)
Public Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Public Declare Function PortDWordIn Lib "IO.DLL" (ByVal Port As Integer) As Long
Public Declare Sub SetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub ClrPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub NotPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Function GetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte) As Boolean
Public Declare Function RightPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function LeftPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function IsDriverInstalled Lib "IO.DLL" () As Boolean


'********************************************************
'********* Function Descriptions *******************
'********************************************************

'PortOut - Outputs a byte to the specified port.

'PortWordOut - Outputs a word (16-bits) to the specified port.

'PortDWordOut - Outputs a double word (32-bits) to the specified port.

'PortIn - Reads a byte from the specified port.

'PortWordIn - Reads a word (16-bits) from the specified port.

'PortDWordIn - Reads a double word (32-bits) from the specified port.

'SetPortBit - Sets the bit of the specified port.

'ClrPortBit - Clears the bit of the specified port.

'NotPortBit - Nots (inverts) the bit of the specified port.

'GetPortBit - Returns the state of the specified bit.

'RightPortShift - Shifts the specified port to the right. The LSB is
' returned, and the value passed becomes the MSB.

'LeftPortShift - Shifts the specified port to the left. The MSB is
' returned, and the value passed becomes the LSB.

'IsDriverInstalled - Returns non-zero if io.dll is installed and
' functioning. The primary purpose of this function
' is to ensure that the kernel mode driver for
' NT/2000/XP has been installed and is accessible.


luego manejas el puerto dependiendo lo que quieras por ejemplo se quieres poner un bit en 1
SetPortBit Out_Port, 1
y asi le asocias a cada boton lo que quieras realizar, espèro que te sirva, por casualidad sabes como pixelar una imagen en visual?
 
Ejemplo de acceso al puerto paralelo en WinXP

UAC-golden dijo:
Si funciona, pero es q el q colocaron e sun poco complejo, si quieres enviame un mensjae privado y te colaboro

Shao

Revisa este link:

http://www.webdearde.com/modules/Trabajos/paralelo/

attachment.php
 

Los últimos temas