Przejdź do głównej zawartości

Modbus Interface Reference

Ta treść nie jest jeszcze dostępna w Twoim języku.

The Overvis MC251 operates as a Modbus gateway, listening for Modbus TCP connections on port 502 (configurable). It supports connections from standard Modbus TCP client applications. Windows client software for basic testing is available for download here.

Upon receiving a connection request, the MC251 checks its list of active clients. If the maximum list size (as per technical specifications) has not been reached, the new client is accepted.

Once connected, the MC251 processes Modbus requests from the client. In RS-485 Slave Mode, it also accepts requests from a Modbus Master on the RS-485 bus.

The device analyzes each request based on the requested function and the client’s access rights (determined by passwords entered).

  • Blocked Requests: If a request is blocked due to insufficient rights, the MC251 sends back a Modbus exception (default code 1).
  • Internal Requests: If the request addresses the MC251 itself, it is processed internally, and a reply is sent back.
  • Redirection:
    • RS-485 Master Mode: Requests for other devices are converted (Modbus TCP/RTU/ASCII) and redirected to the RS-485 bus. The RS-485 indicator lights up while waiting for a response.
    • Remote Server: If configured, requests can be redirected to one or several remote Modbus TCP servers via Ethernet or GSM/LTE.

If a valid response is received, the MC251 forwards it back to the client.

  • Exception Illegal Function (Code 1) is returned for a request: Sent either by MC251 (if insufficient rights for the request) or by the target device (if the request unsupported). Check the MC251 settings, Administration tab for protection settings. Send the correct password to the MC251 before using this request. Try allowing the requests.
  • Exception Gateway Path Unavailable (Code 10 or 0x0A) is returned for a request: Sent if the request cannot be redirected. Check the connection to the remote is configured and established (if the target should be requested using Modbus TCP). Check the Modbus Master mode is configured (if the target should be requested using Modbus RTU/ASCII). Check the Modbus address ranges on MC251 Modbus settings tab.
  • Exception Target Device Failed to Respond (Code 11 or 0x0B) is returned: Sent if no response is received from the target device. Check the device settings match the MC251 Modbus tab configuration. Check the target device is powered on.
  • Some exception (not 1, 10 or 11) is returned: Sent by the target device if it could not perform the request or produce the response data. Check the device manual. Try some other request.
  • The data has been acquired, but the values seem wrong: Check the device manual. Ensure the Modbus device address and Modbus register address in the request are correct. Check the data formatting in the Modbus client software (which is sending this request). Try dividing the acquired value by 10, 100 or 1000.

With an active SIM card, the MC251 can process Modbus requests via SMS.

Incoming SMS messages are checked for a valid Modbus request format.

  • Modbus Requests: Must begin with a configured password. If the password matches, the request is processed.
  • Other Messages: Stored in the incoming SMS list and can be processed by a task file (see Logic Programming).

Request Syntax: [Password] [Access][DeviceID][Resource][Address] [Value]

  • Password: As configured in settings.
  • Access: R (Read, FC 1-4) or W (Write, FC 5-6).
  • DeviceID: Modbus address of the target device.
  • Resource:
    • H: Holding Registers
    • I: Input Registers
    • D: Discrete Inputs
    • C: Flags (Coils)
  • Address: Register address.
  • Value: (Write requests only) The value to write.

Examples:

  • Read register 100 of device 1: abc r1h100 (assuming password is “abc”)
  • Write 5000 to register 174 of device 2: stanc12 w2h174 5000 (assuming password is “stanc12”)

The MC251 sends a response SMS upon processing the Modbus request command.

  • Success: Returns the command (without password) and the register value.
    • Example: r1h100 2200 (Read value 2200 from register 100 of device 1).
  • Error: Returns the command, EXC., the exception code, and a description.
    • Example: r3h873 EXC.2 ILLEGAL DATA ADDRESS (Register 873 of device 3 is not readable).

Table 1 - Standard Modbus Exception Codes

CodeExceptionDescription
1ILLEGAL FUNCTIONThe received function code cannot be processed
2ILLEGAL DATA ADDRESSThe data address specified in the request is not available
3ILLEGAL DATA VALUEThe value contained in the request data field is invalid value
4DEVICE FAILUREUnrecoverable error has occurred when the addressee has tried to perform the requested action
5ACKNOWLEDGEThe addressee accepted the request and processed it, but it takes a long time
6DEVICE BUSYThe addressee is busy processing the command. The client can retry the request later
8MEMORY PARITY ERRORThe parity error was detected when the addressee has tried to read the extended memory
10GATEWAY PATHS NOT AVAILABLEThe gateway cannot redirect the request, since there is no path (connection) to the addressee
11TARGET DEVICE FAILED TO RESPOND TO GATEWAYThe gateway did not receive a response to the forwarded request, because the addressee did not respond in time

The MC251 can be configured using any Modbus TCP client.

  1. Connect: Use the MC251’s IP address (press R button on device to view) and Modbus ID (default 111).
  2. Enter Password: Write the password (default on device label) into the password registers (see Current Mode Parameters).
  3. Verify Mode: If the password is correct, the Mode register will read 1 (Setup Mode).

In Setup Mode, you can modify the Changeable Settings registers.

  • Save Changes: Write 2 to the Command Register. Verify by comparing changeable parameters with saved parameters.
  • Save & Apply: Write 4 to the Command Register. Applies Modbus parameters immediately without restart.
  • Cancel Changes: Write 9 to the Command Register. Reverts changeable parameters to saved values.
  • Factory Reset: Write 444 to the Command Register. Resets all settings to defaults.
  • Restart Device: Write 1 to the Command Register. Required for some settings to take effect.
  • Exit Setup Mode: Write 0 to the first password register (100). This clears the password and command registers.

Table 2 - Parameter Data Formats

ParameterRange of valuesDescriptionNumber of occupied registers
Number0 – 65535Integer number (16 bit) in standard range of Modbus register values1
Number-32768 – +32767Integer number (16 bit) in complementary arithmetic1
Number0 – 4294967295 in two registers, MSB part – firstInteger number, which value can exceed the limit for Modbus register (65535)2
Number-2147483648 – +2147483647 in two registers, the MSB part is the firstInteger number (32 bit) in complementary arithmetic2
Character stringIn every register – number of 0 to 255 - ASCII character code or 0 (the end of string)A set of values, each of which is equal to the code of one character in the ASCII encoding. If the string is shorter than the maximum length, the code 0 is placed after the last character.Max. length of string for this parameter
IP-address (IP-mask)In every register – one byte (0 – 255)Set of four byte of address IPv4, from left to right4
MAC-addressIn every register – one byte (0 – 255)Set of six byte of address MAC-48, from left to right6

Table 3 - Parameter Groups

GroupDescriptionAccessAddress
Device descriptionDevice and firmware identificationAny mode, read only0 – 3
Current modeAccess and general commands controlsPassword entry is available in any mode, command entry - only in setup mode (after password entry)100 – 120
Current statusInterfaces and software modules operation, current time and statisticsAny mode, read only121 – 295, 900 – 944, 2000–2023
Changeable settingsInterfaces and features selection and configurationOnly in setup mode, reading or writing300 – 899,
Active settingsThe configuration being used by the device at the momentIn any mode, read only2300 – 2899,
Saved settingsThis set is saved regardless the power of the device and is used at restartOnly in mode of setting, read only3300 – 3899,
Clock settingSee Table 5.8.Only in clock setting mode, for reading or writing34817 – 34825

Table 4 - Device Description Parameters

ParameterDescriptionAddress
Device typeThe code that defines the Modbus device for the manufacturer (47 – MC251)0
Firmware versionFirmware version of embedded software1
Check codeCRC32 of firmware of embedded software2 – 3

Table 5 - Current Mode Parameters

ParameterRange of valuesInitial valueDescriptionAddress
Entered passwordString of characters0When entering a valid password, the client is given the appropriate permission (see registers 710 - 749)100 – 119
When you enter an empty string, the client rights are reset to the rights level at the time of connection
Control command0 – 65397, writing in the configuration mode0See Table 5.1 for the list of commands.120

Table 5.1 - Control Commands (Register 120)

ValueCommandDescription
0No activityNo action performed
1RestartRestart the MC251 device
2SaveSave settings changes via Modbus
3ApplyApply settings without restarting (Modbus parameters only)
4Save and applyExecute “Save” then “Apply” commands
6ExportSave settings to a file on the memory card (see Memory card)
7ImportRead settings from a file on the memory card and save them
9CancelRevert to saved settings
51Apply for ModbusApply settings via Modbus and RS-485
81Synchronize clockSynchronize clock with NTP server
161Test SMSSend a test SMS to the main subscriber number
444Factory ResetReset settings to factory defaults
35381Start clock settingAllow access to clock setting registers
35431Cancel clock settingClose access to clock setting registers without changes
40959Update task memoryErase the logic program (re-read if memory card is inserted)
64893Download UpdatesDownload latest firmware from cloud to MC251FW2.FUS
65397Update FirmwareProgram firmware from file MC251FW2.FUS

Table 6 - Current Status Parameters

ParameterDescriptionAddress
Mode (for details see reg. 122)0: User’s mode;121
1: Setting mode
Tabs of accessSee Table 6.1 for the list of access bits.122
Time, minNumber of minutes since the moment of start-up123 – 124
Number of TCP clientsNumber of occupied connections of TCP125
Limit of TCP clientsNumber of prospective clients of TCP126
Load of RS-485, query/sTotal number of query/s via RS-485127
Effective load of RS-485, query/sNumber of responds without errors via RS-485 per second128
Load of RS-485 per second, %Load of RS-485 for the last second considering the set rate of RS-485 and time of inactivity129
Load of RS-485 per minute, %Load of RS-485 for the last minute 130
Load of RS-485 for 5 minutes, %Load of RS-485 for the last 5 minutes131
Load of Modbus TCP, query/sThe number of queries received from clients via Modbus TCP per second132
Effective load of Modbus TCP, query/sNumber of responds without errors being sent to the client via Modbus TCP per second133
Load of GSM, kB/sLoad of wireless channel with GSM being switched on134
Load of Ethernet,100 kB/sLoad of wire channel with Ethernet being switched on135
Max. number of clients of TCPMaximal number of simultaneously connected clients via TCP – from the moment of start up136
Max. load of Modbus TCP, query/sMaximal number of queries received per second from the clients via Modbus TCP – from the moment of start up137
Max. load of RS-485, %Maximal load of RS-485 for 5 minutes – from the moment of start up138
Max. load of GSM, kB/sMaximal load of GPRS/LTE – from the moment of start up139
Current IP-address of EthernetIP-address, by which MC251 device is accessible in Ethernet network1140 – 143
Current MAC-address of EthernetMAC-address, by which MC251 is detected in Ethernet network144 – 149
Unused parameterThe parameter is reserved for compatibility150 – 164
Time to connect to the data collection server0 – connection to the data collection server is set;165
1 – connection to the data collection server is performed;
2 – 65534: the number of seconds before reconnecting;
65535: connection to the server is not used
Number of programmed restartsNumber of restarts in accordance to the user setting – for total operational time166
Number of critical errorsNumber of noted errors (failures) causing the restart of the device – for total operational time167
Total operation time, minThe number of minutes of operating time - for the total operational time168 – 169
Current timeNumber of seconds since 1st of January of specified year (see reg. 172)170 – 171
Year of countdownYear, since 1st of January which is taken for time counting172
Time zone, minTime zone, for the time count, number of minutes with sign as to UTC+00173
Temperature, °CTemperature inside MC251174
Power voltage, mVBus voltage of 12 V175
Time to connect to the first remote TCP server, s0 – connection to the remote server is set;
1 – connecting to the remote server;
2 – 65534: the number of seconds before reconnecting;
65535: connection to the remote TCP server is not used176
Interface for connecting to the first remote TCP server0 – the connection is not set;177
1 – Ethernet connection is set;
2 – GSM connection is set
DST increment, minEffective day saving time increment178
Unused parameterThe parameter is reserved for compatibility179 – 209
IP-address of client 1IP-address of client, 0.0.0.0 – not connected180 – 183
Port of client 1Port of client, 0 – not connected184
IP-address of client 2IP-address of client, 0.0.0.0 – not connected185 – 188
Port of client 2Port of client, 0 – not connected189
IP-address of client 3IP-address of client, 0.0.0.0 – not connected190 – 193
Port of client 3Port of client, 0 – not connected194
IP-address of client 4IP-address of client, 0.0.0.0 – not connected195 – 198
Port of client 4Port of client, 0 – not connected199
Unused parameterThe parameter is reserved for compatibility and is equal to 0200 – 209
Year (current time)Current year210
Month (current time)Current month211
Day of the month (current time)Current day of the month212
Hour (current time)Current hour213
Minute (current time)Current minute214
Second (current time)Current second215
Day of week (current time)Current day of week (1 – Monday)216
Month (winter time)Current month, excluding summer time217
Day of the month (winter time)Current day of the month, excluding summer time218
Hour (winter time)Current hour, excluding summer time219
Unused parameterThe parameter is reserved for compatibility220 – 229
Time of day, sNumber of seconds from midnight of the current day230 – 231
Time of sunrise, s0 – 86399: Number of seconds from midnight to sunrise;232 – 233
86400: Sunrise is not observed on this day
Sunset time, s-1: Sunset is not observed on this day;234 – 235
0 – 86399: Number of seconds from midnight to sunset;
Time of day, msNumber of milliseconds from midnight of the current day236 – 237
Memory card occupancy, 0.01%10000 – memory card is missing or full238
Estimated time spent on 1% of the memory card, days0 – less than one day;239
1 – 9999 – days for 1% of the memory card capacity;
10,000 – more than 10,000 days;
65535 – unknown
Time before connecting to the second remote TCP server, sSimilar to register 176240
Connection interface to the second remote TCP serverSimilar to register 177241
Time before connection to the third remote TCP server, sSimilar to register 176242
Connection interface to the third remote TCP serverSimilar to register 177243
Current IP-address of GSM2IP-address obtained from GPRS1 provider900 – 903
Unused parameterThe parameter is reserved for compatibility904 – 914
GSM signal level, %2Signal level and quality of radio communication with GSM provider915
Unused parameterThe parameter is reserved for compatibility916 – 940
Memory card capacity, kB0 – card missing or unformatted in FAT / FAT32941 – 942
The amount of data that has not been written to the memory card since the start, bytes0 – there were no data record losses943 - 944
4294967295 – more than 4 GB losses
Firmware Download Status BitsSee Table 6.2 for the list of status bits.2004
Firmware file download progress (х 0.01%) Proportion of downloaded data size to total file size.2005
10000 – File fully downloaded
Loaded programming logic tasks numberThe number of the tasks correctly loaded into the internal memory2020
Code of the first illegal logic task errorThe code of the first error met in the first taskfile that could not be loaded2021
Line number of the first illegal logic task errorThe line number where the first error was met in the first taskfile that could not be loaded2022
Loaded programming logic tasks memory usage, bytesThe amount of RAM reserved for the programming logic tasks execution2023
Firmware File HeaderThe string identifier of the version, e.g., “MC251, ver.45”.2030 – 2061
A blank string indicates the file is either unverified or invalid

