Suchen Sie etwas anderes?
MODBUS_ parameters can configure MTX-Tunnel to take modbus RTU device readings. The Modbus RTU device is connected to a serial port on the modem of MTX Terminals and the internal registers are read.
It is also possible to read and write modbus variables with AT^MTXTUNNEL=GETMODBUS and AT^MTXTUNNEL=SETMODBUS commands.
Table of Contents
MODBUS_address
Description: ModBus RTU address parameter specification.
Possible values:
- 1… 255
- Default value: 1
Additional notes:
- Please use the technical support line at iotsupport@mtxm2m.com for further information
- From MTX-Tunnel version 7.12, it is possible to create several addresses in this parameter, meaning several Modbus devices can be read with just one modem. Each address must be separated by a semi-colon “;”. For example, if you wish to read the memory table of each device with addresses 1, 2 and 3, this parameter would have the value 1;2;3.
MODBUS_start
Description: This parameter indicates the first position to read from in the Modbus register table.
Possible values:
- 1… 65535
- Default value: 1
Additional notes:
- MTX-Tunnel uses 2 bytes (Word type) variable data. Different sized data need further operations to send JSON object data to your server
From MTX-Tunnel version 7.12, it is possible to create several starting points in this parameter, meaning several ranges can be read. Each starting point must be separated by a semi-colon “;”. - See this example for more information and examples of scenarios. Please use technical support line at gsmsupport@matrix.es for further information
MODBUS_numWords
Description: Number of registers to be read from the ModBus device from the address indicated by the MODBUS_start parameter.
Possible values:
- 1… 20
- Default value: 1
Additional notes:
- This parameter is linked together with LOGGER_registerSize, so take the time to adjust it too From MTX-Tunnel version 7.18, it is possible to establish several numbers in this parameter, meaning several ranges can be read. Each different number must be separated by a semicolon “;”.
- See this example for more information and scenario examples. Please use technical support line at iotsupport@mtxm2m.com for further information
MODBUS_period
Description: This parameter shows after how many seconds the MTX-Tunnel must get the ModBus device to read its memory.
Possible values:
- 30… 2592000 seconds (from 30 seconds up to 30 days)
- Default value: 900 (15 minutes)
Additional notes:
- Please use the technical support line at iotsupport@mtxm2m.com for further information
MODBUS_onlyChanges
Description: This parameter allows you to decide whether to send all readings from a Modbus device (set to “off”) or only send a message when there is a change in at least one of the readings (set to “on”).
Possible values:
- on, off
- Default Value: off (all readings are sent)
Additional notes:
- This parameter is maintained for compatibility reasons. We ask you do not use it however. Instead, please use the parameter MODBUS_changeDiff
MODBUS_readCommand
Description: This parameter allows you to choose the Modbus read command for applications where the MTX-Tunnel acts as modbusmaster for the reading and delivery of modbus records. The command 0x03 is used in most devices, but in others it may be necessary to use the command 0x04. With this parameter you can choose between 0x03 and 0x04. From MTX-Tunnel v8.07 you can use 0x01 and 0x02 for binary inputs.
Possible values:
- 1, 2 3, 4
- Default value: 3
Additional notes:
- Please write to iotsupport@mtxm2m.com if you need further help
- If you do not know which one to choose, we recommend you specify value 3
- You can specify a different read command for each device to read. You must specify them separated by “;”
MODBUS_logFrequency
Description: this parameter allows you to choose the frequency of data recording in the Logger internal memory, to later deliver the records via GPRS. That is, it is possible to set, for example, a MODBUS_ period at 60, which states that the reading period of the Modbus records in seconds will be 60. We can also set, for example, a MODBUS_logFrequency of 3, so one of every 3 records will be internally stored and broadcast via GPRS.
Possible values:
- 1… 65535
- Default value: 1 (storage frequency = MODBUS_period)
Additional notes:
- Please write to iotsupport@mtxm2m.com if you need further help
- This parameter is very useful in scenarios where the MTX-Tunnel must poll several devices. For example, a device can be set with MODBUS_logFrequency “1” and another with MODBUS_logFrequency “5”. If we wanted to set a MODBUS_period of 60 seconds, from one of the devices data would be stored and sent every 60 seconds, and every 300 (5×60=300 seconds) from the other one
- This parameter is very similar to the parameter MODBUS_logType. Please consult it in this manual; you will need it to use MODBUS_logFrequency properly
MODBUS_changeDiff
Description: by using this parameter, only the readings of Modbus records in which a change, as specified in MODBUS_changeDiff, has occurred are stored/sent. For example, if you specify a parameter MODBUS_ changeDiff with a value of 10 and read the records from address 40 to 45, if one of the records 40 to 45 shows a difference (absolute value) >=10 compared to the last reading (which was stored/sent), then that reading (of records 40 to 45) will be stored in the logger to be later sent via GPRS.
Possible values:
- 0… 65535
- Default value: 0
Additional notes:
- Please write to iotsupport@mtxm2m.com if you need further help
- This parameter is very useful in those scenarios where you only want to store/send data when there are significative changes in one of the variables. For example, imagine you have an application recording temperatures from a modbus sensor. The temperature must be read every 60 seconds, but you don’t want to send the records via GPRS if the temperature doesn’t change. Then, by setting a MODBUS_changeDiff at “1”, for example, you would only send the temperature records when they differ in 1 degree
- This parameter is very similar to the parameter MODBUS_logType. Please consult it in this manual; you will need it to use MODBUS_changeDiff properly
MODBUS_logType
Description: with this parameter you can specify if you are using MODBUS_logFrequency, MODBUS_ changeDiff or both. You can choose, for example, to store/send modbus readings from a device every MODBUS_logFrecuency, or to store/send modbus readings from the other device when one of the records changes more than specified in MODBUS_changeDiff or you can choose both at the same time.
Possible values:
- 0 (MODBUS_logFrecuency), 1 (MODBUS_changeDiff), 2 (MODBUS_logFrecuency y MODBUS_changeDiff)
- Default value: 0
Additional notes:
- Please write to iotsupport@mtxm2m.com if you need further help
MODBUS_custom
Description: This parameter adds a new value “C” in the JSON frame. This value is completely arbitrary for the user and can be used for whatever you want. For example, it could be interesting if you want to inform the server that incoming data is binary, word, long…
Possible values:
- User String
- Default value: nothing
Additional notes:
- Check this example for a better understanding of this parameter. Please write to iotsupport@mtxm2m.com if you need further help
MODBUS_regType
Description: This parameter allows us to define the type of Modbus register that is to be read automatically. Either “Word” or “DoubleWord” can be chosen.
Possible values:
- 2 bytes (unsigned word), 4 bytes (unsigned doubleWord)
- Default value: 2
Additional notes:
- This parameter is available in versions from MTX-Tunnel v8.08. Before this version, the value “2” (Word) was the only option
- Check this example for a better understanding of this parameter. Please write to gsmsupport@matrix.es if you need further help