Posts: 1,255
Threads: 219
Joined: May 2007
Reputation:
0
02-20-2009, 08:47 AM
(This post was last modified: 02-20-2009, 09:27 AM by juwi_uk.)
Hi
Some advice on usage would be appreciated.
I am happy sending DA commands and getting RA responses back.
Trouble is I\'m wondering how to match RA response to the DA action that called them.
Ie if I send 2 DA\'s in rapid succession and get 2 x RA\'s back, how do I match each result with the DA that called it?
Unless Comfort somehow queues the DA\'s in the UCM so the next RA (amongst all of the other respones coming back on the bus asynchronously) can be matched easily (via simple flag handling) then how do I match them up.
What I\'d personally like to see otherwise as an enhancement is:
DAccAction1Action2
RAccnn
where cc is a reference ID (00 - FF) that can be put on by the PC so you can then identify the RA\'s coming back?
Maybe new command names instead of DA and RA if you want to maintain backward support for existing customers.
Any help/clarification appreciated.
J
Posts: 6,024
Threads: 880
Joined: Apr 2006
Reputation:
3
As the UCM receives each DA command, it will process the command and send the RA command to be queued up to be send back to the PC. hence the RA replies will always be in the order in which it was sent
It is not possible for the RAs to be in the wrong order
Posts: 1,255
Threads: 219
Joined: May 2007
Reputation:
0
Ok. Understood.
What I have found though is that I was having problems with UCM replies getting lost so if I sent 2 DA\'s and only received back one RA, which DA was this RA responding too. If we had a \"reference\" ID that matched the sending ID then at least no confusion on which is which.
I think I may have been sending commands to the UCM too quickly and overwhelmed the input buffer on the UCM, hence replies being lost?
At the moment I\'ve added a 50ms wait between each command sent to the UCM and this seems to have improved things.
Dont know what the best practice should be here when reading/writing commands to comfort.
J
Posts: 6,024
Threads: 880
Joined: Apr 2006
Reputation:
3
I didnt think you could send characters too fast, we have not tried that exhaustively though Possibly two commands too close together may be not advisable. A few milliseconds delay should be suffiicient
Reference ID is not feasible as it would be not compatible (and too much work besides)
Posts: 1,255
Threads: 219
Joined: May 2007
Reputation:
0
02-20-2009, 02:09 PM
(This post was last modified: 02-20-2009, 02:09 PM by juwi_uk.)
OK.
I send a few query requests at app startup to setup the UI and have a timer that re-queries things that arent updated automatically by Comfort. Found that these commands being transmitted quickly mostly worked.....by not always. As soon as I start losing replies though the RA responses become detached from what sent them.
Hence my quandry. I\'ll monitor the 50ms wait and see if it\'s reliable before trying to lower it as to be honest 50ms not that noticable in the UI anyway and reliability is what i need.
J
Posts: 1,255
Threads: 219
Joined: May 2007
Reputation:
0
Hi
I\'m just finishing off control of Smartfit in my App and need to deal with the \"Escape\" character scenario as per pages 4-5 of the Smartfit manual but need some clarification on this in conjunction with the DA command.
The scenarios I see from reading are. If <highbyte> and/or <lowbyte> =:
(1) 15. Add 15,15 to the command parameters where <highbyte> and/or <lowbyte> would normally be.
(2) 253. I can just send this as <highbyte> and/or <lowbyte> unchanged as (1) ie 15 is only scenario where I need to check
(3) 254. Presumbaly can be dealt with as per (2). Only scenario where I\'d need this is when I want more than one command in a single DA string?
(4) 255. As you dont put 255 on a DA command to terminate it anyway I\'m assuming <highbyte> and/or <lowbyte> can just use this as a single byte rather than 15,253?
So to summarise, if I only send single Smartfit commands via a DA action, the only scenario I need to deal with is when <highbyte> and/or <lowbyte> = 15 and here I double them up to 15,15.
Can you confirm my logic?
Regards
Julian
Posts: 1,200
Threads: 262
Joined: Mar 2007
Reputation:
0
You are correct in your assumptions for Smartfit commands
Posts: 1,255
Threads: 219
Joined: May 2007
Reputation:
0
Another DA related question.
I have the following response:
If Counter RoomTempSPOld <> 69 Then
Copy Counter RoomTempSPOld To RoomTempSP ! Save correct setting
end if
Which translates to:
81,19, 145,4,69, 198,19,25,255, 255
Question is how show the DA command look?
DA5113910445C61319FFFF
or
DA5113910445C61319FF
or
DA5113910445C61319
Can you advise please.
Regards
Julian
Posts: 1,200
Threads: 262
Joined: Mar 2007
Reputation:
0
The action Copy counter requires a terminator 255. The whole Response also needs a terminator. However DA by default terminates when thye line ends. It is best to append the two FFs, although 1 ore 0 FFs may also work. Anyway adding the FF terminatiors at the end of the DA or Responsne do no harm