Almost two years ago, we showed you by creating your own Excel add-in using Excel-DNA. Today we are going to show something simpler and even better: read any Yoctopuce sensor from Excel, with instant live refresh, without even recompiling a single line of code.
Real Time Data (RTD) Exported Live to Excel Spreadsheet [caption id='attachment_749'. *Thinkorswim is a chart analysis platform offered by TD Ameritrade:. TD Ameritrade's API features include: Trading - Submitting, canceling, modifying orders; Streaming data - Level I, Level II, News, and Actives1; Historical data.
The first enhancement compared to our previous blog post comes directly out of Yoctopuce programming API: since the beginning of the year, it is possible to use the YSensor abstract class to read any sensor, rather than having to use a specific sensor class. This is what will make it possible for you to test our code with any Yoctopuce sensor, without even recompiling our Excel Add-In. The other improvement idea comes from one of our customer: using a RealTimeData Server (RTD Server in short) for Excel rather than using explicit VisualBasic function calls. A RTD server appears to the user like a simple Excel function, but it is a function that can spontaneously change its value and notify Excel from the change so that all dependent cells are automatically computed again. This is like a direct transposition in Excel of the value change callbacks in our API. And if course we will use a callback function to implement the RTD server, thereby providing a high refresh rate. The demo Want to give it a try right now?
First make sure you have a installed. Then open Excel, enable 'developer' menu and select 'Add-ins'. Click on 'browse.' Button to find out which directory Excel is using for Add-Ins. Copy the content of into it this directory, and select the YoctoRTD.xll plug-in for activation. Installing our Excel Add-In If you have a Yoctopuce sensor connected to your PC, you can now add in any cell the formula.
=YSensorValue ( 'any' ) to see the current value of the first sensor found. And the value changes automagically. Instead of 'any', you can add the unique identifier of any sensor function (for instance 'LIGHTMK2-24F0F.lightSensor') or the corresponding logical name, if you have configured one.
By default, Excel only refresh dynamic values every 2 seconds, but our plug-in adds a menu to easily raise the refresh rate up to 100Hz. Have a look: The implementation If you are interested to learn how this works and to change this example, here are a few explanations about the code. As in our previous Add-in example based on Excel-DNA, we have started by creating a C# 'Class Library' project in VisualStudio Express 2012 (the full project is available for download in ). Apart from the reference to ExcelDNA.Integration and the Yoctopuce API base file yoctoapi.cs, we only had to add a single source file to implement the RTD server. The C#.NET project structure Here are a few words about the most important methods found in YoctoRTDServer.cs: ServerStart This is the method invoked by Excel when the user adds for the first time a reference to YSensorValue. We have to use it to initialize Yoctopuce library, including a timer that will periodically give control to the Yoctopuce library to handle USB events. 4 comments 1 - Santander Sunday,april 19,2015 1H30 This is great.
Will it work on Excel for Mac (Office 2011 for Mac)? 2 - mvuilleu (Yocto-Team) Sunday,april 19,2015 19H12 @Santander: Unfortunately not, because Microsoft has not ported to Mac any of the OLE classes that makes this magic possible. 3 - chan Wednesday,april 13,2016 8H32 Nice!! Im not a programming person, but i would like to ask whether its possible to get delay temperature value let say by 1 minute. Meaning, in this moment, the temperature value displayed is 1 minute expired instead of current one. Thanks 4 - mvuilleu (Yocto-Team) Wednesday,april 20,2016 10H10 @chan: do you mean by averaging over the last minute?
This tutorial will show you how to add custom Thinkscripts to your Think Desktop software. These instructions will walk you through how to set up any of the custom scripts I have published on my First, you download the file that you want to install: Save it somewhere on your computer that you can remember to get to later: If the file has a “.ts” file extension, then you are ready to import it and can skip to the next step. If it’s a “.zip”, then you need to extract it first. If you are on Windows, use.
On a Mac, the built-in archive utility can’t extract password-protected “.zip” files. When you extract the files, enter the donor password if required, then extract the “.ts” file somewhere you can remember to go find it. Next, open Think Desktop, go to a chart, click on “Studies” and choose “Edit Studies”: This brings up the “Edit Studies and Strategies” window. In the left pane is a list of all studies and strategies that are available for you to add to a chart. In the top pane there are the studies and strategies that are applied to the current chart, and the lower panel shows the parameters and settings you can change: If you are importing a study, click the “Studies” tab in the upper left.
If a strategy, then click the “Strategies” tab. Then to add the script you downloaded, click the “Import” button in the lower left corner. Browse to your file, and then click “Open”: The file will be imported into your collection of studies. Now at any time you can scroll to it in your list and double click it to add it to any chart: To see or modify the source code for any of the scripts, click the little parchment scroll icon next to its name.