Table 6.1 - Tabs of Access Bits (Register 122)

BitDescriptionValue 0Value 1
0Permission to obtain RS-485 reading rights (via password)Cannot be obtainedCan be obtained
1Current RS-485 reading permissionNo permissionPermission granted
2Permission to obtain RS-485 write/control rights (via password)Cannot be obtainedCan be obtained
3Current RS-485 write/control permissionNo permissionPermission granted
4Permission to obtain MC251 register access (via password)Cannot be obtainedCan be obtained
5Current MC251 register access permissionNo permissionPermission granted
6Reserved-Always 1
7Permission to configure MC251No permissionPermission granted
8ReservedAlways 0-
9Connection right-Client has right (Always 1)
12Permission to set the clockNo permissionPermission granted

Table 6.2 - Firmware Download Status Bits (Register 2004)

BitStatusValue 0Value 1
1Busy StatusWaiting for commandFile download in progress
2Update Download ErrorNo errorDownload error occurred
3Server ConnectionNo connectionConnected to server
4File Data ReceptionNo data receivedFile data received
6File Download CompletionFile not downloadedFile fully downloaded
7File ValidityNot confirmedFile is valid

Table 7 - Settings Parameters

ParameterRange of valuesFactory settingDescriptionAddress
Ethernet network
Static IP-addressIP-address192.168.0.111If the dynamic addressing is switched off or not available, IP-address of the device in Ethernet network is equal to this value300 – 303
Subnetwork maskIP-mask255.255.255.0It is used only with static IP-address304 – 307
GatewayIP-address192.168.0.1It is used only together with static IP-address for communication with other networks, or as an address of DNS/DHCP servers308 – 311
Switch on the dynamic addressing with a help of DHCP0 – 110 – for addressing in Ethernet, the specified values of the IP address, mask and gateway are used;312
1 – If DHCP server is available in the network, then IP address, mask and gateway are received from the server
Unused parameter00Should be 0 for compatibility313
Switch on the use of server gateway DNS0 – 11It is used if DHCP is not available (switched off):314
0 – DNS of gateway is not used;
1 – The gateway DNS is used to determine the IP addres-ses of other servers, if they are specified by host names
IP-address of DNS serverIP-address8.8.8.8It is used if DHCP is not available (switched off);315 – 318
When the server of DNS gateway is used, it sets IP-address of additional DNS server
IP-address of additional DNS serverIP-address0.0.0.0It is used if DHCP is not available (switched off);319 – 322
0.0.0.0 – it is not used
Unused parameter00Should be 0 for compatibility323 - 329
GSM network
PIN-code of SIM-card0 – 65535655350 – 9999: this code is used for the SIM card if it demands the PIN code;330
Other values: the code isn’t used; SIM card and GSM are unavailable if the card demand a code
Enable automatic detection of GSM operator’s APN0 – 110 – connection is established by manually specified APN parameters;331
1 – APN is automatically determined for the operator by SIM card ICCID code
Enable roaming exchange0 – 110: GPRS/LTE is blocked in roaming;332
1: GPRS/LTE may be used in roaming
Activate SMS in roaming0 – 100 – SMS can be only received in roaming;333
1 – SMS can be received and sent in roaming
Connection port via GSM0 – 655350It is used for external connection to the device via GSM with static IP, for communication using the Modbus TCP protocol or in tunnel mode.334
0 – it is disabled
Parameter is not used00It is not used; it should be equal to 0 for compatibility335 – 351
APN log-in of GPRS/LTE serviceCharacter stringProvided by the GSM service provider; up to 40 characters352 – 391
APN password of GPRS/LTE serviceCharacter stringProvided by the GSM service provider; up to 24 characters392 – 415
APN address of hostCharacter stringProvided by the GSM service provider; up to 34 characters; there cannot be spaces in a string416 – 449
TCP Server
Connection port via Ethernet1 – 65535502It is used for external connection to MC251 via Ethernet for exchange via Modbus TCP protocol or in tunnel mode450
Disconnect inactive clients0 – 110 – incoming TCP connection is kept regardless of the time between requests from the client;451
1 – disconnect clients that did not send requests for longer than a specified time
Max. request waiting time, s0 – 600 00090Used if disconnection of inactive clients is selected452 – 453
Unused parameter00Should be 0 for compatibility454 - 456
Own Modbus-identifier of MC2510 – 2471110 – all queries are sent via Modbus to the Modbus network, the device registers are unavailable by Modbus;457
1 - 247 – the device responds Modbus queries with this Modbus identifier without forwarding them on
RS-485 network
Bit rate via RS-485, bit/sec75 – 230 4009 600It is used in case of data exchange between the devices via RS-485, the same value for the devices on the same RS-485 bus cable458 – 459
Quotient for Modbus RTU silence time between frames0 – 51It is used for transmissions via RS-485 in Modbus RTU mode. During response reception, if the pause between the bytes is longer than the silence time, the frame is considered complete.460
0 - standard silence time (depends on the transmission speed and is equal to the transmission time of 3.5 bytes, or 1.75 ms for speeds above 19200 bps)
1 - 5: N quotient for a prolonged silence time multiplied by 2^N
Byte format when transmitting via RS-4850 – 55It is used in case of data exchange between the devices via RS-485. See Table 7.1 for formats.461
Waiting time for starting the Modbus RTU response, ms0 – 60 000200It is used for transmissions via RS-485 in Modbus RTU mode. After transmission of query, if the first byte of the response was not received within this time interval, the waiting for the response is terminated. The response is always waited for at least the silence time between frames462
Enable ASCII exchange mode in Modbus network0 – 10Exchange mode via RS-485, the same value for all units on the same RS-485 bus cable.463
0 – RTU exchange mode (format: 1 start bit, 8 data bits, 2 stop-bits, parity bit, and stop bit or only 1 stop bit – total from 10 to11 bits);
1 – ASCII exchange mode (format: 1 start bit, 7 data bits, 2 stop-bits or parity bit and stop bit - total is 10 bits). The non-standard byte formats (register 461, values 4 and 5) are not available in this case, format 3 (2 stop bits) is used instead
Response time for subsequent Modbus ASCII character, ms0 – 60 0001 000It is used in case of data transfer via RS-485 in Modbus ASCII mode. If you receive a response, if the next byte of the response was not received within this time interval, then the response waiting is stopped. Waiting is always not less than the transmission time of one character (depends on the transmission speed)464
Connection to the cloud server
Mode of connection to the cloud server0 – 80See Table 7.2 for connection modes.465
Cloud server connection port0 – 6553520502The port to which the party is addressed, making connection between MC251 and the server (see reg. 465)466
Time of waiting for response from the cloud server, s0 – 3 6001200 – the server silence time is not limited;467
1–3600 – max. time of server silence after which the connection will be stopped and must be remade again
Delay time before reconnecting to the cloud server, s0 – 30 00015It is used when connecting to the server. After losing connection to the server, the reconnection will be performed after the specified waiting time468
Unused parameter00Should be 0 for compatibility469 - 473
Cloud server addressCharacter stringmodbus.overvis.comIt is used when connecting to the server, if the server address setting is turned on with text string. Address of the remote server with which the connection is supported.474 - 509
The string of up to 36 characters can be indicated as address. This string should not have any spaces
Protection
Password for setup mode accessCharacter stringspecified on the device labelIt is used to access the configuration mode. The string of 5 to 10 characters in length can be indicated as password. This string should not have any spaces510 – 519
Parameter is not used00It is not used; it should be equal to 0 for compatibility520 – 529
Password for writing permission using incoming SMSCharacter stringspecified on the device labelIt is used to verify the authenticity of incoming SMS with request for record or with acknowledgment of the fault. The string of 3 to 10 characters in length can be specified as password. This string should not have any spaces530 – 539
Password for reading permission using incoming SMSCharacter stringspecified on the device labelIt is used to verify the authenticity of incoming SMS with request for reading or with acknowledgment of the fault. The string of 3 to 10 characters in length can be specified as password. This string should not have any spaces540 – 549
Password for writing permission via Modbus to the other devicesCharacter stringIt is used to access devices connected to the MC251, to request write or control functions that can change the status of these devices. The string up to 10 characters in length can be specified as password. This string should not have any spaces550 – 559
Password for reading permission via ModbusCharacter stringIt is used to access devices connected to the MC251, to request read functions, or to access the MC251 registers, except for registers of version, password, mode and tabs. The string up to 10 characters in length can be indicated as password. This string should not have any spaces560 – 569
Enable the protection mode against writing via SMS0 – 100 – Protection against recording is regulated with help of other parameters (password);570
1 – Blocking of queries via SMS for function of writing
Enable the protec-tion mode against reading via SMS0 – 100 – Protection against reading is regulated with help of other parameters (password);571
1 – Blocking of queries via SMS for function of reading
Enable the protec-tion mode against writing via Modbus0 – 100 – Protection against recording is regulated with help of other parameters (password) or deactivated;572
1 - Blocking of any queries for functions, excepting functions of Modbus 1, 2, 3, 4, 7, 17, 20
Enable the protection mode against reading via Modbus0 – 100 – Protection against reading is regulated with help of other parameters (password) or deactivated;573
1 – Blocking of queries for functions of Modbus 1, 2, 3, 4, 7, 17, 20, excepting reading using function 3 of registers of version, mode and tabs
Parameter is not used00It is not used; it should be equal to 0 for compatibility574
Miscellaneous
Parameter is not used00It is not used; it should be equal to 0 for compatibility575 – 630
Restart time, min5 – 7 200120Used when automatic restart is enabled.631
Automatic restart mode0 – 22It is used when automatic restart is enabled:632
0 – the automatic restart is disabled;
1 – the device is restarted after a specified period of time since the start;
2 – the device is restarted after a specified period of time since the last transmission via Ethernet or GSM networks.
Modbus exception code generated when access is denied0 – 25510 – if the access to Modbus registers is denied, the response to the client is not returned;633
1 – 255 – if you deny access to the client who sent the request, this exception code is returned
Modbus exception code generated when there is no response0 – 255110 – if there is no response from the addressee (Gateway Timeout), the response to the client is not returned;634
1 - 255 – if there is no response from the request recipient, this exception code is returned to the client
Parameter is not used00It is not used; it should be equal to 0 for compatibility635
Modbus exception code generated if there is no connection to query addressee0 – 255100 – If there is no connection to the query addressee (Gateway Path Unavailable), response is not returned to the client;636
1 – 255 – if there is no connection to the query addressee, this exception code is returned to the client
RS-485 transmission mode0 – 200 – Master mode (Modbus Master): RS-485 is used to send queries;637
1 – Slave mode (Modbus Slave): RS-485 is used to receive queries from additional client;
2 – tunnel mode, used to transmit data “as is”, without protocol verification
First Modbus-identifier of RS-4851 – 2551Two parameters define a range of Modbus identifiers used for RS-485.638
In the master mode the queries with addresses in this range (and also the broadcast ones with address 0) are sent via RS-485.
In the slave mode the queries with addresses in this range
(and also the broadcast ones and the queries to MC251 address) are received via RS-485
Last Modbus-identifier of RS-4851 – 255255same as above639
**Connection to the first remote TCP server
IP-address of remote serverIP-address192.168.0.112It is used when enabling redirection of queries to TCP remote server. IP-address of the remote server wherewith connection is maintained640 – 643
Port of the remote server connection0 – 65535502Port of the remote server to which the TCP connection will be established644
Time to wait for response from remote server, ms0 – 60 0001 000It is used during redirection of queries to the remote server. After the query transfer, if the correct response failed to be received within this time interval, response waiting is stopped645
Standby time to repeated connection to the remote server, s0 – 24020It is used during redirection of queries to the remote server. After connection with the server is lost, the repeated connection will be performed after preset standby time646
Remote server connection mode0 – 120See Table 7.3 for connection modes.647
First Modbus-identifier of the remote server1 – 2551It is used during redirection of queries to the remote server.648
Two parameters define the range of Modbus identifiers used on the remote server.
Queries with addresses in this range (and also the broadcast ones with address 0) are sent to the remote Modbus TCP server
Last Modbus-identifier of the remote server1 – 255255same as above649
Parameter is not used00It is not used; it should be equal to 0 for compatibility650 – 699
Daylight saving time
Daylight saving time transition mode0 – 20012See Table 7.4 for transition modes.700
Preset month for transition to day-light saving time1 – 123It is used if you selected the automatic transition to daylight saving time on the specified days. The month when the clock will be set one hour ahead701
Preset week of the month for transition to daylight saving time1 – 1010It is used if you selected the automatic transition to daylight saving time on the specified days. Week of the month when the clock will be set one hour ahead.702
1 – 5 – week of the month, including the part weeks;
other values – the last week of the month
Preset day of the week for transition to daylight saving time1 – 77It is used if you selected the automatic transition to daylight saving time on the specified days. The day of the week when the clock will be set one hour ahead703
Preset hour for transition to day-light saving time0 – 222It is used if you selected the automatic transition to daylight saving time on the specified days. The hour of the day at which the clock will be set one hour ahead704
Preset month to revert to standard time1 – 1210It is used if you selected the automatic transition to daylight saving time on the specified days. The month when the clock will be set one hour back705
Preset week of the month to revert to standard time1 – 1010It is used if you selected the automatic transition to daylight saving time on the specified days. Week of the month when the clock will be set one hour back.706
1 – 5 – week of the month, including the part weeks;
other values – the last week of the month
Preset day of the week to revert to standard time1 – 77It is used if you selected the automatic transition to daylight saving time on the specified days. The day of the week when the clock will be set one hour back707
Preset hour to revert to standard time1 – 233It is used if you selected the automatic transition to daylight saving time on the specified days. The hour of the day at which the clock will be set one hour back708
Sunrises and sunsets calculation
Sun day0 – 310 – official;709
1 – civil;
2 - nautical;
3 - astronomical;
Latitude, degree0 – 8946The absolute value of the latitude710
Latitude, minute0 – 5929711
Latitude, second0 – 5910712
Longitude, degree0 – 17930The absolute value of the longitude713
Longitude, minute0 – 5943714
Longitude, second0 – 5940715
Quadrant0 – 300 – N latitude, E longitude;716
1 – N latitude, W longitude;
2 - S latitude, E longitude;
3 - S latitude, W longitude
Connection to the service servers
NTP server connection mode0 – 400 – clock synchronization with the server is not used;717
1 – to connect to the servers using Ethernet or GSM, preferably via Ethernet;
2 – to connect to the servers using Ethernet or GSM, preferably via GSM;
3 – to connect to the servers only via Ethernet;
4 – to connect to the servers only via GSM
Time period of connection to NTP servers, h1 – 24024It is used if you have enabled synchronization of clocks with the server clock. The time interval over which the server time is received718
Minimum shift of clock for synchronization, s1 – 1802It is used if you have enabled synchronization of clocks with the server clock. The synchronization is performed after receiving the server time, if the difference between the clocks is no less than this value719
Firmware update server connection mode0 – 400 – firmware download is not used;720
1 – to connect to the servers using Ethernet or GSM, preferably via Ethernet;
2 – to connect to the servers using Ethernet or GSM, preferably via GSM;
3 – to connect to the servers only via Ethernet;
4 – to connect to the servers only via GSM
Parameter is not used00Not used, must be equal 0 for compatibility721 – 723
Parameter logging
Minimum supply voltage for safe removal of memory card, mV0 – 24 0009 000If the supply voltage is below the specified value, the memory card will be removed safely. The card can be used again after the supply voltage exceeds the minimum plus 0.5 V.724
0 – do not remove the memory card, including in a case if the supply voltage is unknown
Format for logging parameters in task files0 – 41Used if there is a memory card and logging actions in task files.725
0 – not used
1 – compact file of data bytes;
2 – CSV table with text separator ”;“;
3 – similar 2 with a separator ”,“;
4 – similar to 2 with delimiter - tab character
Maximum limited size of log files, kV0 – 6553565535Used if there is a memory card present, logging actions in task files, and logging is enabled.726
The size of the generated files is limited to the specified size plus 1 kV
Minimum stored period in recorder mode, days0 – 18430Used if there is a memory card present, logging actions in task files, and logging is enabled.727
0-183 – the oldest files (older than the specified number of days ago) can be deleted to write new data;
Other values – old files are saved, new data recording is suspended when the memory card is full
Parameter is not used00Not used, must be equal to 0 for compatibility728 – 739
Abonents
Main abonent phone numberCharacter stringCan be used to send SMS. Up to 20 characters. There can be no spaces in the line740 – 759
Connection to the second remote TCP server
Remote server IP addressIP address192.168.0.113Similar to 640–643760 – 763
Remote server connection port0 – 65535502Similar to 644764
Waiting time for a response from a remote server, ms0 – 60 0001 000Similar to 645765
Waiting time before reconnect-ting to a remote server, ms0 – 24020Similar to 646766
Remote server connection mode0 – 80Similar to 647767
First Modbus identifier of the remote server1 – 2551Similar to 648768
Last Modbus ID of the remote server1 – 255255Similar to 649769
Connection to the third remote TCP server
Remote server IP addressIP address192.168.0.113Similar to 640–643770 – 773
Remote server connection port0 – 65535502Similar to 644774
Waiting time for a response from a remote server, ms0 – 60 0001 000Similar to 645775
Waiting time before reconnect-ting to a remote server, ms0 – 24020Similar to 646776
Remote server connection mode0 – 80Similar to 647777
First Modbus identifier of the remote server1 – 2551Similar to 648778
Last Modbus ID of the remote server1 – 255255Similar to 649779
Parameter not used00Not used, must be 0 for compatibility780 – 799
Preset password for access to the first remote Modbus TCP serverCharacter stringUsed only if connection to a remote server is selected and its ID is set (reg. 730). If a password is set, it will be entered immediately after connecting to the server. Obtained access rights depend on the settings of the remote server. A string up to 10 characters long can be specified as a password. No spaces can be in the string800 – 809
Preset password for access to the second remote Modbus TCP serverCharacter stringSimilar to 800 – 809810 – 819
Preset password for access to the third remote Modbus TCP serverCharacter stringSimilar to 800 – 809820 – 829
Parameter not used00Not used, must be 0 for compatibility830 – 849
Protocol for incoming Ethernet connections0 – 100 – Modbus TCP protocol;850
1 – tunnel mode, used for data transmission “as is”, without protocol verification
Protocol for incoming GSM connections0 – 100 – Modbus TCP protocol;851
1 – tunnel mode, used for data transmission “as is”, without protocol verification
Clock settings 3
Day-light saving time offset, min-1440 – +1440Current gain. It is set during manual transition to the daylight saving time, when selecting the automatic mode it will be adjusted within 5 minutes. The value must be a multiple of 1534817
Time zone offset, min-1440 – +1440120It is used during synchronization of the clock with the server clock. The value must be a multiple of 1534818
Second0 – 59The time is to be set at the clock34819
Minute0 – 5934820
Hour0 – 2334821
Day1 – 3134822
Month1 – 1234823
Year0 – 6553434824
Set the clock0 – 655350It is used to set the clock. When recording to this register with any value, the new clock settings in registers 34817 - 34824 will be set34825

