Visual Basic - Soy el de la placa usb

Life is soft - evento anual de software empresarial
 
Vista:

Soy el de la placa usb

Publicado por Roberto (4 intervenciones) el 17/10/2008 00:08:53
Perdonad que ponga otra nota es que la antigua estaba muy atras.
En uno de los documentos del cd-rom de la placa viene un ejemplo en Visual Basic a ver si con esto me podeis ayudar.
Por lo visto todas la rutinas de comunicacion estan en un archivo DLL y en este ejemplo nombran mucho esa DLL.
Por ahora solo necesito imprimir en la pantalla por ejemplo la entrada analogica 1.
Os pego el ejemplo:

A ver si me podeis decir algo.

Using the K8061.DLL in Visual Basic
In the listing of an application example there are the declarations of the K8061.DLL procedures and
functions and an example how to use the two most important DLL function calls: OpenDevice and
CloseDevices.
Note: Make sure that the file K8061.DLL is copied to the Windows' SYSTEM32 folder:

Option Explicit
Dim DoNothing As Boolean
Dim n As Integer
Dim CardAddress As Long
Private Declare Function OpenDevice Lib "k8061.dll" () As Long
Private Declare Sub CloseDevices Lib "k8061.dll" ()
Private Declare Function ReadAnalogChannel Lib "k8061.dll" (ByVal CardAddress As Long, ByVal
Channel As Long) As Long
Private Declare Function PowerGood Lib "k8061.dll" (ByVal CardAddress As Long) As Boolean
Private Declare Function Connected Lib "k8061.dll" (ByVal CardAddress As Long) As Boolean
Private Declare Sub ReadVersion Lib "k8061.dll" (ByVal CardAddress As Long, Buffer As Long)
Private Declare Sub ReadAllAnalog Lib "k8061.dll" ( ByVal CardAddress As Long, Buffer As Long)
Private Declare Sub OutputAnalogChannel Lib "k8061.dll" (ByVal CardAddress As Long, ByVal
Channel As Long, ByVal Data As Long)
Private Declare Sub OutputAllAnalog Lib "k8061.dll" (ByVal CardAddress As Long, Buffer As
Long)
Private Declare Sub ClearAnalogChannel Lib "k8061.dll" ( ByVal CardAddress As Long, ByVal
Channel As Long)
Private Declare Sub SetAllAnalog Lib "k8061.dll" (ByVal CardAddress As Long)
Private Declare Sub ClearAllAnalog Lib "k8061.dll" (ByVal CardAddress As Long)
Private Declare Sub SetAnalogChannel Lib "k8061.dll" (ByVal CardAddress As Long, ByVal Channel
As Long)
Private Declare Sub OutputAllDigital Lib "k8061.dll" (ByVal CardAddress As Long, ByVal Data As
Long)
Private Declare Sub ClearDigitalChannel Lib "k8061.dll" (ByVal CardAddress As Long, ByVal
Channel As Long)
Private Declare Sub ClearAllDigital Lib "k8061.dll" (ByVal CardAddress As Long)
Private Declare Sub SetDigitalChannel Lib "k8061.dll" (ByVal CardAddress As Long, ByVal
Channel As Long)
Private Declare Sub SetAllDigital Lib "k8061.dll" ( ByVal CardAddress As Long)
Private Declare Function ReadDigitalChannel Lib "k8061.dll" ( ByVal CardAddress As Long, ByVal
Channel As Long) As Boolean
Private Declare Function ReadAllDigital Lib "k8061.dll" (ByVal CardAddress As Long) As Long
Private Declare Sub OutputPWM Lib "k8061.dll" (ByVal CardAddress As Long, ByVal Data As Long)
Private Sub Connect_Click()
Dim h As Long
h = OpenDevice
Select Case h
Case 0, 1, 2, 3, 4, 5, 6, 7
Label1.Caption = "Card " + Str(h) + " connected"
K8061.DLL 13
© 2005 ... Velleman
Option1(h).Enabled = True
Option1(h).Value = True
Timer1.Enabled = True
Case -2
Label1.Caption = "Card not found"
Case -1
Label1.Caption = "All cards opened"
End Select
End Sub
Private Sub Form_Terminate()
CloseDevices
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder