don't know about linux but with suitable program everything is possible.
write program that accepts parameters like ip address, port, command (read/write) and variable name and spits out result.
the process is straight forward:
connect
compose message
send message
wait for response
decode it
print result
disconnect