Information générale
Titre:
Communication with scale
I need to establish communication with scale with no documentation of scale.
If I send some string to scale and wait for answer, is this code valid?
thisform.CommObject.Settings = "9600, N, 8, 2" && scale parameters
thisform.CommObject.InputLen = 0
thisform.CommObject.CommPort = 1
IF thisform.CommObject.PortOpen = .F.
thisform.CommObject.PortOpen = .T.
ENDIF
thisform.CommObject.Output = ALLTRIM(thisform.SomeString.value)
Repeat = .T.
DO WHILE Repeat
IF thisform.CommObject.InBufferCount > 0
thisform.SomeField.value = thisform.CommObject.Input
Repeat = .F.
ENDIF
ENDDO
thisform.CommObject.PortOpen = .F.
Will I catch scale answer with this code?
Thanks in advance.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement