vb.net与三菱PLC通讯线通讯代码,急用,能读写IO及数据寄存器即可PLC的协议厂家一般都不会公开,不过厂家都有提供高级语言开发的解决方案,百度一下能找到相关资料,三菱的ENTFXPLC,ENTQSPLC,西门子的WINTCPS7,欧姆龙的FINSTCP都有VB.NET和C#的范例的;
大神,你好 。我最近在学VB.net,我需要与omron或者三菱PLC进行通讯,有案例嘛?西门子:WinTcpS7,三菱:EntQsPlc,欧姆龙:FinsTCP,百度都能搜到资源的;
欧姆龙PLC与vb通信能否改变IO开关量(数据类型是bool)的值怎么改?plc 编程口是usb的 协议不公开 直接改变不能 但是你可以在plc里写个通讯程序 比如自由口 串口一 接收到字符 1 把100.0 置1
然后在vb里 调用 COM控件 发送字符1 那么plc的 100.0口就可以改变了
谁有VB和OMRON PLC 通信例子?。磕芊穹⒏鲈即耄?再次特别感谢!提供一个VB.NET与OMRON以太网通讯vb.net与欧姆龙通讯的代码vb.net与欧姆龙通讯,是我项目里面复制出来的vb.net与欧姆龙通讯:
Dim Handle1 As Int32 'PLC的连接句柄
Dim EntLink As Boolean '连接标志
Dim PLC As New FinsTcp.PlcClient '引用OMRON的通讯组件
Private Sub butLink_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butLink.Click
Dim re As Short
Dim restr As String = ""
re = PLC.EntLink(Trim(txtLocalIP.Text), Val(txtLocalPort.Text), Trim(txtRemoteIP.Text), Val(txtRemotePort.Text), "DEMO", Handle1)
txtReLink.Text = re.ToString
If re = 0 Then
EntLink = True
MsgBox("PLC联接成功! ")
Else
EntLink = False
MsgBox("PLC联接失败: "restr)
End If
End Sub
【vb.net与欧姆龙通讯 c#与欧姆龙plc通讯】Private Sub butClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butClose.Click
Dim re As Short
EntLink = False
re = PLC.DeLink(Handle1)
txtReClose.Text = re.ToString
End Sub
Private Sub butRead_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butRead.Click
Dim re As Short
Dim i As Short
Dim RD() As Object
ReDim RD(Val(txtReadCnt.Text - 1))
If Not EntLink Then
MsgBox("还未与PLC建立联接vb.net与欧姆龙通讯!")
Exit Sub
End If
Dim mry As FinsTcp.PlcClient.PlcMemory = cmbReadMry.SelectedIndex + 1
Dim typ As FinsTcp.PlcClient.DataType = cmbReadType.SelectedIndex + 1
re = PLC.CmdRead(Handle1, mry, typ, CUShort(Val(txtReadAdd.Text)), CUShort(Val(txtReadCnt.Text)), RD)
txtReRead.Text = re.ToString
lstRead.Items.Clear()
For i = 0 To UBound(RD) Step 1
If Not IsNothing(RD(i)) Then lstRead.Items.Add(RD(i))
Next i
If re0 Then
Timer1.Enabled = False
butScan.Text = "Cycle R/W"
End If
End Sub
Private Sub butWrite_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butWrite.Click
Dim re As Short
Dim i As Short
Dim temp() As String
Dim WD() As Object
If Not EntLink Then
MsgBox("还未与PLC建立联接!")
Exit Sub
End If
ReDim WD(Val(txtWriteCnt.Text) - 1)
temp = Split(txtWrite.Text, vbCrLf)
For i = 0 To UBound(WD) Step 1
If iUBound(temp) Then
WD(i) = 0
Else
WD(i) = Trim(temp(i))
End If
Next i
Dim mry As FinsTcp.PlcClient.PlcMemory = cmbWriteMry.SelectedIndex + 1
Dim typ As FinsTcp.PlcClient.DataType = cmbWriteType.SelectedIndex + 1
re = PLC.CmdWrite(Handle1, mry, typ, CUShort(Val(txtWriteAdd.Text)), CUShort(Val(txtWriteCnt.Text)), WD)
txtReWrite.Text = re.ToString
If re0 Then
Timer1.Enabled = False
butScan.Text = "Cycle R/W"
End If
End Sub
c# 怎么与欧姆龙PLC通讯FINS协议是omron的一个标准通讯协议vb.net与欧姆龙通讯,网上可以搜的到 。上位机用C#按FINS协议协议编写程序通过串口收发就可以跟PLC通讯vb.net与欧姆龙通讯了vb.net与欧姆龙通讯,vb.net与欧姆龙通讯我用VB做过类似项目的
推荐阅读
- 魔兽世界虚拟机不兼容,魔兽世界虚拟机不兼容怎么设置
- GIS的运行建议,gis运行规程
- ppt如何有动画形式,ppt里动画
- postgresql中的双引号的简单介绍
- 包含postgresqlguimac的词条
- 苹果13动作游戏有哪些,ios13好玩的功能
- html5导航字的间距,html5如何设置导航
- python机器学习常用函数 python 机器学习
- 优学派平板电脑耳机怎么关,优学派平板电脑耳机怎么关掉