7141 questions

8568 answers

13830 comments

10608 members

0 votes
100 views 1 comments
by
Hello.

I would like to install a modbus package inside the RUT240 to communicate the router with a PLC.

If the router could be modbus client and server at the same time then perfect.

In the list of packages I can see:

modbus_data_sender - 2020-06-26-1

modbus_tcp_master - 2020-04-29-1

modbus_tcp_test - 2020-01-15-1

modbusd - 2020-07-29-1

modbusgwd - 0.0.1b

Do you know where I can find information about the packages?

I only  found some information about modbus_tcp_master, and modbus_tcp_test.

Thanks in advance.

BR

1 Answer

0 votes
by
Hi,

Yes, you can use Modbus client and server at the same time, it's even possible for a router to query itself.

More information could be found here: https://wiki.teltonika-networks.com/view/RUT240_Modbus

Regarding the packages, every package should have a page for instructions/manual and their command list, if they have any, so you would be better searching for them yourself.

EB.
by

Hi.

With the package modbus_tcp_master the RUT240 can read modbus data from a PLC (Modbus TCP Server)

root@Teltonika-RUT240:~# modbus_tcp_master

Daemon starting

got ctx

got ctx

Uci init done

modbus_data table already exists

SENT_ID_TABLE already exists

Create DB done

slave request nr:[0] config is full and enabled

Getting configuration for alarms

found alarm for slave device,alarm_config_name:alarm_af699c2c632aa8afb36b5ad3b32f6450, section->e.name:cfg0169aa

have full slave config with 1 rules configured, can start thread

pthread_created:0

Freeing UCI structures

Checking DB size

Current entries to db count: 641 of 20000

request paramms: function=3, first_reg=1000, reg_count=10, enabled=1

adding data for function 3 request

chars writen to socket[12]

Before reading - expected_response_length:29

total_bytes_read[[29]]

response->data_count:20

29 chars read: trans id:0, prot id:0, len:23, uid:1 f_code:3, data_count:20, resp0:0, resp1:0, resp2:0, resp3:100, resp4:0

Checking if the response is valid

saving response to DB

Response succcessfully writen to db

Checking alarms configuration

No alarms configured for this device

closing socket

Thread sleeping 10 s, before next check

I would like to use this instruction (modbus_tcp_data) in a script, and get the modbus readed data.

Do you know how I can do it?

Thanks in advance.