Get MBLogic at SourceForge.net. Fast, secure and Free Open Source 
	software downloads

Help Topics

Topic Details for Communications

Help - Server Communications Configuration


Overview

Servers configurations are saved in a text file called "mbserver.config". This configuration file is read on start up of the software and used to determine what protocols to enable, what network addresses and ports to use, what data to read or write, etc. This file must be edited in order to configure a system for every individual application.


Configuration Overview

Editing a Configuration

There is one, and only one server communications configuration file for each system. This file is in ASCII text format and may be edited with any standard text editor. If you use a word processor, be sure to save in a plain text mode which does not insert formatting characters into the text.

The status system also provided a web based forms for editing the configuration rather than using a text editor.

Configuration Elements

A communications configuration file contains the following elements:

Configuration Syntax

The configuration syntax has the following general properties:

Comments

Any line beginning with a '#' character is considered to be a comment and is ignored. Comments must begin at the start of a line, and may not be on the same line as any other valid input.

Example


	# 16-Apr-2008. This is a comment.
	# This is also a comment.


System Configuration

The system configuration contains parameters which are system wide as opposed to limited to a specific protocol.

Server ID Name

The server id name is the name applied to the complete system (not just an individual protocol server). The server id name may be any arbitrary text, including spaces. The server id name appears in a special section which is always called "&system" (note the ampersand). The actual name used for the server is then indicated by a key called "serverid". The server id name is in the following format:

Expanded Holding Register Map Offsets

The expanded register map configuration allows certain server protocols to access additional memory beyond the normal protocol limits. Details of this may be found in the separate section on expanced register maps. This section deals with the configuration parameters.

By default, expanded register map support for servers is turned off. If you do not configure the parameters, unit IDs will simply be ignored by the servers. If you configure the parameters incorrectly, the expanded register map feature will also be disabled, as the system will not be able to calculate the address offsets correctly.

There are two parameters relating to expanded register maps. These are:

The mbaddrexp parameter must be set to "incremental" to enable the expanded register map. Any other value will act to disable it. In future other algorithms may be introduced, but at present only "incremental" is available.

The mbuidoffset has two values which must be separated by a comma. These are (in order) the "UID offset" and "UID factor". Details of how to set these factors are discussed in the section on expanded register maps.

Both values must be positive integers. The UID offset must be less than 255. The UID factor must be less than the maximum holding register memory map address.

Example


	[&system]
	serverid=Name of Example Server 
	mbaddrexp=incremental
	mbuidoffset=1,65536


Server Configuration

Configuration Items

Server configurations consist of three elements:

Item Description
The section name. This is used as the name of the server. This name is used to identify the server in the status monitoring system and will appear on the status web pages.
type This is the protocol type and is used to determing the communications method used. This must be one of the recognised protocol types (listed below).
protocol This determines the protocol recognised by the server. This must be one of the recognised protocols (listed below).
port The IP port number. This must be a valid integer IP port number.

Example


	[Main1]
	type=tcpserver
	protocol=modbustcp
	port=8502

Types

The recognised types are:

Protocols

The recognised protocols are:

Protocol Description
modbustcp The Modbus/TCP protocol.
mbrest A Modbus-like web service protocol (obsolete).
mbhmi The server used to serve HMI web pages, and also provide a web service protocol used by the HMI system.
rhmi A restricted version of the "mbhmi" protocol. It uses the same configuration and resources as the "hmi" option, but write and alarm acknowledge commands are disabled.
erp Another restricted version of the "mbhmi" protocol, intended for MRP/ERP and other business integration applications. It uses the same configuration and resources as the "hmi" option, but only supports "read" and "write" commands from a specified (filtered) tag list.
status The status web server. This is not a communications server in the same sense that the others are, but this allows the IP port number to be configured. If this server is not configured, the status web pages will not be available.
help This is similar to the status protocol, in that it sets the address used by a web server. In this case, this is the web server used for the "help" system.
generic This is a special server protocol used to support generic clients. You must enable this if you wish to make use of a generic client.

Only one server of each protocol can be configured. There is no limit however to how many incoming client connections each server will accept. If a protocol is not configured, that protocol server will not be active.


Complete Example

The following is an example showing a complete configuration file.

Example


	# Test configuration for MB Server.
	# 23-Jul-2010
	
	# Name of server.
	[&system]
	serverid=Loopback Server
	# The following parameters are optional.
	mbaddrexp=incremental
	mbuidoffset=1,65536
	
	# Server configurations.
	# Modbus/TCP protocol.
	[Main1]
	type=tcpserver
	protocol=modbustcp
	port=8502
	
	# MB-REST web service protocol.
	[Web1]
	type=tcpserver
	protocol=mbrest
	port=8085
	
	# MB-HMI web server and web service protocol.
	[HMI]
	type=tcpserver
	protocol=mbhmi
	port=8082

	# Restricted (read-only) version of the mbhmi protocol. 
	[ROHMI]
	protocol = rhmi
	type = tcpserver
	port = 8083

	# Limited version of the mbhmi protocol for MRP/ERP applications.
	[ERPAccess]
	protocol = erp
	type = tcpserver
	port = 8084
	
	# Status web server.
	[status]
	type=tcpserver
	protocol=status
	port=8080
	
	# Help system web server.
	[WebHelp]
	type=tcpserver
	protocol=help
	port=8081
	

Loop Back Sample

The sample configuration file supplied with the system uses what is referred to as a "loop-back" configuration for the clients. That is, a set of Modbus/TCP clients are configured to poll the system's own Modbus/TCP server. This is not in itself a useful feature. It is provided mainly to demonstrate the communications features. A different configuration should be created for a practical application. The sample configuration demonstrates the following features.