I try to connect PACA with third party controller using it's RS232 port I have the most simple code: ---- Initialisation OpenSerial(2, 2, 9600, 8, 1, scNoFlowControl, scNoParity); Module once (GetLightingState("test") = ON) then begin WriteSerial(2, '0304on'#13#10); end; once (GetLightingState("test") = OFF) then begin WriteSerial(2, '0304off'#13#10); end; ---- Strange thing is that it works perfect, while in PICED operation mode with computer COM port 2. When uploaded to PACA it works only first time when I change group "test". It sends normal command. But after that it only sends this first command ok, but not second. For example if I turned "test" ON, 0304on is sent. Then I turn "test" OFF - nothing happens, turn ON again - 0304on. And vice-versa, if first command after PACA loads it "test OFF" then only 0304off is sent fine, cannot get 0304on. could anyone explain, why does this happen, how can I change it? thank you! UPD: PS. It looks like second command is being sent, but somhow it's different from the first one, so receiving controller does not understand it...
Hello Nick I was looking at your post hoping to learn something and I was wondering if the CR and LF needs to be '#13'. I think I remember needing the extra appostrophies. WriteClientSocket(1, 'Q0,2,-,-'#13'');
Putting the #13 within the apostrophes will result in the characters '#', '1' and '3' being sent, which is not what is required.