登录
首页 PLC论坛 PLC论坛
回帖 发帖
正文

主题:求急,誰能帮我改下FC-PLC通讯编程

点击:1786 回复:7

各位大哥帮一下小弟,我看了一位大哥编程的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
06-04-06 17:19
你是在plc运行状态时操作的吗?如果是,那肯定是不行的!
建议你使用串口监控软件监控。
有问题欢迎联系!
QQ:33936155
06-04-06 18:11
你是在plc运行状态时操作的吗?如果是,那肯定是不行的!
建议你使用串口监控软件监控。
有问题欢迎联系!
QQ:33936155
06-04-06 18:13
你发送的命令好象没有校验码.和首字符"Chr(5) "
06-04-06 21:54
顶楼的朋友:
我以关了plc运行状态时操作以不行。还是通讯灯亮和灭,是不是commli.Output = "01FFBW0Y001011的数据是Varinat,发送的数据类型是什么类型?
06-04-07 16:41
用了串口监控软件后,搞定了没有?
如果还不行,就把你的程序全部贴出来吧,让大家一起探讨探讨!
06-04-09 13:34
现在我搞定了。多谢了各位
06-05-03 19:35
新人请问FCA50L是怎么样拷贝程式的
07-06-23 22:52

工控新闻

更多新闻资讯