Gets / Sets IP port number for TCP or SOE transports
Default port is 502(decimal)
VB Imports MBLink ' ********************* ' * Create Controller Dim MBDevice As new Controller ' ********************** ' * create MODBUS TCP transport class Dim transport as new CommDriver transport.Driver = DRIVERTYPE.TCP transport.IPort = 6001 transport.IPAddress = "192.168.1.42" transport.Timeout = 1000 ' ************************ ' * assign transport to Controller MBDevice.Transport = transport ' **************************** ' * connect to MODBUS device using transport MBDevice.Connect() C# using MBLink; ///////////////////////////////// // Create Controller Controller MBDevice = new Controller(); ///////////////////////////////// // create MODBUS TCP transport class CommDriver transport = new CommDriver(); transport.Driver = DRIVERTYPE.TCP; transport.IPPort = 6001; transport.IPAddress = "192.168.1.42"; transport.Timeout = 1000; ////////////////////////////// // assign transport to Controller MBDevice.Transport = transport; ////////////////////////////// // connect to MODBUS device using transport MBDevice.Connect();
CommDriver Class | MBLink Namespace