MTL838B-MBF - MODBUS protocol manual
Date: Dec 26, 2024 Views: 8767
Initialisation mode
The MTL838B-MBF has two distinct modes of operation - normal and initialisation.
It will always enter initialisation mode during power-up. It can also be triggered by the detection of internal hardware or software faults, or after receiving an instruction from the host to reset some or all of the configuration registers.
During initialisation, the unit will ignore all commands from the master.
The initialisation period will take several seconds to complete all the necessary operations and calculations. Following successful initialisation, the unit will automatically enter, or return to, normal operation mode.
If a corrupted configuration database is detected during initialisation the unit will revert to a set of default values, and on entering normal operation mode, will issue exception responses when requested by the host to read input values. Exception responses will continue to be issued until the unit is re-configured. The need to re-configure the unit will remain even if the MTL838B-MBF is powered down and back up.
If a corrupted configuration is detected, the slave address is not automatically reset. If the address was hardware defined then it can only be reset using the units DIL switches. If it is software definable, then the user has the choice of using a PC running PCS83 software.
Slave, Transmitter and Input addressing
The following discusses the allocation of addresses to the slaves on the Modbus network - including the MTL838B-MBF - and the allocation of addresses for the transmitters and inputs connected to each MTL838B-MBF.
Addressing MTL838B-MBF slaves
Modbus allows slave addresses in the range 1 to 247. JBUS allows slave addresses in the range 1 to 255. (This is the only difference between the two protocols). Since the MTL838B-MBF can only have addresses in the range 1 to 31, it will work equally well with either protocol.
The Modbus address for each MTL838B-MBF slave is set either via software (PCS83) or by hardware DIL switches within each unit. Using the hardware selection is recommended, as this allows the slave to identify it's own address even if all of the other configuration parameters are lost. The positioning of the DIL switches that set the slave address can be found on page 40. For the same reasons of security, it is not possible to set the address of the slave via the Modbus host.
Note:
it is possible to use PCS83 to try and set the slave address to '0'. This is not allowed as a slave address as '0' is exclusively reserved for broadcast messages. If a '0' is written to a slave address it will be ignored and the slaves address will be set to '1'.
The hardware switches initially define the address of the first RS485 serial port of the unit (port 'A'). The address for port 'B' can either be identical to that for port 'A' or can be offset by 32, so that the same slave can be addressed as slave '1' via port 'A', or addressed as slave '33' via port 'B'. This facility allows the MTL838B-MBF to be connected to the same master twice, or to two different masters independently. (There is no restriction regarding simultaneous communication on both ports. The unit will respond via the port on which it received the query.)
Addressing the transmitters of each MTL838B-MBF
Each MTL831B transmitter accepts up to 16 sensor inputs.
The address of each transmitter connected to an MTL838B-MBF is set by DIL switches within each transmitter. There is no restriction on the allocation of addresses to the transmitters, except that each address may be used only once and that the addresses used must be contiguous from '1'. (i.e. if there are three transmitters, the addresses used must be '1', '2' and '3', but they can be allocated to the three slaves in any order.)
Note:the allocation of transmitter addresses controls the addressing of each input. See the next section.
Allocation of addresses to individual inputs
There are no facilities by which the user may define the address of individual inputs, other than by the allocation of transmitter addresses. This is structured so that the inputs to the first transmitter have addresses from 1 onwards, with input 'Ι1' having the address for 'input 1', input 'Ι2' having the address for 'input 2' etc.
INPUT STATUS FLAGS AND REGISTERS
The input status flags and input registers are used to store information that the master will want to read from the MTL838B-MBF. The data stored by the MTL838B-MBF is mapped twice, to the input status flags and to the input registers. The user can choose which of the two data stores is the simplest to read from, given the application in question.
Mapping of input status flags and input registers
The tables below show the mapping of the flag and register locations used by the MTL838B-MBF. The tables show the mappings with IEEE data format selected and with non-IEEE.
COIL STATUS FLAGS
A small number of single bit coil status flags are set aside for the Modbus master to read from and write to. The facility to write to these flags is not disabled by the internal DIL switches which disable the configuration parameters write facility.
The coil status flags are only of use when the configuration of the MTL838B-MBF is being done via the Modbus host.
Note: the flags that reset the unit to factory default values cause the unit to perform a significant number of internal operations. This process can take several seconds, and during this time the unit is unable to communicate with the master.
Confirm database correctly configured
A hazard exists with the MTL838B-MBF, whereby it would be possible for the unit to become re-configured, and for the master to be unaware that this had taken place. This could arise following a 'power-up' sequence in which the MTL838B-MBF detects that it's stored CONFIGURATION DATABASE has become corrupted (so that the factory default values for configuration are used instead).
To protect against this risk, once such a re-configuration has occurred, the slave will respond to any READ DATA requests by issuing an EXCEPTION response. Only when the master writes a logic '1' to the CONFIRM flag location will the slave allow data to be read.
The requirement to write to the CONFIRM flag location CONFIRM remains, even if the unit is subjected to further power-down and power-up cycles.
A similar precaution must be taken to prevent the master reading data when it has instructed the slave to use a new DATAFORMAT, but before the CONFIGURATION DATABASE has been re-written in the new DATAFORMAT.
Again, to prevent the master reading data that is not configured correctly, any READ DATA queries will give rise to EXCEPTION responses, until the CONFIRM flag is set to '1'. The requirement to write to the CONFIRM flag location remains, even if the unit is subjected to further power-down and power-up cycles.
Set factory defaults for mV inputs, leaving DATAFORMAT unchanged
Writing a logic '1' to status flag FMT831 performs the same operation as DFT831, but leaves the DATAFORMAT register unaltered. This allows the unit to be reset to factory default values, and then allows the master to write a known DATABASE CONFIGURATION in the required format of data.
HOLDING REGISTERS
The holding registers of the MTL838B-MBF are used almost exclusively to hold data regarding the configuration of the unit. A few unused registers are available for retaining other data if required. All configuration database parameters are stored in battery-backed RAM.
Data format selection
The DATAFMT register is used to select the format of the data stored by the MTL838B-MBF in those holding registers identified by 'DF' in the tables and all of its sensor input registers. (In the tables showing the contents of each register, those which are governed by DATAFMT are marked 'DF').
When a new value is written to the DATAFMT register, the scaling parameters become invalid as they conformed to the previously set data format. Any attempts to read data from these registers will cause the unit to issue an EXCEPTION response, until the CONFIRM flag is set to '1' (after the master has re-written the scaling parameters in the new data format).
In many of the non-IEEE data formats specified in the table above, the encoding of the value in to the chosen format is not immediately apparent. The table below explains the encoding of each format. The table shows the decimal value of the binary, hexadecimal or BCD content of the register, and for each range of values for each data type, the formula for finding the 'represented value' is given.
Related product recommendations:
IS200EISBH1A
IS200ESELH1A
151X1235BC01SA01
151X1235BC01SA41
151X1215DC29SA01
151X1235DB15NP03
151X1235DB10SA01
151X1235DB15SA03
151X1207DC13SA21
151X1235DB15SA01
151X1235BC01SA01
151X1233DB01SA01R3
151X1233DB01SA01R4
151X1233DB01SA01R
151X1235DB15SA02
VME-7807RC-424001
VMIVME-7807RC
VMIVME-017807-414001
VMIVME-7807
VMIVME-7750-834
VMIVME-7740-850
VMIVME-7700
VMIVME-7698
VMIVME-7486
VMIVME-7455
VMIVME-7452
VMIVME-5576
VMIVME-4150
VMIVME-4140
VMIVME-3122
VMIVME-2540
VMIVME-2170A
VMIVME-2128
VMIVME-1150
VMIVME-4140-000
More.....
RELATED ARTICLE
Address
Room 205, Office Building, No.1 Chaoyang North Road, Longwen District, Zhangzhou City, Fujian Province
fengyunfadacai@qq.com
Sales consultant
Miss.Green
+86 15860249102