楼主最近还看过
读取$0,也就是W40001数值:
Private Sub Timer1_Timer()
MSComm1.Output = ":" + "010300000001" + LRC("010300000001") + Chr$(13) + Chr$(10)
MSComm1.Output = ":" + "00050500FF00" + LRC("00050500FF00") + Chr$(13) + Chr$(10)
inputstring = MSComm1.Input
Text1.Text =mid(inputstring, 8, 4)
End Sub
哪里有问题 为什么这段程序无法实现呢 是pc用串口读HMI $0位的
回复内容:
对:≡☆☆☆☆☆≡关于4不用写,写或读“字”命令就定义了4, 00和 00写到 Data1和Data2,实际上是写或读40001H。 Data1和Data2应该是地址 内容的回复:
读取$0,也就是W40001数值:
Private Sub Timer1_Timer()
MSComm1.Output = ":" + "010300000001" + LRC("010300000001") + Chr$(13) + Chr$(10)
MSComm1.Output = ":" + "00050500FF00" + LRC("00050500FF00") + Chr$(13) + Chr$(10)
inputstring = MSComm1.Input
Text1.Text =mid(inputstring, 8, 4)
End Sub
哪里有问题 为什么这段程序无法实现呢 是pc用串口读HMI $0位的