Modbus_Setup

Top 

Modbus_Setup


Set up A Modbus Client (Hardware: Modbus dual Masters Adaptor from Dafulai Electronic Inc )

Since R2019b

 

Library: Modbus Client ( Dafulai Electronics) /Modbus_Setup

 

 

Modbus_Setup

 

 


 

Description


 

This block sets up all parameters of Modbus Client (Master) which is supported by Hardware "Modbus dual Masters adaptor" from Dafulai Electronic Inc

You must put this block in your simulation model in order to access Modbus Servers by this Modbus Master.

 

Modbus TCP Client  uses PC TCP/IP stacks. However, Our software must detect Hardware "Modbus dual Masters adaptor" is connected to PC (by USB or by Bluetooth).

So it still needs Serial Port number / baud rate / parity / Stop bits.

 

This block will set up Modbus Master parameters.  The baud rate / parity / Stop bits in this block is for Hardware "Modbus dual Masters adaptor" which is connected to PC  by USB or Bluetooth serial Port. It is NOT for Modbus RTU/ASCii client,  Modbus RTU/ASCii client baud rate / parity / Stop bits and physical interface (RS232/RS485/RS422) are decided by ConfigTool.exe Software.  If you use Hardware "Modbus dual Masters adaptor" for the first time, you must run ConfigTool.exe Software under Windows OS to configure hardware.

 

Please see Screenshot below for running ConfigTool.exe

Matlab_config

 

Parameters


 

There are many parameters for this block.  Please double click this block to open parameters dialog below:

 

Modbus_Setup_Param

 

 

Many parameters are self-explanation from the label.  We only explain some special parameters.

 

Connect to — This is USB or Bluetooth Serial port for our Modbus dual masters adaptor hardware.  You must connect USB or Bluetooth Serial port for our Modbus dual masters adaptor hardware even though you only use Modbus TCP server.

 

Modbus Remote Server IP address — This is only useful for Modbus TCP server. It is remote Modbus server IP address or hostname.

 

Service Port — This is only useful for Modbus TCP server. It is remote Modbus server TCP port number. Default is 502.

 

Baud Rate — Baud rate for Modbus dual masters adaptor hardware connecting PC. Valid Baud rates are 4800/9600/19200/28800/38400/43000/57600/115200. Please use drop list to select one.  It is NOT Modbus RTU/ASCii client Baud Rate. It is Baud Rate for Modbus dual Masters Adaptor Hardware interface with PC. Actual Modbus Baud Rate is decided by PC ConfigTool.exe software.  Modbus TCP needs this baud rate to identify Modbus dual Masters Adaptor Hardware.

 

Stop Bit —Valid choices are 1 (default) and 2. Note: This StopBits is not actual Modbus RTU/ASCii StopBits. It is StopBits for Modbus dual Masters Adaptor Hardware interface with PC. Actual Modbus StopBits is decided by PC ConfigTool.exe software. Modbus TCP needs this StopBits to identify Modbus dual Masters Adaptor Hardware.

 

Parity — Valid choices are 'none' (default), 'even', 'odd'. Note: This Parity is not actual Modbus RTU/ASCii Parity. It is parity for Modbus dual Masters Adaptor Hardware interface with PC. Actual Modbus Parity is decided by PC ConfigTool.exe software. Modbus TCP needs this parity to identify Modbus dual Masters Adaptor Hardware.

 

Object ID for multiple Modbus master — In one PC, we may use multiple "Modbus dual masters adaptor" hardware, this is for identifying each one.

 

Hardware USB or BT Serial Port — It is only displayed in Modbus TCP. It is Serial port for Modbus dual Masters Adaptor Hardware interface with PC. Modbus TCP needs this Serial Port to identify Modbus dual Masters Adaptor Hardware.

 

 

Ports


 

Input

 

None

 

 

Outpot


 

None