Перейти до вмісту

Modbus Interface Reference

Цей контент ще не доступний вашою мовою.

The EM-482 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 EM-482 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 EM-482 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 EM-482 sends back a Modbus exception (default code 1).
  • Internal Requests: If the request addresses the EM-482 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 a remote Modbus TCP server via Ethernet or GSM/LTE.

If a valid response is received, the EM-482 forwards it back to the client.

  • Exception Illegal Function (Code 1) is returned for a request: Sent either by EM-482 (if insufficient rights for the request) or by the target device (if the request unsupported). Check the EM-482 settings (Protection group) for protection settings. Send the correct password to the EM-482 before using this request. Try allowing these requests, or try some other request.
  • 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 in EM-482 settings for the redirection destinations.
  • 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 EM-482 configuration for RS-485 (baudrate and parity in particular). 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.

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 EM-482 can be configured using any Modbus TCP client.

  1. Connect: Use the EM-482’s IP address (configured manually or provided by the Wi-Fi access point, see its corresponding manual on how to check the address) and Modbus ID (default 111).
  2. Enter Password: Write the password (default setup access password is in the parameter list, Protection group ) 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
Number0 – 4294967295 in two registers, MSB part – firstInteger number, which value can exceed the limit for Modbus register (65535)2
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 – 177, 2000–2005
Changeable settingsInterfaces and features selection and configurationOnly in setup mode, reading or writing300 – 899, 5250 – 5499
Active settingsThe configuration being used by the device at the momentIn any mode, read only2300 – 2899, 5500 – 5749
Saved settingsThis set is saved regardless the power of the device and is used at restartOnly in mode of setting, read only3300 – 3899, 5750 – 5999

Table 4 - Device Description Parameters

ParameterDescriptionAddress
Device typeThe code that defines the Modbus device for the manufacturer (31 – EM-482)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 510 - 569)100 – 119
When you enter an empty string, the client rights are reset to the rights level at the time of connection
Control command0 – 65407, 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 EM-482 device
2SaveSave settings changes via Modbus
3ApplyApply settings without restarting (Modbus and user’s parameters only)
4Save and applyExecute “Save” then “Apply” commands
9CancelRevert to saved settings
51Apply for ModbusApply settings for Modbus and RS-485 only
59Apply for User’sApply settings for user’s custom registers only
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 the loaded file
65397Update FirmwareProgram firmware from the loaded file
65407Revert FirmwareReturn to the factory firmware file

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 minute130
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 Wi-Fi, kB/sLoad of Wi-Fi channel134
Unused parameterThe parameter is reserved for compatibility135
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 Wi-Fi, kB/sMaximal load of Wi-Fi – from the moment of start up139
Current IP-address of Wi-FiIP-address, by which EM-482 device is accessible in the network140 – 143
Current MAC-address of Wi-FiMAC-address, by which EM-482 is detected in the 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
Unused parameterThe parameter is reserved for compatibility170 – 174
Power supply voltage, mVVoltage at the product power supply terminals175
Time to connect to a remote TCP server, s0 – connection to the remote server is set;176
1 – connecting to the remote server;
2 – 65534: the number of seconds before reconnecting;
65535: connection to a remote TCP server is not used
Status of a connection to a remote TCP server0 – the connection is not set;177
1 – connection is set;
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
Firmware File HeaderThe string identifier of the version, e.g., “EM-482, ver.10”.2030 – 2061
A blank string indicates the file is either unverified yet 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 EM-482 register access (via password)Cannot be obtainedCan be obtained
5Current EM-482 register access permissionNo permissionPermission granted
6Reserved-Always 1
7Permission to configure EM-482No permissionPermission granted
8ReservedAlways 0-
9Connection right-Client has right (Always 1)

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 receivedSome file data received
6File Download CompletionFile not downloadedFile fully downloaded
7File ValidityNot confirmedFile is valid

Table 7 - Settings Parameters

