FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

13244 questions

15731 answers

25393 comments

49875 members

+1 vote
123 views 0 comments
by
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

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