Gets / Sets slave address of target MODBUS device.
For MODBUS TCP Devices, Path is the Unit ID (sometimes called the Index number) of the target device. For MODBUS RTU/ASCII Devices, Path is the Slave ID ( sometimes called the Node) of the target device. Messages sent with Path = "0" is a MODBUS BROADCAST command which all slave devices recognize. MODBUS READ functions are not supported broadcast operations and will result in an InvalidOperationException by INGEAR.NET.MBLINK
VB Imports MBLink ' ********************* ' * Create Controller Dim MBDevice As new Controller ' ********************** ' * create RTU serial transport class ' * COM1, 19200, N, 8, 1 Dim transport as new CommDriver transport.Driver = DRIVER.SERIAL transport.Protocol = PROTOCOL.RTU transport.ComPort = COMPORT.COM1 transport.Baud = BAUD.BAUD_19200 transport.Parity = PARITY.NONE transport.DataBits = DATABITS.DATABITS_8 transport.stopBits = STOPBITS.STOPBITS_1 ' ************************ ' * assign transport to Controller MBDevice.Transport = transport ' **************************** ' * MODBUS device is node 1 MBDevice.Path = "1" C# using MBLink; ///////////////////////////////// // Create Controller Controller MBDevice = new Controller(); ///////////////////////////////// // create RTU serial transport class // COM1, 19200, N, 8, 1 CommDriver transport = new CommDriver(); transport.Driver = DRIVER.SERIAL; transport.Protocol = PROTOCOL.RTU; transport.ComPort = COMPORT.COM1; transport.Baud = BAUD.BAUD_19200; transport.Parity = PARITY.NONE; transport.DataBits = DATABITS.DATABITS_8; transport.stopBits = STOPBITS.STOPBITS_1; ////////////////////////////// // assign transport to Controller MBDevice.Transport = transport; ////////////////////////////// // MODBUS device is node 1 MBDevice.Path = "1";
Controller Class | MBLink Namespace