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.
+1 vote
228 views 0 comments
by anonymous
Hello,

with this request

(modbus_serial_request_test RS_TYPE TIMEOUT SLAVE_ID FUNCTION REG_NUMBER REG_COUNT/VALUE(S) DATA_TYPE NO_BRACKETS)

I get the value of a spasifice register, but which command should I use to store the output of this command in a variable (using the costum script)

and is there another way to read/write the value from the serial port

Thanks

1 Answer

0 votes
by anonymous

Hello, 

You should be able to store the variable with this line of text:

#!/bin/ash
data=$(modbus_serial_request_test RS485 5 1 3 6 1 16bit_int_hi_first 0)


The "data" variable will be having the result of your Modbus serial request.

I hope this helps.

Regards,

Jerome

Best answer