Table 7.1 - RS-485 Byte Formats (Register 461)

ValueFormatDescription
0EVEN1 parity bit, 1 stop bit
1ODD1 parity bit, 1 stop bit
20 (SPACE)1 zero bit, 1 stop bit
31 (MARK)1 unit bit, 1 stop bit (similar to 2 stop bits)
4ABSENTNo parity bit, 1 stop bit
5AUTO-STOPNo parity bit, 2 stop bits (tx), 1 stop bit (rx)

Table 7.2 - Cloud Server Connection Modes (Register 465)

ValueDescription
0Connection to server is not used
1Connect via any interface (prefer Ethernet)
2Connect via any interface (prefer GSM)
3Connect only via Ethernet
4Connect only via GSM
5Connect to VPN server via any interface (prefer Ethernet)
6Connect to VPN server via any interface (prefer GSM)
7Connect to VPN server only via Ethernet
8Connect to VPN server only via GSM

Table 7.3 - Remote Server Connection Modes (Register 647)

ValueDescription
0TCP remote server is not used
1Connect via Ethernet or GSM (prefer Ethernet)
2Connect via Ethernet or GSM (prefer GSM)
3Connect only via Ethernet
4Connect only via GSM
5Similar to 1 with virtual identifiers 4
6Similar to 2 with virtual identifiers 4
7Similar to 3 with virtual identifiers 4
8Similar to 4 with virtual identifiers 4
9Similar to 1 in tunnel mode
10Similar to 2 in tunnel mode
11Similar to 3 in tunnel mode
12Similar to 4 in tunnel mode

