Instruction Manual

54 VEGACOM 557 VEGA ASCII
Setup
1005
_Version =
327680
DTREnable = 0
'False
InBufferSize =
512
InputLen =
200
OutBufferSize =
100
RThreshold = 1
SThreshold = 1
EOFEnable = -1
'True
End
End
Attribute VB_Name =
"ASCDEMO"
Attribute VB_Creatable =
False
Attribute VB_Exposed = False
'---------------------------
----------------
' ASCDEMO.FRM
' Copyright (c) 1999 VEGA
' by Gros Thoms
'---------------------------
----------------
Option Explicit
' Speicher fuer den Empfang
Dim ReceiveBuffer As String
' Fehlerzaehler
Dim InAction As Integer
' Speicher fuer die Werte
and den Status
Dim Status(255) As Integer
Dim DCS(255) As Long
' Start and Ende
Dim StartIndex As Integer
Dim LenIndex As Integer
Private Sub Ende_Click()
' Programm beenden
Unload Me
End Sub
Private Sub Form_Load()
Dim i As Integer
' Speicher initialisieren
For i = 1 To 255
Status(i) = False
DCS(i) = 0
Next i
' Fehlerzaehler
initialisieren
InAction = 0
' Bereich einstellen
StartIndex = 1
LenIndex = 30
' Werte anzeigen
DisplayValues
End Sub
Private Sub
Form_Unload(Cancel As Inte-
ger)
' Timer stoppen
Timer.Enabled = False
' Serielle Schnittstelle
schliessen.
If MSComm.PortOpen =
True Then
MSComm.PortOpen =
False
End If
End Sub
Private Sub MSComm_OnComm()
Dim InString As String
' ? Wurden characters
empfangen
If MSComm.CommEvent =
comEvReceive Then
' Anzeige für
Kommunikation
If Led.FillColor =
Me.BackColor Then
Led.FillColor =
RGB(0, 255, 0)
Else
Led.FillColor =
Me.BackColor
End If
' Prüfen, ob Daten
vorhanden sind.
Do While
MSComm.InBufferCount > 0
' Fehlerzaehler
auf 1 Sec
InAction = 10