B1-16
IM 34M6H41-02E 2nd Edition : Aug. 1, 2005-00
2. Create a form
Paste the Comm control added in step 1 (at any position), a label, a text box, an
option button and 2 command buttons on the form and define the caption for each
control.
Text box
Label
Option button
Comm control
Command button 2
Command button 1
FA10704.VSD
This sample program reads the values of D0001 and M0040 when the Start button is
clicked.
3. Enter the source code.
(General)(Decralations)
Dim start_flg As Integer
(General) Do_Send
Private Sub Do_Send( )
Dim sendtext1 As String, sendtext2 As String
Dim recvtext1 As String, recvtext2 As String
sendtext1 = Chr(2) + "01010WRDD0001,01" + Chr(3) 'D0001 read command
sendtext2 = Chr(2) + "01010BRDM0040,001" + Chr(3) 'M0040 read command
'========================= D0001 word read command send
MSComm1.InBufferCount = 0
MSComm1.Output = sendtext1
'WRD command send
recvtext1 = ""
Do
DoEvents
dmy = DoEvents( )
If MSComm1.InBufferCount Then
recvtext1 = rec MSComm1.Input
If InStr(recvtext1, Chr(3)) Then
Text1.Text = Mid(recvtext1, 8, 4)
' 0101OK1234
Exit Do
End If
End If
If start_flg = 0 Then Exit Do
Loop
Summary of Contents for F3LC11-1F
Page 2: ......
Page 12: ...Blank Page...
Page 48: ...Blank Page...
Page 65: ...A3 7 IM 34M6H41 02E 2nd Edition Aug 1 2005 00 430 PR CLOSE 440 450 FIN 460 470 END...
Page 74: ...Blank Page...
Page 82: ...Blank Page...
Page 92: ...Blank Page...
Page 94: ...Blank Page...
Page 120: ...Blank Page...
Page 136: ...B3 6 IM 34M6H41 02E 2nd Edition Aug 1 2005 00 450 460 END...
Page 140: ...Blank Page...
Page 142: ...Blank Page...
Page 146: ...Blank Page...
Page 148: ...Blank Page...
Page 168: ...Blank Page...
Page 176: ...Blank Page...
Page 200: ...Blank Page...
Page 202: ...Blank Page...