Table 7.4 - Daylight Saving Time Transition Modes (Register 700)

ValueCountry/Mode
0Automatic transition not used (manual setting)
1Brazil
2Great Britain
3Germany
4Greece
5Jordan
6Italy
7Namibia
8Poland
9Portugal
10USA
11Turkey
12Ukraine
13Finland
14France
15According to preset days

Q: What is the default Modbus TCP port and device address?

A: MC251 listens on TCP port 502 (configurable in register 450) and uses Modbus address 111 by default (configurable in register 457). You can view the current IP address by pressing the R button on the device.

Q: How do I enter Setup Mode to change configuration?

A: Write the password (found on the device label) to registers 100-119. If correct, register 121 will read 1 (Setup Mode). You can then modify settings in the Changeable Settings registers (300-899).

Q: I have saved the new settings, how do I restart MC251 remotely?

A: Write command 1 to register 120 to restart. MC251 will reboot and usually be available again in half a minute. You may need to reconnect then.

Q: How do I save my configuration changes?

A: Write command 2 to register 120 to save (then restart MC251 for the changes to take effect), or 4 to save and apply immediately (only for Modbus settings). Write 9 to cancel unsaved changes.

Q: How do I configure RS-485 communication parameters?

A: Key registers are:

  • 458-459: Baud rate (default 9600)
  • 461: Byte format/parity (see Table 7.1)
  • 463: Protocol mode (0=RTU, 1=ASCII)
  • 637: Transmission mode (0=Master, 1=Slave, 2=Tunnel)

