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
182 views 3 comments
by anonymous
Can the TRB140 or TRB 245 hold locally some logic, that once the comms drops, it would send pre-defined Modbus commands?

Detailes:
I'm looking at a topology of cloud hosted NodeRED talking via VPN to either TRB140 or 245.

The TRB140/245 will talk to the local device via Modbus TCP.

I want that when the NodeRED to gateway comms drops, the gateway would send some pre-defined commands to the device via Modbus TCP.

So can the TRB140 or TRB 245 hold locally some logic, that once the comms drops, it would send pre-defined Modbus commands?

1 Answer

0 votes
by anonymous

Hello, 

For the inquiry of TRB140 or TRB245, I would like to clarify you are using Modbus data to the server correct? Where you have configured the said registers data to be sent to your server, and when the server is not reachable the TRB device will just store the data. Kindly correct me if my understanding is wrong. 

Also in the second point, it seems you need to do custom scripting for this. The script will be executing Modbus Write Action to the register you want to control. But for this scripting part and regarding how to do it we cannot provide support since everything that custom scripting, SDK and changes the client will be responsible for it.

SDK for the devices could be found here: Software Development Kit - Teltonika Networks Wiki (teltonika-networks.com) 

Regards,
Mellow 

by anonymous
The modbus commands originate from the server (NodeRed) yes.
The commands will go from the server, via VPN to the TRB245 (connected to the VPN via 4G SIM), and from the TRB245 to the device (AC/DC inverter) via Modbus TCP over ethernet cable.

When the server is not reachable, I want the TRB245 to send pre-defined commands to the AC/DC Inverter.

Obviously the pre-defined commands are custom, correct :)
So from your answer I'm understanding that using the SDK I will be able to do this, right?
by anonymous
Hello,

Yes, there is a possibility to do it via SDK or custom scripting. But for the data collection part if you check the /tmp/ folder there would be .modbus_tcp_master_db (this modbus_tcp_master_db file is a hidden file) file where Modbus data will be stored it will be populated when data to the server is not able to send Modbus data successfully.

I hope it gave you some ideas on how to implement it.

Regards,
Mellow
by anonymous

Hi Mellow,
Thank you for the response.
We are looking to further understand the capabilities of the gateway in our wide implementation plan.

We are looking to have the gate way TRB145/245/255 to hold internally some local logic.

We had a look at the TRB SDK instructions:

https://wiki.teltonika-networks.com/view/RUTX_Software_Development_Kit_instructions

Yet it wasn't totally clear to us how the gateway can hold the logic we want.
 

We want to have a logic such as: 

Some Modbus input - then Modbus send a specific modbus output 

Communication lost - then Modbus send a specific modbus output

In what language can we program? How do we push that logic into the modbus gateway?

You mentioned the SDK as well as the "Custom Scripting", which one would be best to use in order to do this? and how? 
Do you happen to have an example? 

Thank you,
Eli