Gets / Sets serial Baud Rate for SERIAL transport.
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 transport.Timeout = 1000 ' ************************ ' * assign transport to Controller MBDevice.Transport = transport ' **************************** ' * connect to MODBUS device using tranport MBDevice.Connect() 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; transport.Timeout = 1000; ////////////////////////////// // assign transport to Controller MBDevice.Transport = transport; ////////////////////////////// // connect to MODBUS device using transport MBDevice.Connect();
CommDriver Class | MBLink Namespace