Q: What is the difference between Master and Slave RS-485 modes?

A: In Modbus Master mode (default), MC251 sends queries to RS-485 devices. In Modbus Slave mode, MC251 receives queries from an external Modbus Master on RS-485. Use Slave mode when MC251 should act as a slave device on an existing RS-485 network.

**Q: I have configured RS-485 and set MC251 modbus device ID parameter to match my RS-485 device address. But I still get errors like Illegal address.

A: This can happen because MC251 (configured this way) reads its own virtual Modbus device registers instead of redirecting the requests to your RS-485 device. Do not set virtual Modbus ID in the Modbus server parameters to any of your devices addresses. However, reading registers of any device with ID other than this virtual ID (111 by default) should work.

Q: How can I connect the RS-485 device if its protocol differs from Modbus?

A: Select Tunnel mode for RS-485. You may also need to select the tunnel for either the MC251 server or one of the remote servers connections.

Q: How do I send Modbus commands via SMS?

A: Format: [Password] [R/W][DeviceID][H/I/D/C][Address] [Value]. Example: abc r1h100 reads holding register 100 from device 1 (password “abc”). The response SMS contains the request command without the password, and result data or error code.

Q: How do I set the device clock via Modbus?

A: First, write command 35381 to register 120 to enter Clock Setting Mode. Then write time values to registers 34819-34824 (second, minute, hour, day, month, year). Finally, write any value to register 34825 to apply. Write command 35431 to register 120 to cancel.

