passing large values with topic.UpdateValue

63 views
Skip to first unread message

Onn

unread,
Aug 28, 2021, 1:36:41 PM8/28/21
to Excel-DNA
Hi all

I have a question regarding UpdateValue
I am using RTD with a backend and dynamic arrays. So far I've been using UpdateValue as I saw in the document serializing my backend data into a string and calling topic.UpdateValue. That works just fine.

But from what I can tell, I can send only 256 characters this way. So I'm trying to get a better idea if I am approaching this correctly.

So, my questions are this:
1. Is my understanding correct that the string is limited to 256 characters?
2. is it possible to send a non string value (like an array of objects) using UpdateValue?
3. Am I using RTD server in a way that its not intended by sending "too much" data?
4. Should I be approaching this differently?
5. I noticed there is a sample about ObjectHandles - should I be looking at that?

All the best, thanks in advance,
Onn


Govert van Drimmelen

unread,
Aug 28, 2021, 5:20:44 PM8/28/21
to Excel-DNA
--------------------------------------------------
Excel-DNA is now registered on GitHub Sponsors.
You can add Excel-DNA support with easy billing through a corporate GitHub account.
--------------------------------------------------

Hi Onn,

1. Yes - RTD strings have this string length limitation.

2. You can't directly update with arrays, but you can do a kind of wrapper UDF to do this - see 4. below.

3. Initially RTD sources were intended to return single cell value only, and are built to scale well to large numbers of RTD calls. But the problems with wrappers that return arrays of values were fixed in the Dynamic Arrays Excel, so now you can make wrapper UDFs that return larger arrays too, and these are dynamically resized.

4. You should consider the Excel-DNA wrapper around RTD that works like the IObservable interface from the Reactive Extensions. This allows you to easily return long strings or arrays from a push data source. I  suggest you work through the sequence of samples here: Samples/RtdClocks at master · Excel-DNA/Samples (github.com) You can tweak the return values to see how your kind of data results work.

5. That would be a different way of dealing with the RTD limitations around arrays. If you're using Dynamica Arrays version of Excel and just wanting to push arrays of values or longer strings from your data source, you might not need this. Object handles are valuable for other patterns though.

-Govert


Onn

unread,
Aug 29, 2021, 1:07:08 PM8/29/21
to Excel-DNA
4. You should consider the Excel-DNA wrapper around RTD that works like the IObservable interface from the Reactive Extensions. This allows you to easily return long strings or arrays from a push data source. I  suggest you work through the sequence of samples here: Samples/RtdClocks at master · Excel-DNA/Samples (github.com) You can tweak the return values to see how your kind of data results work.

Many thanks, for the replies. Working through the examples this makes sense and is exactly what I was looking for.
Reply all
Reply to author
Forward
0 new messages