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.
RS232 Application program
Serial port terminal
You can use the serial port terminal of your choice.
Configuration :
- 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
' Simplex Cable'
Form1.MSComm1.DTREnable = True
Form1.MSComm1.RTSEnable = 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
[bits/s]
[data bits]
[parity]
[stop bits]
[Flux control]
7
4800
7
Pair
2
None
E
E