Q: How can I connect MC251 to multiple remote Modbus TCP servers?

A: MC251 supports up to 3 remote TCP servers. Configure each in registers 640-649 (first), 760-769 (second), and 770-779 (third). The main parameters are the connection mode and the server IP address. Also, set Modbus ID range for each server to avoid extra traffic and delays.

Q: What does the “virtual identifiers” option do for remote servers?

A: When enabled (register 647 for the first remote server, values 5-8), MC251 remaps Modbus addresses before forwarding. The range is renumbered starting from 1. For example, if range is 15-17, address 16 becomes 2 on the remote server. This helps to avoid address conflicts, when multiple gateways share address space, or when multiple Modbus TCP devices of the same model are connected.

Q: How do I reset the device to factory defaults?

A: Enter Setup Mode by writing the password, then write command 444 to register 120. All settings will be reset to factory defaults, including passwords. Restart MC251 for the changes to take effect.

Q: Why can’t I read certain status registers?

A: Some registers (like GSM IP address, register 900-903) are only available after the authentication. Enter the password first. Also, the clock setting registers (34817-34825) require Clock Setting Mode.

Q: How do I check the current firmware version?

A: Read register 1 for the firmware version number.

For technical support and assistance:

  1. The IP address of the device in the GSM network is commonly a dynamic one. To access the device via GSM using its IP address, please contact the GSM operator. 2

  2. The content of these registers is available only in Setting Mode. 2

  3. Registers for clock setting are available only in Clock Setting Mode (see registers 120, 122).

  4. In virtual identifier mode, before forwarding the request to the remote server, the virtual identifier of the addressee in the request is replaced by the real one so that numbering in the server range starts from 1. For example, for the range 15-17, virtual identifier 16 will be replaced with real 2. Broadcast identifier 0 is processed without changes. 2 3 4