hbvb6
Messages postés40Date d'inscriptionmardi 29 janvier 2008StatutMembreDernière intervention 3 juin 2009
-
29 avril 2008 à 11:57
hbvb6
Messages postés40Date d'inscriptionmardi 29 janvier 2008StatutMembreDernière intervention 3 juin 2009
-
29 avril 2008 à 13:20
bonjour
j'ai vraiment un grand probleme et j'ai besoin que vous m'aidez
j'ai fait une application avec VB6 elle a trés bien marché jusqu'a ce que j'ai ajouté une fonction qui gére le port Com pour envoyer des données a un afficheur , l'application maintenat Bloc de 2 a 3 minute .
a chaque fois que je veux afficher quelque chose dans l'afficheur j'appelle cette function et j'envoi deux chaines de carecteres pour les deux ligne de l'afficheur (l'application appelle cette fonction presque chaque second)
et je pense que le probleme et dans cette function :
Public Function Afficheur(L1, L2)
On Error GoTo HH
Dim AFF As Boolean
With frmticker
Dim V1, V2, L As String
AFF = False
'--------------------------------------------------------------
If Len(L1) < 19 Then
Do While Len(L1) < 19
L1 = L1 & " "
Loop
L1 = L1 & "."
Else
L1 = Left(L1, 19) & "."
End If
V1 = L1
'-------------------------------------------------------
If Len(L2) < 19 Then
Do While Len(L2) < 19
L2 = L2 & " "
Loop
L2 = L2 & "."
Else
L2 = Left(L2, 19) & "."
End If
V2 = L2
'------------------------------------------------------------
If .MSComm1.PortOpen = False Then
.MSComm1.CommPort = 1
.MSComm1.Settings = "9600,N,8,1"
End If
'----------------------------------------------------------
If .MSComm1.PortOpen = False Then
.MSComm1.PortOpen = True
End If
'----------------------------------------------------------
If .MSComm1.PortOpen = True Then
.MSComm1.Output = L1 & L2
End If
.MSComm1.PortOpen = False