RS485 repetative string - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: RS485 repetative string (/showthread.php?tid=4126) |
RS485 repetative string - Hadeel - 01.07.2022 With RS485 , Im trying to control a blind. Controlling works fine but when the bilnd gives LM the status string, It seems to be returning the same stirng repeatedly. In the log image that I attached, at 20:35:43 I get a string which tells me that bilnd is at 65% position and when the bilnd reached at 90% position at 20:35:49, I get the same string again along with the string tells me that blind is at 90% position. Is there any problem with my script or is it seems to be a specification of the blind itself? Code: if not port then RE: RS485 repetative string - admin - 01.07.2022 Do you have any other scripts accessing the same port? Only a single script can access the port at any time. Also the reading part does not seem correct. Usually the data should be read one byte at a time, at least to the point where a message starting point is found. But this all depends on how the protocol is designed. Do you have a protocol description for this device? RE: RS485 repetative string - Hadeel - 02.07.2022 (01.07.2022, 14:50)admin Wrote: Do you have any other scripts accessing the same port? Only a single script can access the port at any time. Hi admin! Thank you for your help ! I made sure that this is the only script accessing this port...and read the blind specification... And finally realized that the cause was in my code.... the valiable "value" in str2hex() keep storing all results and this made the message looks repetative. I wrote this in the resident script So there is nothing wrong with the blind and its specification I can fix this now.... thank you so much for your help always ! Code: function str2hex(str) |