hola
porfa colaborenme en esto tengo la siguiente linea de codigo pero no se que se quiere hacer en la subrutina [ Private Sub TRx_Change()]
ademas necesito saber si debo declarar TRx y el text2 que es?
como les dije anteriormente esta interfaz controla el ON/OFF del pic 16f873A
NOTA:
he tratado de montar las imagenes de la revista donde esta todo el proyecto pero son muy pesadas y no las he podido subir porfavor si alguien sabe como subirlas digamelo.
Dim ValorA As Integer
Dim valorB As Integer
Dim valorC As Integer
Dim J As Integer
Dim TRx As String
Dim Text2 As String
Option Explicit
Private Sub Form_Load()
If MSComm1.PortOpen = False Then
MSComm1.PortOpen = True
End If
End Sub
Private Sub Timer1_Timer()
If MSComm1.PortOpen = True And MSComm1.InBufferCount > 0 Then
TRx = TRx + MSComm1.Input
End If
End Sub
Private Sub Salir_Click()
Beep
End
End Sub
Private Sub TimEscan_Timer()
BLeer.Value = 1
End Sub
Private Sub Bleer_Click()
MSComm1.Output = Chr(165) + Chr(66) + Chr(88) + Chr(99)
End Sub
Private Sub Benviar_Click()
valorC = 64
ValorA = 64
For J = 0 To 5
If OutA(J).Value = 1 Then
ValorA = ValorA + 2 ^ J
If OutC(J).Value = 1 Then
valorC = valorC + 2 ^ J
End If
End If
Next J
MSComm1.Output = Chr(ValorA + 128) + Chr(valorC) + Chr(ValorA) + Chr(valorC)
End Sub
Private Sub TRx_Change()
Dim J As Integer
If Len(TRx) > 3 Then TRx = "" ' Len= Devuelve un tipoLong que contiene el número de
caracteres en una cadena o el número de bytes necesarios par
almacenar una variable.
If Len(TRx) > 2 Then
ValorA = Asc(Mid(TRx, 1, 1)) - 64 'Devuelve un tipoInteger que representa elcódigo de carácter
correspondiente a la primera letra de una cadena.
valorB = 0
valorC = Asc(Mid(TRx, 2, 1)) - 64
End If
If Len(TRx) = 3 Then
ValorA = Asc(Mid(TRx, 1, 1)) - 64
valorB = Asc(Mid(TRx, 1, 1))
valorC = Asc(Mid(TRx, 1, 1)) - 64
End If
If (Len(TRx) = 2) Or (Len(TRx) = 3) Then
For J = 0 To 7
DIn(J).BackStyle = (ValorA And 2 ^ J) / (2 ^ J)
Next J
For J = 0 To 5
DoutA(J).BackStyle = (ValorA And 2 ^ J) / (2 ^ J)
OutA(J).Value = (ValorA And 2 ^ J) / (2 ^ J)
DoutC(J).BackStyle = (valorC And 2 ^ J) / (2 ^ J)
OutC(J).Value = (valorC And 2 ^ J) / (2 ^ J)
Next J
Text2 = TRx
TRx = ""
End If
End Sub