Modbus Interface Reference
Цей контент ще не доступний вашою мовою.
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.
Request Processing
Section titled “Request Processing”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-485indicator 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.
- RS-485 Master Mode: Requests for other devices are converted (Modbus TCP/RTU/ASCII) and redirected to the RS-485 bus. The
If a valid response is received, the MC251 forwards it back to the client.
Troubleshooting
Section titled “Troubleshooting”- 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,Administrationtab 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 theModbus Mastermode is configured (if the target should be requested using Modbus RTU/ASCII). Check the Modbus address ranges on MC251Modbussettings 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 MC251Modbustab 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.
SMS Modbus Access
Section titled “SMS Modbus Access”With an active SIM card, the MC251 can process Modbus requests via SMS.
SMS Format
Section titled “SMS Format”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) orW(Write, FC 5-6). - DeviceID: Modbus address of the target device.
- Resource:
H: Holding RegistersI: Input RegistersD: Discrete InputsC: 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”)
SMS Responses
Section titled “SMS Responses”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).
- Example:
- 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).
- Example:
Table 1 - Standard Modbus Exception Codes
| Code | Exception | Description |
|---|---|---|
| 1 | ILLEGAL FUNCTION | The received function code cannot be processed |
| 2 | ILLEGAL DATA ADDRESS | The data address specified in the request is not available |
| 3 | ILLEGAL DATA VALUE | The value contained in the request data field is invalid value |
| 4 | DEVICE FAILURE | Unrecoverable error has occurred when the addressee has tried to perform the requested action |
| 5 | ACKNOWLEDGE | The addressee accepted the request and processed it, but it takes a long time |
| 6 | DEVICE BUSY | The addressee is busy processing the command. The client can retry the request later |
| 8 | MEMORY PARITY ERROR | The parity error was detected when the addressee has tried to read the extended memory |
| 10 | GATEWAY PATHS NOT AVAILABLE | The gateway cannot redirect the request, since there is no path (connection) to the addressee |
| 11 | TARGET DEVICE FAILED TO RESPOND TO GATEWAY | The gateway did not receive a response to the forwarded request, because the addressee did not respond in time |
Configuration via Modbus
Section titled “Configuration via Modbus”The MC251 can be configured using any Modbus TCP client.
- Connect: Use the MC251’s IP address (press
Rbutton on device to view) and Modbus ID (default111). - Enter Password: Write the password (default on device label) into the password registers (see Current Mode Parameters).
- Verify Mode: If the password is correct, the Mode register will read
1(Setup Mode).
Managing Settings
Section titled “Managing Settings”In Setup Mode, you can modify the Changeable Settings registers.
- Save Changes: Write
2to the Command Register. Verify by comparing changeable parameters with saved parameters. - Save & Apply: Write
4to the Command Register. Applies Modbus parameters immediately without restart. - Cancel Changes: Write
9to the Command Register. Reverts changeable parameters to saved values. - Factory Reset: Write
444to the Command Register. Resets all settings to defaults. - Restart Device: Write
1to the Command Register. Required for some settings to take effect. - Exit Setup Mode: Write
0to the first password register (100). This clears the password and command registers.
MC251 Parameters
Section titled “MC251 Parameters”Table 2 - Parameter Data Formats
| Parameter | Range of values | Description | Number of occupied registers |
|---|---|---|---|
| Number | 0 – 65535 | Integer number (16 bit) in standard range of Modbus register values | 1 |
| Number | -32768 – +32767 | Integer number (16 bit) in complementary arithmetic | 1 |
| Number | 0 – 4294967295 in two registers, MSB part – first | Integer number, which value can exceed the limit for Modbus register (65535) | 2 |
| Number | -2147483648 – +2147483647 in two registers, the MSB part is the first | Integer number (32 bit) in complementary arithmetic | 2 |
| Character string | In 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 right | 4 |
| MAC-address | In every register – one byte (0 – 255) | Set of six byte of address MAC-48, from left to right | 6 |
Table 3 - Parameter Groups
| Group | Description | Access | Address |
|---|---|---|---|
| Device description | Device and firmware identification | Any mode, read only | 0 – 3 |
| Current mode | Access and general commands controls | Password entry is available in any mode, command entry - only in setup mode (after password entry) | 100 – 120 |
| Current status | Interfaces and software modules operation, current time and statistics | Any mode, read only | 121 – 295, 900 – 944, 2000–2023 |
| Changeable settings | Interfaces and features selection and configuration | Only in setup mode, reading or writing | 300 – 899, |
| Active settings | The configuration being used by the device at the moment | In any mode, read only | 2300 – 2899, |
| Saved settings | This set is saved regardless the power of the device and is used at restart | Only in mode of setting, read only | 3300 – 3899, |
| Clock setting | See Table 5.8. | Only in clock setting mode, for reading or writing | 34817 – 34825 |
Device Description Parameters
Section titled “Device Description Parameters”Table 4 - Device Description Parameters
| Parameter | Description | Address |
|---|---|---|
| Device type | The code that defines the Modbus device for the manufacturer (47 – MC251) | 0 |
| Firmware version | Firmware version of embedded software | 1 |
| Check code | CRC32 of firmware of embedded software | 2 – 3 |
Current Mode Parameters
Section titled “Current Mode Parameters”Table 5 - Current Mode Parameters
| Parameter | Range of values | Initial value | Description | Address |
|---|---|---|---|---|
| Entered password | String of characters | 0 | When 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 command | 0 – 65397, writing in the configuration mode | 0 | See Table 5.1 for the list of commands. | 120 |
Table 5.1 - Control Commands (Register 120)
| Value | Command | Description |
|---|---|---|
| 0 | No activity | No action performed |
| 1 | Restart | Restart the MC251 device |
| 2 | Save | Save settings changes via Modbus |
| 3 | Apply | Apply settings without restarting (Modbus parameters only) |
| 4 | Save and apply | Execute “Save” then “Apply” commands |
| 6 | Export | Save settings to a file on the memory card (see Memory card) |
| 7 | Import | Read settings from a file on the memory card and save them |
| 9 | Cancel | Revert to saved settings |
| 51 | Apply for Modbus | Apply settings via Modbus and RS-485 |
| 81 | Synchronize clock | Synchronize clock with NTP server |
| 161 | Test SMS | Send a test SMS to the main subscriber number |
| 444 | Factory Reset | Reset settings to factory defaults |
| 35381 | Start clock setting | Allow access to clock setting registers |
| 35431 | Cancel clock setting | Close access to clock setting registers without changes |
| 40959 | Update task memory | Erase the logic program (re-read if memory card is inserted) |
| 64893 | Download Updates | Download latest firmware from cloud to MC251FW2.FUS |
| 65397 | Update Firmware | Program firmware from file MC251FW2.FUS |
Current Status Parameters
Section titled “Current Status Parameters”Table 6 - Current Status Parameters
| Parameter | Description | Address |
|---|---|---|
| Mode (for details see reg. 122) | 0: User’s mode; | 121 |
| 1: Setting mode | ||
| Tabs of access | See Table 6.1 for the list of access bits. | 122 |
| Time, min | Number of minutes since the moment of start-up | 123 – 124 |
| Number of TCP clients | Number of occupied connections of TCP | 125 |
| Limit of TCP clients | Number of prospective clients of TCP | 126 |
| Load of RS-485, query/s | Total number of query/s via RS-485 | 127 |
| Effective load of RS-485, query/s | Number of responds without errors via RS-485 per second | 128 |
| Load of RS-485 per second, % | Load of RS-485 for the last second considering the set rate of RS-485 and time of inactivity | 129 |
| 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 minutes | 131 |
| Load of Modbus TCP, query/s | The number of queries received from clients via Modbus TCP per second | 132 |
| Effective load of Modbus TCP, query/s | Number of responds without errors being sent to the client via Modbus TCP per second | 133 |
| Load of GSM, kB/s | Load of wireless channel with GSM being switched on | 134 |
| Load of Ethernet,100 kB/s | Load of wire channel with Ethernet being switched on | 135 |
| Max. number of clients of TCP | Maximal number of simultaneously connected clients via TCP – from the moment of start up | 136 |
| Max. load of Modbus TCP, query/s | Maximal number of queries received per second from the clients via Modbus TCP – from the moment of start up | 137 |
| Max. load of RS-485, % | Maximal load of RS-485 for 5 minutes – from the moment of start up | 138 |
| Max. load of GSM, kB/s | Maximal load of GPRS/LTE – from the moment of start up | 139 |
| Current IP-address of Ethernet | IP-address, by which MC251 device is accessible in Ethernet network1 | 140 – 143 |
| Current MAC-address of Ethernet | MAC-address, by which MC251 is detected in Ethernet network | 144 – 149 |
| Unused parameter | The parameter is reserved for compatibility | 150 – 164 |
| Time to connect to the data collection server | 0 – 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 restarts | Number of restarts in accordance to the user setting – for total operational time | 166 |
| Number of critical errors | Number of noted errors (failures) causing the restart of the device – for total operational time | 167 |
| Total operation time, min | The number of minutes of operating time - for the total operational time | 168 – 169 |
| Current time | Number of seconds since 1st of January of specified year (see reg. 172) | 170 – 171 |
| Year of countdown | Year, since 1st of January which is taken for time counting | 172 |
| Time zone, min | Time zone, for the time count, number of minutes with sign as to UTC+00 | 173 |
| Temperature, °C | Temperature inside MC251 | 174 |
| Power voltage, mV | Bus voltage of 12 V | 175 |
| Time to connect to the first remote TCP server, s | 0 – 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 used | 176 | |
| Interface for connecting to the first remote TCP server | 0 – the connection is not set; | 177 |
| 1 – Ethernet connection is set; | ||
| 2 – GSM connection is set | ||
| DST increment, min | Effective day saving time increment | 178 |
| Unused parameter | The parameter is reserved for compatibility | 179 – 209 |
| IP-address of client 1 | IP-address of client, 0.0.0.0 – not connected | 180 – 183 |
| Port of client 1 | Port of client, 0 – not connected | 184 |
| IP-address of client 2 | IP-address of client, 0.0.0.0 – not connected | 185 – 188 |
| Port of client 2 | Port of client, 0 – not connected | 189 |
| IP-address of client 3 | IP-address of client, 0.0.0.0 – not connected | 190 – 193 |
| Port of client 3 | Port of client, 0 – not connected | 194 |
| IP-address of client 4 | IP-address of client, 0.0.0.0 – not connected | 195 – 198 |
| Port of client 4 | Port of client, 0 – not connected | 199 |
| Unused parameter | The parameter is reserved for compatibility and is equal to 0 | 200 – 209 |
| Year (current time) | Current year | 210 |
| Month (current time) | Current month | 211 |
| Day of the month (current time) | Current day of the month | 212 |
| Hour (current time) | Current hour | 213 |
| Minute (current time) | Current minute | 214 |
| Second (current time) | Current second | 215 |
| Day of week (current time) | Current day of week (1 – Monday) | 216 |
| Month (winter time) | Current month, excluding summer time | 217 |
| Day of the month (winter time) | Current day of the month, excluding summer time | 218 |
| Hour (winter time) | Current hour, excluding summer time | 219 |
| Unused parameter | The parameter is reserved for compatibility | 220 – 229 |
| Time of day, s | Number of seconds from midnight of the current day | 230 – 231 |
| Time of sunrise, s | 0 – 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, ms | Number of milliseconds from midnight of the current day | 236 – 237 |
| Memory card occupancy, 0.01% | 10000 – memory card is missing or full | 238 |
| Estimated time spent on 1% of the memory card, days | 0 – 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, s | Similar to register 176 | 240 |
| Connection interface to the second remote TCP server | Similar to register 177 | 241 |
| Time before connection to the third remote TCP server, s | Similar to register 176 | 242 |
| Connection interface to the third remote TCP server | Similar to register 177 | 243 |
| Current IP-address of GSM2 | IP-address obtained from GPRS1 provider | 900 – 903 |
| Unused parameter | The parameter is reserved for compatibility | 904 – 914 |
| GSM signal level, %2 | Signal level and quality of radio communication with GSM provider | 915 |
| Unused parameter | The parameter is reserved for compatibility | 916 – 940 |
| Memory card capacity, kB | 0 – card missing or unformatted in FAT / FAT32 | 941 – 942 |
| The amount of data that has not been written to the memory card since the start, bytes | 0 – there were no data record losses | 943 - 944 |
| 4294967295 – more than 4 GB losses | ||
| Firmware Download Status Bits | See 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 number | The number of the tasks correctly loaded into the internal memory | 2020 |
| Code of the first illegal logic task error | The code of the first error met in the first taskfile that could not be loaded | 2021 |
| Line number of the first illegal logic task error | The line number where the first error was met in the first taskfile that could not be loaded | 2022 |
| Loaded programming logic tasks memory usage, bytes | The amount of RAM reserved for the programming logic tasks execution | 2023 |
| Firmware File Header | The 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)
| Bit | Description | Value 0 | Value 1 |
|---|---|---|---|
| 0 | Permission to obtain RS-485 reading rights (via password) | Cannot be obtained | Can be obtained |
| 1 | Current RS-485 reading permission | No permission | Permission granted |
| 2 | Permission to obtain RS-485 write/control rights (via password) | Cannot be obtained | Can be obtained |
| 3 | Current RS-485 write/control permission | No permission | Permission granted |
| 4 | Permission to obtain MC251 register access (via password) | Cannot be obtained | Can be obtained |
| 5 | Current MC251 register access permission | No permission | Permission granted |
| 6 | Reserved | - | Always 1 |
| 7 | Permission to configure MC251 | No permission | Permission granted |
| 8 | Reserved | Always 0 | - |
| 9 | Connection right | - | Client has right (Always 1) |
| 12 | Permission to set the clock | No permission | Permission granted |
Table 6.2 - Firmware Download Status Bits (Register 2004)
| Bit | Status | Value 0 | Value 1 |
|---|---|---|---|
| 1 | Busy Status | Waiting for command | File download in progress |
| 2 | Update Download Error | No error | Download error occurred |
| 3 | Server Connection | No connection | Connected to server |
| 4 | File Data Reception | No data received | File data received |
| 6 | File Download Completion | File not downloaded | File fully downloaded |
| 7 | File Validity | Not confirmed | File is valid |
Settings Parameters
Section titled “Settings Parameters”Table 7 - Settings Parameters
| Parameter | Range of values | Factory setting | Description | Address |
|---|---|---|---|---|
| Ethernet network | ||||
| Static IP-address | IP-address | 192.168.0.111 | If the dynamic addressing is switched off or not available, IP-address of the device in Ethernet network is equal to this value | 300 – 303 |
| Subnetwork mask | IP-mask | 255.255.255.0 | It is used only with static IP-address | 304 – 307 |
| Gateway | IP-address | 192.168.0.1 | It is used only together with static IP-address for communication with other networks, or as an address of DNS/DHCP servers | 308 – 311 |
| Switch on the dynamic addressing with a help of DHCP | 0 – 1 | 1 | 0 – 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 parameter | 0 | 0 | Should be 0 for compatibility | 313 |
| Switch on the use of server gateway DNS | 0 – 1 | 1 | It 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 server | IP-address | 8.8.8.8 | It 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 server | IP-address | 0.0.0.0 | It is used if DHCP is not available (switched off); | 319 – 322 |
| 0.0.0.0 – it is not used | ||||
| Unused parameter | 0 | 0 | Should be 0 for compatibility | 323 - 329 |
| GSM network | ||||
| PIN-code of SIM-card | 0 – 65535 | 65535 | 0 – 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 APN | 0 – 1 | 1 | 0 – connection is established by manually specified APN parameters; | 331 |
| 1 – APN is automatically determined for the operator by SIM card ICCID code | ||||
| Enable roaming exchange | 0 – 1 | 1 | 0: GPRS/LTE is blocked in roaming; | 332 |
| 1: GPRS/LTE may be used in roaming | ||||
| Activate SMS in roaming | 0 – 1 | 0 | 0 – SMS can be only received in roaming; | 333 |
| 1 – SMS can be received and sent in roaming | ||||
| Connection port via GSM | 0 – 65535 | 0 | It 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 used | 0 | 0 | It is not used; it should be equal to 0 for compatibility | 335 – 351 |
| APN log-in of GPRS/LTE service | Character string | Provided by the GSM service provider; up to 40 characters | 352 – 391 | |
| APN password of GPRS/LTE service | Character string | Provided by the GSM service provider; up to 24 characters | 392 – 415 | |
| APN address of host | Character string | Provided by the GSM service provider; up to 34 characters; there cannot be spaces in a string | 416 – 449 | |
| TCP Server | ||||
| Connection port via Ethernet | 1 – 65535 | 502 | It is used for external connection to MC251 via Ethernet for exchange via Modbus TCP protocol or in tunnel mode | 450 |
| Disconnect inactive clients | 0 – 1 | 1 | 0 – 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, s | 0 – 600 000 | 90 | Used if disconnection of inactive clients is selected | 452 – 453 |
| Unused parameter | 0 | 0 | Should be 0 for compatibility | 454 - 456 |
| Own Modbus-identifier of MC251 | 0 – 247 | 111 | 0 – 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/sec | 75 – 230 400 | 9 600 | It 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 cable | 458 – 459 |
| Quotient for Modbus RTU silence time between frames | 0 – 5 | 1 | It 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-485 | 0 – 5 | 5 | It 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, ms | 0 – 60 000 | 200 | It 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 frames | 462 |
| Enable ASCII exchange mode in Modbus network | 0 – 1 | 0 | Exchange 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, ms | 0 – 60 000 | 1 000 | It 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 server | 0 – 8 | 0 | See Table 7.2 for connection modes. | 465 |
| Cloud server connection port | 0 – 65535 | 20502 | The 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, s | 0 – 3 600 | 120 | 0 – 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, s | 0 – 30 000 | 15 | It is used when connecting to the server. After losing connection to the server, the reconnection will be performed after the specified waiting time | 468 |
| Unused parameter | 0 | 0 | Should be 0 for compatibility | 469 - 473 |
| Cloud server address | Character string | modbus.overvis.com | It 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 access | Character string | specified on the device label | It 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 spaces | 510 – 519 |
| Parameter is not used | 0 | 0 | It is not used; it should be equal to 0 for compatibility | 520 – 529 |
| Password for writing permission using incoming SMS | Character string | specified on the device label | It 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 spaces | 530 – 539 |
| Password for reading permission using incoming SMS | Character string | specified on the device label | It 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 spaces | 540 – 549 |
| Password for writing permission via Modbus to the other devices | Character string | It 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 spaces | 550 – 559 | |
| Password for reading permission via Modbus | Character string | It 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 spaces | 560 – 569 | |
| Enable the protection mode against writing via SMS | 0 – 1 | 0 | 0 – 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 SMS | 0 – 1 | 0 | 0 – 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 Modbus | 0 – 1 | 0 | 0 – 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 Modbus | 0 – 1 | 0 | 0 – 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 used | 0 | 0 | It is not used; it should be equal to 0 for compatibility | 574 |
| Miscellaneous | ||||
| Parameter is not used | 0 | 0 | It is not used; it should be equal to 0 for compatibility | 575 – 630 |
| Restart time, min | 5 – 7 200 | 120 | Used when automatic restart is enabled. | 631 |
| Automatic restart mode | 0 – 2 | 2 | It 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 denied | 0 – 255 | 1 | 0 – 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 response | 0 – 255 | 11 | 0 – 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 used | 0 | 0 | It is not used; it should be equal to 0 for compatibility | 635 |
| Modbus exception code generated if there is no connection to query addressee | 0 – 255 | 10 | 0 – 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 mode | 0 – 2 | 0 | 0 – 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-485 | 1 – 255 | 1 | Two 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-485 | 1 – 255 | 255 | same as above | 639 |
| **Connection to the first remote TCP server | ||||
| IP-address of remote server | IP-address | 192.168.0.112 | It is used when enabling redirection of queries to TCP remote server. IP-address of the remote server wherewith connection is maintained | 640 – 643 |
| Port of the remote server connection | 0 – 65535 | 502 | Port of the remote server to which the TCP connection will be established | 644 |
| Time to wait for response from remote server, ms | 0 – 60 000 | 1 000 | It 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 stopped | 645 |
| Standby time to repeated connection to the remote server, s | 0 – 240 | 20 | It 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 time | 646 |
| Remote server connection mode | 0 – 12 | 0 | See Table 7.3 for connection modes. | 647 |
| First Modbus-identifier of the remote server | 1 – 255 | 1 | It 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 server | 1 – 255 | 255 | same as above | 649 |
| Parameter is not used | 0 | 0 | It is not used; it should be equal to 0 for compatibility | 650 – 699 |
| Daylight saving time | ||||
| Daylight saving time transition mode | 0 – 200 | 12 | See Table 7.4 for transition modes. | 700 |
| Preset month for transition to day-light saving time | 1 – 12 | 3 | It 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 ahead | 701 |
| Preset week of the month for transition to daylight saving time | 1 – 10 | 10 | It 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 time | 1 – 7 | 7 | It 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 ahead | 703 |
| Preset hour for transition to day-light saving time | 0 – 22 | 2 | It 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 ahead | 704 |
| Preset month to revert to standard time | 1 – 12 | 10 | It 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 back | 705 |
| Preset week of the month to revert to standard time | 1 – 10 | 10 | It 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 time | 1 – 7 | 7 | It 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 back | 707 |
| Preset hour to revert to standard time | 1 – 23 | 3 | It 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 back | 708 |
| Sunrises and sunsets calculation | ||||
| Sun day | 0 – 3 | 1 | 0 – official; | 709 |
| 1 – civil; | ||||
| 2 - nautical; | ||||
| 3 - astronomical; | ||||
| Latitude, degree | 0 – 89 | 46 | The absolute value of the latitude | 710 |
| Latitude, minute | 0 – 59 | 29 | 711 | |
| Latitude, second | 0 – 59 | 10 | 712 | |
| Longitude, degree | 0 – 179 | 30 | The absolute value of the longitude | 713 |
| Longitude, minute | 0 – 59 | 43 | 714 | |
| Longitude, second | 0 – 59 | 40 | 715 | |
| Quadrant | 0 – 3 | 0 | 0 – 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 mode | 0 – 4 | 0 | 0 – 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, h | 1 – 240 | 24 | It is used if you have enabled synchronization of clocks with the server clock. The time interval over which the server time is received | 718 |
| Minimum shift of clock for synchronization, s | 1 – 180 | 2 | It 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 value | 719 |
| Firmware update server connection mode | 0 – 4 | 0 | 0 – 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 used | 0 | 0 | Not used, must be equal 0 for compatibility | 721 – 723 |
| Parameter logging | ||||
| Minimum supply voltage for safe removal of memory card, mV | 0 – 24 000 | 9 000 | If 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 files | 0 – 4 | 1 | Used 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, kV | 0 – 65535 | 65535 | Used 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, days | 0 – 184 | 30 | Used 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 used | 0 | 0 | Not used, must be equal to 0 for compatibility | 728 – 739 |
| Abonents | ||||
| Main abonent phone number | Character string | Can be used to send SMS. Up to 20 characters. There can be no spaces in the line | 740 – 759 | |
| Connection to the second remote TCP server | ||||
| Remote server IP address | IP address | 192.168.0.113 | Similar to 640–643 | 760 – 763 |
| Remote server connection port | 0 – 65535 | 502 | Similar to 644 | 764 |
| Waiting time for a response from a remote server, ms | 0 – 60 000 | 1 000 | Similar to 645 | 765 |
| Waiting time before reconnect-ting to a remote server, ms | 0 – 240 | 20 | Similar to 646 | 766 |
| Remote server connection mode | 0 – 8 | 0 | Similar to 647 | 767 |
| First Modbus identifier of the remote server | 1 – 255 | 1 | Similar to 648 | 768 |
| Last Modbus ID of the remote server | 1 – 255 | 255 | Similar to 649 | 769 |
| Connection to the third remote TCP server | ||||
| Remote server IP address | IP address | 192.168.0.113 | Similar to 640–643 | 770 – 773 |
| Remote server connection port | 0 – 65535 | 502 | Similar to 644 | 774 |
| Waiting time for a response from a remote server, ms | 0 – 60 000 | 1 000 | Similar to 645 | 775 |
| Waiting time before reconnect-ting to a remote server, ms | 0 – 240 | 20 | Similar to 646 | 776 |
| Remote server connection mode | 0 – 8 | 0 | Similar to 647 | 777 |
| First Modbus identifier of the remote server | 1 – 255 | 1 | Similar to 648 | 778 |
| Last Modbus ID of the remote server | 1 – 255 | 255 | Similar to 649 | 779 |
| Parameter not used | 0 | 0 | Not used, must be 0 for compatibility | 780 – 799 |
| Preset password for access to the first remote Modbus TCP server | Character string | Used 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 string | 800 – 809 | |
| Preset password for access to the second remote Modbus TCP server | Character string | Similar to 800 – 809 | 810 – 819 | |
| Preset password for access to the third remote Modbus TCP server | Character string | Similar to 800 – 809 | 820 – 829 | |
| Parameter not used | 0 | 0 | Not used, must be 0 for compatibility | 830 – 849 |
| Protocol for incoming Ethernet connections | 0 – 1 | 0 | 0 – Modbus TCP protocol; | 850 |
| 1 – tunnel mode, used for data transmission “as is”, without protocol verification | ||||
| Protocol for incoming GSM connections | 0 – 1 | 0 | 0 – 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 – +1440 | Current 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 15 | 34817 | |
| Time zone offset, min | -1440 – +1440 | 120 | It is used during synchronization of the clock with the server clock. The value must be a multiple of 15 | 34818 |
| Second | 0 – 59 | The time is to be set at the clock | 34819 | |
| Minute | 0 – 59 | 34820 | ||
| Hour | 0 – 23 | 34821 | ||
| Day | 1 – 31 | 34822 | ||
| Month | 1 – 12 | 34823 | ||
| Year | 0 – 65534 | 34824 | ||
| Set the clock | 0 – 65535 | 0 | It is used to set the clock. When recording to this register with any value, the new clock settings in registers 34817 - 34824 will be set | 34825 |
Table 7.1 - RS-485 Byte Formats (Register 461)
| Value | Format | Description |
|---|---|---|
| 0 | EVEN | 1 parity bit, 1 stop bit |
| 1 | ODD | 1 parity bit, 1 stop bit |
| 2 | 0 (SPACE) | 1 zero bit, 1 stop bit |
| 3 | 1 (MARK) | 1 unit bit, 1 stop bit (similar to 2 stop bits) |
| 4 | ABSENT | No parity bit, 1 stop bit |
| 5 | AUTO-STOP | No parity bit, 2 stop bits (tx), 1 stop bit (rx) |
Table 7.2 - Cloud Server Connection Modes (Register 465)
| Value | Description |
|---|---|
| 0 | Connection to server is not used |
| 1 | Connect via any interface (prefer Ethernet) |
| 2 | Connect via any interface (prefer GSM) |
| 3 | Connect only via Ethernet |
| 4 | Connect only via GSM |
| 5 | Connect to VPN server via any interface (prefer Ethernet) |
| 6 | Connect to VPN server via any interface (prefer GSM) |
| 7 | Connect to VPN server only via Ethernet |
| 8 | Connect to VPN server only via GSM |
Table 7.3 - Remote Server Connection Modes (Register 647)
| Value | Description |
|---|---|
| 0 | TCP remote server is not used |
| 1 | Connect via Ethernet or GSM (prefer Ethernet) |
| 2 | Connect via Ethernet or GSM (prefer GSM) |
| 3 | Connect only via Ethernet |
| 4 | Connect only via GSM |
| 5 | Similar to 1 with virtual identifiers 4 |
| 6 | Similar to 2 with virtual identifiers 4 |
| 7 | Similar to 3 with virtual identifiers 4 |
| 8 | Similar to 4 with virtual identifiers 4 |
| 9 | Similar to 1 in tunnel mode |
| 10 | Similar to 2 in tunnel mode |
| 11 | Similar to 3 in tunnel mode |
| 12 | Similar to 4 in tunnel mode |
Table 7.4 - Daylight Saving Time Transition Modes (Register 700)
| Value | Country/Mode |
|---|---|
| 0 | Automatic transition not used (manual setting) |
| 1 | Brazil |
| 2 | Great Britain |
| 3 | Germany |
| 4 | Greece |
| 5 | Jordan |
| 6 | Italy |
| 7 | Namibia |
| 8 | Poland |
| 9 | Portugal |
| 10 | USA |
| 11 | Turkey |
| 12 | Ukraine |
| 13 | Finland |
| 14 | France |
| 15 | According 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.
Need Help?
Section titled “Need Help?”For technical support and assistance:
- Email: support@overvis.com
- Support portal: www.overvis.com/support
Footnotes
Section titled “Footnotes”-
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
-
The content of these registers is available only in Setting Mode. ↩ ↩2
-
Registers for clock setting are available only in Clock Setting Mode (see registers 120, 122). ↩
-
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