RTD Excel - Many topics - rare updates

Add-in Express™ Support Service
That's what is more important than anything else

RTD Excel - Many topics - rare updates
what are the typical patterns for handling large numbers of topics and small updates 
John Drummond




Posts: 2
Joined: 2012-12-03
Hi,
I got hold of delphi and addin express vcl hoping to get the easiest way to have nearly the highest performing rtd addin, not crossing any virtual machine barriers etc.

I'm trying to clarify my understanding - forgive me if I've missed something obvious in the documentation.
This is for using RTD in Excel
I want to have many thousands of topics
I will send updates to them via some external messaging server (currently trying to connect to Redis).
I would like Excel only to update the the items that had changed
http://msdn.microsoft.com/en-us/library/office/aa140060(v=office.10).aspx#odc_xlrtdfaq_whataretarget suggests I should be able to update 20000 topics 3 times a second on a low spec machine

My understanding of a pattern so far:

In OnRtdInitialize I start up a thread that connects to the messaging server and collects messages (topiv/value) pairs and puts them in a thread safe hash key
in OnRrdFinalize this connection gets closed down
I put one TadxRTDTopic on the RTDServerModule and put * in the first topic string.
In refresh data I get the topic from TadxRTDTopic(Sender).Strings[0] and look up the value in the threadsafe hash

=> What determines what the TopicID is?
=> Is the RTDServerModule.interval a wrapper for the Excel RTD Throttle Interval?
=> Where do I get the initial request for a topic from Excel and corresponding TopicId (OnConnectData doesn't seem to run), as in the messaging client I then need to subscribe to that topic ?
=> I'm guessing on an update from externally a RTDServerModule.UpdateTopic(topicid) should be called - can this be in the thread handling the messages and connection or where?

Let me know your thoughts or whether I should do this entirely differently.
Thanks
Kind Regards, John.
Posted 03 Dec, 2012 11:03:08 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello John,

This works in this way. When your RTD server gets a new portion of data, you should inform Excel that it needs to update all cells referring to a given RTD topic. Add-in Express implements two schemes:
- you can inform Excel at the specified time interval (that's the TadxXLRTDServerModule.Interval property); this causes OnRefreshData to occur on all topics
- you can set TadxXLRTDServerModule.Interval=0, and call TadxXLRTDServerModule.UpdateTopic() or TadxXLRTDServerModule.UpdateTopics() when required.

You should understand that your RTD topics will be updated only when Excel has enough time for this. If you update the topics too often, Excel will ignore some updates.

John Drummond writes:
=> What determines what the TopicID is?

TopicID is assigned by Excel.

John Drummond writes:
=> Is the RTDServerModule.interval a wrapper for the Excel RTD Throttle Interval?

No, these are different things.

John Drummond writes:
=> Where do I get the initial request for a topic from Excel and corresponding TopicId (OnConnectData doesn't seem to run), as in the messaging client I then need to subscribe to that topic ?


See the OnConnectData event of the RTD server module.

John Drummond writes:
=> I'm guessing on an update from externally a RTDServerModule.UpdateTopic(topicid) should be called - can this be in the thread handling the messages and connection or where?

You need to do this on the main thread only.


Andrei Smolin
Add-in Express Team Leader
Posted 04 Dec, 2012 11:10:56 Top
John Drummond




Posts: 2
Joined: 2012-12-03
That's very helpful, thank you, I'm getting there.
Say I had 40,000 topics and 10,000 of them had updated
There's no point in transferring all 40,000 items to excel calling refreshdata on a general topic and extra 30000 times, nor having to call updatetopic 10,000 times

=>is there a way just to return the 10,000 topic ids and changed values with a minimum of calls?

Thanks.
John.
Posted 05 Dec, 2012 12:44:48 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
John,

This isn't currently implemented. You can send us your vision of how this can be implemented to our support email address (see readme.txt).


Andrei Smolin
Add-in Express Team Leader
Posted 06 Dec, 2012 06:14:21 Top