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
435 views 3 comments
by anonymous

Hello,


I have currently configured RUT950 to read data from modbus slave:

I want to send this data to my modbus master (in this case RUT950 will act as a slave, and our system will send requests to read the data).

As I understand, first I need to put that data in to /regfile because now I can read only 0 values from that registers:

I assume that I need to put some custom scripts for that but I couldn't find enough information. Could you please show me an example how to do that?

 

1 Answer

+1 vote
by anonymous

Hello,

  

Could you clarify why this data cannot be read directly from the slave device?

Modbus TCP uses regular TCP/IP packets, which can be routed via the internet and should be accessible directly by the software that you are using to read this data.

Modbus TCP Master package on our devices can be used to periodically send the data to a remote server, or in the latest firmware versions, Modbus RTU can be converted to Modbus TCP to also be routable via the internet.

However, if you do need to get the values into the RUT955 first, then you are on the right path, and here is a configuration example of how it can be achieved. The issue seems to be incorrect data types, as the data you are writing to the regfile is of an unsigned float type, but the application seems to be reading it as an (unsigned?) integer.

If your device is supported, please update to the latest firmware version, which can be downloaded here, as the version you are currently using is no longer supported.

  

Best regards,
DaumantasG

Best answer
by anonymous
Thank you for reply,

I need to send data from PLC to SCADA wirelessly via GSM. We have SIM card with static IP address in our RTU950 and our PLC is connected to the RUT950 via LAN. So I need to read values first and then send them from the router.

I am using Modbus pool just for the testing purposes to see if I get correct data reading. I have tried different types of data (unsigned float included) and I still get same "0.0" readings. Just to clarify, I haven't done any scripting on the RUT950 side. On that particular example, router local time and GSM values are being written to regfile. But how do I write data to regfile that I have collected from my PLC? I assume I need to write a script for that? If so, where do I need to put that script on my router and what exactly my script should look like? It's quite confusing for me since I haven't done anything similar on my router in the past.

I am upgrading firmware version to the newest right now.
by anonymous

Hello,

  

There are a few ways how the Modbus device could be reached directly:

  • RMS;
  • VPN;
  • Static public IP;
Since you mentioned that you already have a public IP on the device itself, the Modbus device can be accessed using Port Forwarding. By default, port 502 is used for Modbus TCP communication, so to be able to access your device from the public internet, follow these steps:
  • Disable the Modbus TCP Master and Slave instances to avoid any conflicts;
  • Navigate to Network → Firewall → Port Forwards;
  • Create a new instance with any name
    • External port: 502 (assuming you are using the default port);
    • Internal IP address: IP address of the PLC;
    • Internal port: 502;
  • When the advanced configuration menu opens, change the protocol to TCP, and verify that the settings look like this:
  • Press Save & Apply;
  • Using the SCADA software, try connecting to the public IP of the RUT955 and the specified port (502 by default);
Make sure your SCADA software is not running on a PC in the LAN of the RUT955, as it will not be able to connect using the public IP address.

Let me know if any more help is needed!

  

Best regards,
DaumantasG 

by anonymous
I should have figured it out, that's the right way to do it with port forwarding. Everything works now.

Ačiū!