本来要贴一个上来,但程序中有工控网禁止的非法字符, 郁闷。
比如: cou nt
‘定义变量
Dim setadOut As String, DevDatOut As String
‘程序初始化
Private Sub Form_Load()
‘列出PLC端口输入输出全部地址
For g = 0 To 7
ListInAddr.AddItem g
ListOutAddr.AddItem g
Next g
For h = 10 To 17
ListInAddr.AddItem h
ListOutAddr.AddItem h
Next h
ListInAddr.ListIndex = 0
ListOutAddr.ListIndex = 0
MSComm1.CommPort = 1 ‘通信口
MSComm1.Settings = "9600,E,7,1" ‘串口参数设置
MSComm1.Handshaking = 0 ‘握手信号