Program samples
Visual Basic
The communication control (MsComm) of VisualBasic must be applied :
Port opening
Power supply setting
Data request
Data reading
For more information, refer to the help menu of MSComm in Visual Basic.
Application program
Hyperterminal
This program is available as standard for Windows versions 2000, XP and Vista. It can only be used for transmis-
sions starting from the instrument.
Parameters:
- Dans [Connexion à], sélectionner:
- In menu [parameter], select
- In menu [port parameters], select :
' Use COM1.
Comm1.CommPort = 1
' 4800 baud, even parity, 7 data, and 2 stop bit.
Comm1.Settings = «4800,E,7 ,2»
' Open the port.
Comm1.PortOpen = True
' Duplex Cable'
Form1.MSComm1.DTREnable = True
Form1.MSComm1.RTSEnable = False
' Simplex Cable'
MSComm1.DTREnable = False
Timer1.Interval = 150
Timer1.Enabled = True
'Duplex cable + duplex instrument'
MSComm1.Output = «?» + Chr$(13)
'Duplex cable + simplex instrument'
MSComm1.Break = True
'Incremente Timer1.Interval in case of no transmission'
Timer1.Interval = 10
Timer1.Enabled = True
MSComm1.Break = False
InString$ = Comm1.Input
[connection using]
[terminal keys]
[emulation]
[bits/s]
[data bits]
[parity]
[stop bits]
[Flux control]
1
Directed to {n}
«DELETE» key
ANSI
4800
7
Paire
2
Aucun
E