发表于:2006/4/6 17:19:00
#0楼
各位大哥帮一下小弟,我看了一位大哥编程的PC---FX:为什么通讯的灯会亮,但PLC不会ON
Private Sub Command1_Click()
'强制Y0为1
Dim dat As String
commli.OutBufferCount = 0
commli.InBufferCount = 0
commli.Output = "01FFBW0Y001011"
End Sub
Private Sub Command2_Click()
If commli.PortOpen = True Then
commli.PortOpen = False
End If
If Not commli.PortOpen Then
commli.CommPort = 1 '通信口
commli.Settings = "9600,e,7,1"
commli.Handshaking = 0
commli.InputLen = 0
commli.OutBufferCount = 0
commli.InBufferCount = 0
commli.PortOpen = True
End If
End Sub
Private Sub Command1_Click()
'强制Y0为1
Dim dat As String
commli.OutBufferCount = 0
commli.InBufferCount = 0
commli.Output = "01FFBW0Y001011"
End Sub
Private Sub Command2_Click()
If commli.PortOpen = True Then
commli.PortOpen = False
End If
If Not commli.PortOpen Then
commli.CommPort = 1 '通信口
commli.Settings = "9600,e,7,1"
commli.Handshaking = 0
commli.InputLen = 0
commli.OutBufferCount = 0
commli.InBufferCount = 0
commli.PortOpen = True
End If
End Sub