FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
660 views 7 comments
by anonymous

Hello

According to https://wiki.teltonika-networks.com/view/TRB245_Modbus#Get_Parameters I shoud read the registers 142, 325, 326 and 337. However, it is not possible to read anything above address 143 (Register 144). I've been using QModMaster to check this. If I set Start Address to 143 and read one register, everything is ok. It even reads a value. If I alter the Start Address to 144 or the number of registers to 2, there's a read error.

From my application, I got the modbus reply 83 02 which means 'illegal address'.

There must be a bug in TRB2_R_00.07.01.4

Regards,

Martin

by anonymous
There's even more: the exception response returned is malformed.

The reply to 10 ed 00 00 00 06 01 03 75 bd 00 02 is 10 ed 00 00 00 02 83 02 which is 8 instead of 9 bytes.

It decodes as follows:

10 ed ->transaction
00 00 ->protocol
00 02 -> length (should be 3!)
         -> unit id missing!
83 -> function code 3 with exception
02 -> exception code
by anonymous

I've just tested it again with firmware TRB2_R_00.02.06.1:

no access to address 144 and up.

This is the modbus slave config:

slave config

by anonymous
As a follow-up:

The current slave implementation does not allow to read the whole register map. Whenever the slave gets into trouble collecting the data requested, it will fail and return a exception response that can't be interpreted by any standard compliant master. The problem is that the map contains holes in the data and you cannot know which of the data is currently readable.

It also seems that the availability is tied to system settings. If you turn the modem off, you won't be able to read anything related to it. The same applies to GPS. There's a risk that you may be able to read blocks of registers and suddenly fail to do so completely just because there's trouble with the mobile link.

If you want to use the slave, always read just one information at once and be prepared that you won't get neither data nor readable error. You will run into timeouts instead.

I had no luck testing with the tool ComTest Pro. This seems to have its own issues. QModMaster was running okay so far.

1 Answer

0 votes
by anonymous

Hi,

Thank you for contacting Teltonika Crowd-support forum. Please find our response below.

I can see in the screenshot that you are using number of registers as 1. According to the Modbus wiki article, you need to have 2 registers to read the GPS latitude coordinates value. Please change the number of registers to 2 and also change the data format to HEX.

You can see that I received the GPS latitude registers values as zeros, because my GPS is not enabled. However, I can still read the values from Modbus register.

Related to error you received, please follow the below steps:

1. Go to QModMaster and click on Disconnect icon.

2. Click on Clear table button.

3. Click on Reset counters button. (Please see the picture below for step-by-step instructions):

4. Set all the values as described earlier in the first picture and click on Connect button.

5. Click on Read and Write button to read the values.

You might need to repeat the steps again and check for Modbus Slave IP and Port.

Hope this will help.

Regards
Ramandeep

by anonymous
Hello Ramandeep,

Thank you for your contribution.

However, I do not care about the data returned by my examples. I do not intend to read those registers. I wanted to show that it is impossible to read above address 143 (register 144). I need to access the PIN2, PIN 3 and PIN 4 registers which is imossible to do

Regards,

Martin
by anonymous

Hi,

Can you please share the configurations screenshots of both Modbus Slave and master?
I've tested it on TRB2_R_00.07.01.4 and it just working fine for me. 
Are you planning to route Modbus data to remote server? what topology you are planning to implement, please share.

Also, If you could provide me the troubleshoot file via Private message, it would be really helpful. To download troubleshoot file, please go to System->Administrator-> Troubleshoot.

Regards
Ramandeep

by anonymous
Hi,

Well, there is no master configuration on the TRB.

I'm just running a slave on the TRB and am trying to access it by QModMaster. As long as this is not working, there's no need to think about an implementation.

The config is as straightforward as can be. 'Enable', that's all.

Unfortunately, I just had to send that unit away. I'm now setting up another unit. I will first try with the FW that is currently installed.

I'll keep you informed.
by anonymous

Hi Martin,

Can you please use Router's Modbus TCP master feature for testing? Please configure router both as Modbus slave and master. Create a Request configuration for 144 or above register (make sure the service is enabled, whose data you are trying to access).  QModmaster sometimes needs to be reset to continue reading and writing the data. Let me know the results. Make sure you select the proper data type for the register you are reading.

I was able to read and write data above 143 registers and your configurations are fine as well. It could be issue with QModmaster itself. Check the Modbus master feature of our device and let us know the results. Moreover, if can share your end plans via Private Message to me, that would be great.

Regards
Ramandeep