13-C Typical Sample Program - Sekonic SR-430 Operatiing Manual

Optical mark reader
Table of Contents

Advertisement

13.Appendix

13-C Typical sample program

Sample program using Microsoft Visual Basic
(Sample program is contained in the accessony CD-ROM)
This sample program is designed to open and close a communication line, transmit data and control
how to receive data of a fixed or variable length. Refer to this program for programming.
Before executing a program, attach "Command Button", "Text Box" and "MSComm" to your form.
Note: Please use "MScomm" compornent which upon "Microsoft Visual Basic 6.0".
We do not apply communication of custom control software whidh made by other third party.
Design screen
MS Comm
<Typical program>
Private Sub Form_Load()
Screen.MousePointer = 11
' >>>>> Initialize communication line <<<<<
MSComm1.Handshaking = comRTS
MSComm1.RTSEnable = True
MSComm1.CommPort = 4
MSComm1.Settings = "38400,n,7,2"
MSComm1.PortOpen = True
MSComm1.InBufferCount = 0
MSComm1.OutBufferCount = 0
Screen.MousePointer = 0
End Sub
Private Sub Command1_Click()
Dim Response
Dim TMCount
Dim CMode
Dim EMode()
Dim ReciveCnt
Text Box
Command Button
'
Change mouse pointer to sandglass.
'
Set handshake method (RS-CS control).
'
RS signal = High (receivable)
'
Set communication port (COM4).<<Change to using port.
'
Set communication conditions.
'
Open communication line.
'
Clear receive buffer.
'
Clear send buffer.
'
Initialize mouse pointer.
As String
As String
As String
As String
As Integer
-64-
Execution screen

Advertisement

Table of Contents
loading

Table of Contents