- ©«¤l
- 22
- ¥DÃD
- 17
- ºëµØ
- 0
- ¿n¤À
- 51
- ÂI¦W
- 0
- §@·~¨t²Î
- wiindows
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ·s¥_
- µù¥U®É¶¡
- 2021-6-21
- ³Ì«áµn¿ý
- 2022-1-4
|
¤U±³oÓ²³æªº¨Ò¤l¡A¥i¥Ü½d¥Î¼Æ¾Ú¾÷¶i¦æ°ò¥»ªº§Ç¦C³q°T¡G
Private Sub Form_Load ()
' Àx¦s¿é¤J¦r¦êªº¼È¦s°Ï
Dim Instring As String
' ¨Ï¥Î COM1.
MSComm1.CommPort = 1
' ³s½u³t«× 9600 baud¡BµL¦P¦ìÀˬd¡B¸ê®Æ¦ì¤¸ 8¡B°±¤î¦ì¤¸ 1
MSComm1.Settings = "9600,N,8,1"
' §i¶D±±¨î¶µ·í¨Ï¥Î Input ®É¡AŪ¨ú¾ãӼȦs°Ï
MSComm1.InputLen = 0
' ¶}±Ò§Ç¦C³s±µ°ð
MSComm1.PortOpen = True
' ±N attention «ü¥O°e¨ì¼Æ¾Ú¾÷
MSComm1.Output = "ATV1Q0" & Chr$(13) ' ½T©w
' ¼Æ¾Ú¾÷¦^À³ "OK" ªº°T®§
' µ¥«Ý¸ê®Æ¶Ç¦^¨ì§Ç¦C³s±µ°ð
Do
DoEvents
Buffer$ = Buffer$ & MSComm1.Input
Loop Until InStr(Buffer$, "OK" & vbCRLF) ' ±q§Ç¦C³s±µ°ðŪ¨ú "OK" ¦^À³¸ê®Æ
' Ãö³¬§Ç¦C³s±µ°ð
MSComm1.PortOpen = False
End Sub |
|