ParameterRange of valuesFactory settingDescriptionAddress
Wi-Fi network
Static IP-address*IP-address192.168.0.111If the dynamic addressing is switched off, IP-address of the device in Wi-Fi network is equal to this value300 – 303
Subnetwork mask*IP-mask255.255.255.0It is used only with static IP-address304 – 307
Gateway*IP-address192.168.0.1It is used only together with static IP-address for communication with other networks308 – 311
Switch on the dynamic addressing with a help of DHCP*0 – 110 – for addressing on Wi-Fi access point network, 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 – 110 – DNS of gateway is not used;314
1 – The gateway DNS is used to determine the IP addresses of other servers, if they are specified by host names
IP-address of DNS serverIP-address8.8.8.8It sets IP-address of a DNS server315 – 318
IP-address of additional DNS serverIP-address0.0.0.00.0.0.0 – it is not used319 – 322
Unused parameter00Should be 0 for compatibility323 – 339
SSID – Wi-Fi access point*Character stringEM-482 is connected to the given access point. Up to 32 characters340 – 371
Wi-Fi access point password*Character stringUp to 24 characters372 – 395
Unused parameter00Should be 0 for compatibility396 – 449
Modbus TCP Server
TCP connection port for Modbus TCP1 – 65535502It is used for external connection to EM-482 via Ethernet for exchange via Modbus TCP protocol450
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 EM-4820 – 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/sec*75 – 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
Unused parameter11Should be 1 for compatibility460
Byte format when transmitting via RS-485*0 – 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 server*0 – 110: connection to the server is not used;465
1: establish and maintain a connection to the data collection server
Cloud server connection port0 – 6553520502The port to which the party is addressed, making connection between EM-482 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
Enable setting the server address with a text string0 – 11This is used when connecting to the server.469
0: the connection is made to a server with a fixed IP address specified in registers 470-473;
1: the connection is made to the server with the name specified in registers 474-509
Server’s IP addressIP address0.0.0.0This is used when connecting to the server, if setting the server’s address with a text string is disabled. IP address of a remote server, with which the connection is maintained470 – 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 string11111It 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
Unused parameter00Should be 0 for compatibility520 – 549
Password for writing permission via Modbus to the other devicesCharacter stringIt is used to access devices connected to the EM-482, 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 EM-482, to request read functions, or to access the EM-482 registers, except for registers of version, password, mode and flags. The string up to 10 characters in length can be indicated as password. This string should not have any spaces560 – 569
Unused parameter00Should be 0 for compatibility570 – 571
Enable the protection 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
Unused parameter00Should be 0 for compatibility574
Miscellaneous
Unused parameter00Should be 0 for compatibility575 - 629
Enable automatic restart of the Product0 – 110: periodic restart is disabled;630
1: the Product is restarted after a specified period of time
Restart time, min5 – 7 200120Used when automatic restart is enabled.631
Enable restart mode automatically only in the absence of connections0 – 11This is used if automatic restart is enabled.632
0: the Product is restarted after a specified period of time since the start;
1: the Product is restarted after a specified period of time since the last MODBUS transmission
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
Unused parameter00Should be 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 – 100 – 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;
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 EMC-482 address) are received via RS-485
Last Modbus-identifier of RS-4851 – 255255same as above639
Connection to the remote Modbus TCP server
IP-address of the remote server*IP-address192.168.0.112It is used with enabled redirection of queries to a remote Modbus TCP 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 has 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 mode*0 – 100: remote MODBUS TCP server is not used;647
1: the connection to the remote MODBUS TCP server is established and automatically maintained
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
Unused parameter00Should be 0 for compatibility650 – 729
Wi-Fi services
Period of search for the best Wi-Fi hotspot0 − 7240: do not search for access points with a better signal and don’t switch between them until the connection is lost; Other values: the number of hours until the search for the access point of the same name with better signal730
Unused parameter00Should be 0 for compatibility731 – 739
Product NameCharacter stringName to distinguish products from each other740 – 779
The string of up to 36 characters can be indicated as address.
Unused parameter00Should be 0 for compatibility780 – 799
User’s Settings
User’s settings and saved values0–655350They can be used for storing any product identification data, or filled in by MODBUS clients for storing and transmitting data to the server5250 – 5499

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)

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

A: EM-482 listens on TCP port 502 (configurable in register 450) and uses Modbus address 111 by default (configurable in register 457). The current IP address can be usually checked at the network router which provides the Wi-Fi access point for EM-482.

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-799).

Q: How do I save my configuration changes?

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

Q: I have saved the new settings, how do I restart EM-482 remotely?

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

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=Modbus RTU, 1=Modbus ASCII)
  • 637: Transmission mode (0=Master, 1=Slave)

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

A: In Modbus Master mode (default), EM-482 sends queries to RS-485 devices (these queries come from Modbus TCP clients via Wi-Fi). In Modbus Slave mode, EM-482 receives queries from an external Modbus Master on RS-485 (these queries usually are intended for remote Modbus TCP server accessible via Wi-Fi). Use Slave mode when EM-482 should act as a slave device on an existing RS-485 network.

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

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

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

A: No, the EM-482 supports only Modbus protocol transfers.

Q: Can I connect EM-482 to multiple remote Modbus TCP servers?

A: EM-482 supports connection to a single remote TCP server. If this server is itself a EM-482 converter, they can be configured as a chain, with each one connecting to the next EM-482 IP address. However, the delays are increased with the chain length. To connect several of the other Modbus TCP devices, a converter supporting multiple remote servers can be used (one from the EM-48x or MC-25x series, e.g. EM-483). Configure each remote connection in devices’s registers 640-649. The main parameters are the connection mode and the server IP address. Also, set Modbus ID range for each remote server to avoid extra traffic and delays.

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 EM-482 for the changes to take effect.

Q: How do I check the current firmware version?

A: Read register 1 for the firmware version number.

For technical support and assistance: