I downloaded the library. It has the API for.net. But not sure how to use it.
I am tring to connect to the OPC server but having hard time. It is saying the command isMXEIOConnect(ByVal szIP As Byte, ByVal iPort As UInt16, ByVal nTimeOut As UInt32, ByRef hConnection As Integer) As Integerwhere szIP: - IP address of the Ethernet I/O device to be connected. When I give the IP address as '.' form it says can not convert string into byte array.
Use.NET for OPC Server development. C# and VB.Net are the preferred tools of many software developers. OPC servers can be developed much like any other.NET application, if based on the DANSrv Toolkit. No DCOM issues have to be handled by the developer. The toolkit generic server handles the DCOM client interface and the.NET wrapping. VB OPC client code follows the code structure found in the OPC Automation Interface 2.0 specification. The code samples provided in this easy download will help developers who are interested in adding OPC client capabilities to their Visual Basic and Visual C applications.
I have no idea how to supply the IP address.Thanks. Hi,I got some code to connect to OPC server. Do u think to connect OPC Server we need to buy OPC Client?Moxa has some commands like this. Do u think I can use them from VB.Net?VB.NET-MXEIOConnect(ByVal szIP As Byte, ByVal iPort As UInt16, ByVal nTimeOut As UInt32, ByRef hConnection As Integer) As IntegerArguments:szIPIP address of the Ethernet I/O device to be connected.wPortTCP port number of Ethernet I/O device.Please use 502 for ioLogik 4000 and ioLogik 2000.dwTimeOutTimeout value for establishing a network connection with the ioLogik Ethernet Adapter.The unit is in milliseconds.hConnectionHandle for the I/O device connection.Return Values:SucceedMXIOOKFailRefer to Return Codes.Thank u. Hi,The example is working when I copied the.dll file into bin/debug folder. But still having problem when I am trying to connect from my program. I have created a form with a 'Connect OPC' button.
![Net Net](/uploads/1/2/5/4/125427098/290307387.jpg)
I added the MXIO.vb file and also added the MXIONET.dll file into 'C:ProjectConnectOPCCon nectOPCbi nDebug' folder. But still it is not connecting to the OPC server.
![Opc protocol example in vb network Opc protocol example in vb network](http://adosol.com/images/opc/dansrv/TestClient3.jpg)
Now I am getting this error 'An attempt was made to load a program with an incorrect format.' Please give me some suggestion.I really appreciate all your help.Thank you very much.