gpt4 book ai didi

vb.net - VB控制PLC的应用

转载 作者:行者123 更新时间:2023-12-02 10:54:52 24 4
gpt4 key购买 nike

我试图使用来自Allen Bradley的vHMIABE驱动程序从Vb应用程序控制Allen Bradley ControlLogix PLC,但我不断收到此错误:

http://imageshack.com/a/img842/4560/lqy2.png

当我单击使用以下代码的“连接”按钮时,将出现此错误:

    Private Sub PLC_Connect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PLC_Connect.Click

'Connection to PLC
Display.Items.Clear()

With Read_Bit
.Control_PLCType = vHMIABE.enuPLCType.ControlLogix 'PLC of ControlLogix
.Control_PLCIPAddress = "192.168.1.112"
.Control_SocketNumber = 44818
.Control_ResponseTimeOut = 5000 'The communication will timeout after 5 secondes
.Memory_Function = vHMIABE.enuPLCMemoryFunction.Connect ' Connection

.Control_UseAdvancedErrorReporting = True 'Description of error messages

.Control_Update() ' Make the connection

End With

With Write_Bit

.Control_PLCType = vHMIABE.enuPLCType.ControlLogix 'PLC of ControlLogix
.Control_PLCIPAddress = "192.168.1.112"
.Control_SocketNumber = 44818
.Control_ResponseTimeOut = 5000 'The communication will timeout after 5 secondes
.Memory_Function = vHMIABE.enuPLCMemoryFunction.Connect ' Connection

.Control_UseAdvancedErrorReporting = True 'Description of error messages

.Control_Update() ' Make the connection

End With

End Sub

我试图尽可能多地添加注释,以使我的代码更易于理解

有人有什么想法吗?

非常感谢每个前进。

最佳答案

我不知道该驱动程序,但是我可以为您提供一个基于.NET的更现代的选项,它更易于使用。实际上,一行代码将写入或读取变量

http://www.advancedhmi.com

读取的代码示例:

EthernetIPforCLXCom1.Read("MyTag")

关于vb.net - VB控制PLC的应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23008967/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com