Dear admin,
Thank you for providing the code, it's working on the site!
However there was one problem we could not solve on the site.
Even though this script intend to wait at least for 0.5 sec between each command,
when the bath system builder checked their command reception log on the slave side,
it seems that sometimes LM sends commmand with 0 sec in between (between the actual command port:write(data) and the status read port:write(':RR\r\n')).
It does not happen every time, it happened just 3 times in a day.
I just changed the timeout to 20 from 1 but everything else is same with your last script.
Could you think of any reason why this happen ?
Thank you !
Thank you for providing the code, it's working on the site!
However there was one problem we could not solve on the site.
Even though this script intend to wait at least for 0.5 sec between each command,
when the bath system builder checked their command reception log on the slave side,
it seems that sometimes LM sends commmand with 0 sec in between (between the actual command port:write(data) and the status read port:write(':RR\r\n')).
It does not happen every time, it happened just 3 times in a day.
I just changed the timeout to 20 from 1 but everything else is same with your last script.
Code:
data, err = port:read(17, 20) -- read 17 bytes for up to 20 second
Could you think of any reason why this happen ?
Thank you !