vb点虐 组态王通信 组态王通讯参数怎么设置

组态王与仪表通信问题

可以用VB做一个辅助程序,VB和组态王之间通过DDE连接,这迹纯个在组态王的自带资料里有,也可升州闭以使用OPC连接,直接使用微软自带的OPC组件即可,类似资吵裂料网上有很多。

公司主营业务:成都网站制作、网站设计、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联推出昌邑免费做网站回馈大家。

用vb点虐 实现网络通信

用 vb点虐 socket通信

Dim th As Threading.Thread

2 Dim tcpl As System.Net.Sockets.TcpListener

3

4 Private Sub Form1_Load()Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

5 th = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf MyListen))

6 th.Start()

7 End Sub

8

9 Public Sub SendMessage()Sub SendMessage(ByVal IP As String, ByVal SendMsg As String)

10 Try

11 If IP "" Then

12 Dim tcpc As New System.Net.Sockets.TcpClient(IP, 5656)

13 Dim tcpStream As Net.Sockets.NetworkStream = tcpc.GetStream

14 Dim reqStream As New IO.StreamWriter(tcpStream)

15 reqStream.Write(SendMsg)

16 reqStream.Flush()

17 tcpStream.Close()

18 tcpc.Close()

19 End If

20 Catch ex As Exception

21 MsgBox(ex.Message.ToString)

22 End Try

23 End Sub

24 Private Sub MyListen()Sub MyListen()

25 Try

26 Dim ipAddress As System.Net.IPAddress = System.Net.Dns.Resolve(System.Net.Dns.GetHostName).AddressList(0)

27 tcpl = New System.Net.Sockets.TcpListener(ipAddress, 5656)

28 tcpl.Start()

29 While True

30 Dim s As System.Net.Sockets.Socket = tcpl.AcceptSocket()

31 Dim MyBuffer(1024) As Byte

32 Dim i As Integer

33 i = s.Receive(MyBuffer)

34 If i 0 Then

35 Dim lstrRec As String

36 Dim j As Integer

37 For j = 0 To i - 1

38 TextBox1.Text += Chr(MyBuffer(j)) ","

39 Next

40 End If

41 End While

42 Catch ex As Exception

43 MsgBox(ex.Message.ToString)

44 End Try

45 End Sub

46

47 Private Sub Button1_Click()Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

48 SendMessage("192.168.0.61", TextBox2.Text)

49 End Sub

组态王如何与触摸屏通信

主要看你的物理连接方式,触摸屏的驱动支持。例如:MCGS和组态王通信,可以用Modbus协议。MCGS为主,组态王为从(反之亦可)。MCGS触摸屏有地址转发功滑颂能,直接在触摸屏内建点,转发到对应串口。孙改组态王内配置相应参数,如:地址,波特率,则让判COM口等信息。建立对应地址,即可通信。

组态王通讯中断恢复显示问号

组态王通讯中断恢复显示问号说明通信有问题。根据查询相关资料信息:先联系组态王公司让他给你做一个新的驱动,安装之后通信看看在不行就搞一台PLC试罩谈一试,一般都是驱动芹袭和PLC编程口问题这两个不是一个厂家有些不兼容这个很正常物首碰。


网站题目:vb点虐 组态王通信 组态王通讯参数怎么设置
浏览地址:http://azwzsj.com/article/ddpjppi.html