Automated way to select points that then brings up an Excel Chart

92 views
Skip to first unread message

Mattm

unread,
Oct 27, 2011, 5:27:19 PM10/27/11
to IADS
I've been out of the loop for a while, and may have forgotten some of
the ways to export data in IADS, but I'm remembering that if you
select two points on a strip chart, then right click, then select
"Data Export", then select "Export to Excel", the data is exported
into an Excel spreadsheet that displays the data. Is that hard wired,
or can we run some code behind that to say bring up that selected data
into an Excel time history chart. I think we've been down this rought
before, but wasn't sure if any of the newer features of IADS added any
of that functionality. Thanks...

Matt Menard

Adam Chant

unread,
Oct 27, 2011, 7:21:40 PM10/27/11
to ia...@googlegroups.com

Matt,
Right clicking to export to excel is one of the ways to export data, but you can also use the data export groups to export data and trigger off some scripting.
Also it's possible to query IADS data files from matlab if you have that application.
Is there a specific task you wish to accomplish maybe we can provide you some direction.


Adam Chant
Application Support Engineer
Symvionics, Inc

> --
> You received this message because you are subscribed to the Google Groups "IADS" group.
> To post to this group, send email to ia...@googlegroups.com.
> To unsubscribe from this group, send email to iads+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/iads?hl=en.
>

Mattm

unread,
Oct 27, 2011, 10:33:12 PM10/27/11
to IADS


On Oct 27, 7:21 pm, Adam Chant <a...@iads-soft.com> wrote:
> Matt,
> Right clicking to export to excel is one of the ways to export data, but you can also use the data export groups to export data and trigger off some scripting.

It's not so much about exporting the data per say, as programatically
doing something with the data (like bringing up the data between the
two selected points in an Excel chart). The point selection is a
convenient way to select the start and end points of the data, without
having to ask the user for a start and end time.

> Also it's possible to query IADS data files from matlab if you have that application.

I suppose we could write a Matlab routine that inports that data into
Matlab and the run a Matlab routine. I'm forgetting how we were able
to run some Matlab code on the inported data to possibly bring up some
plots, or whatever we want to do at that point.

> Is there a specific task you wish to accomplish maybe we can provide you some direction.

Yes, we want to easily select two points in time, (for instance using
the point selection) then allow the user to run an automation routine
of some sort using the selected data to bring up some charts, in Excel
preferably, but Matlab could work as well.

>
> Adam Chant
> Application Support Engineer
> Symvionics, Inc
>

Thanks Adam, I appreciate the input...

Matt Menard


>
>
> > I've been out of the loop for a while, and may have forgotten some of
> > the ways to export data in IADS, but I'm remembering that if you
> > select two points on a strip chart, then right click, then select
> > "Data Export", then select "Export to Excel", the data is exported
> > into an Excel spreadsheet that displays the data.  Is that hard wired,
> > or can we run some code behind that to say bring up that selected data
> > into an Excel time history chart.  I think we've been down this rought
> > before, but wasn't sure if any of the newer features of IADS added any
> > of that functionality.  Thanks...
>
> > Matt Menard
>
> > --
> > You received this message because you are subscribed to the Google Groups "IADS" group.
> > To post to this group, send email to ia...@googlegroups.com.
> > To unsubscribe from this group, send email to iads+uns...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/iads?hl=en.- Hide quoted text -
>
> - Show quoted text -

Adam Chant

unread,
Oct 28, 2011, 11:10:07 AM10/28/11
to ia...@googlegroups.com
Matt,
For Data exports using Data Groups only exports to Matlab has an Option
(MatlabSatementToRun) to run a script after exporting.
Also we have the iadsread Matlab function for Matlab that can read IADS data
files directly from Matlab. This can be used within Matlab to query an IADS
data set or time slice for further processing.
The way I would go about that would be to run a test point from the start
and stop of 2 points in time.
Then have the iadsread function get the latest test points from the config
and trigger your script from those two time slices.

To do this with excel it would take a little more work, but it's not out of
the question.
HTA could be used to build a GUI for a VB script that does the same thing by
watching or querying test points.
Then it fires off a Data export group to excel and after that is complete
runs another script on the data.

Last but not least another option would be adding a macro of your script to
the template Main workbook in excel. That will make it available for every
instance of excel and then it can be triggered with a simple keystroke after
the data is populated.

Also if you are looking for a way to do Derivative or Integrate our
Stripchart tool box has those functions in it.

Right-click in the Analysis Window title bar.
Select Add In Tools > Stripchart Toolbox.
Freeze the Analysis Window.
Pick points in the Stripchart to select a block of data.
Click the desired Toolbox button.


If all else fails and the script you are trying to run is generic enough,
could be used for other programs and not proprietary we may be inclined to
integrate it into IADS in a future release.

I hope these are some solutions for your situation.


Adam Chant
Symvionics, Inc.
IADS Application Engineer
(661) 273-7003 x 210

Mattm

unread,
Oct 28, 2011, 3:30:11 PM10/28/11
to IADS
If I had my way, I'd like to be able to export the data from two
selected points on a strip chart, and when the menu comes up to
"Export to Excel", and another option to allow the user to "Export to
Myscript", to allow for programmatic control of the data. In the one
that we'd like to develop, we want to use that selected data to bring
up a chart (but I think I'm starting to repeat myself, repeat
myself).

I guess we could do something similar with the datagroups, but you
have to set those up ahead of time (the idea being that we want to
allow the user to, on a whim, look at a timehistory of the selected
data, and not have to set it up before hand). That being said, I
remember being able to run a matlab m file (I think, like I said I've
been out of it for a while) from a data group using the propertybag
statements. I have an older version of IADS installed on my home
laptop, and my version (6.1) in the help file lists one of the
propertybag statements for the datagroups table as
"MatlabStatementToRun". Will that allow us to run say an m file from
within Matlab (again, I've been out of it for a while, and don't have
Matlab installed on my home laptop to experiment). Or is there
another way to run a matlab file to allow us to say bring up that
selected data in a Matlab plot.

Thanks...

Matt
> athttp://groups.google.com/group/iads?hl=en.-Hide quoted text -

Michael Jones

unread,
Oct 28, 2011, 3:59:04 PM10/28/11
to ia...@googlegroups.com
Hi Matt,

I'm sorry I didn't jump in on this more quickly, but I think I have everything you need to create your own export plugin.

We have the capability for you to write your own Data Export Plugin which can extend the Right-Click Menu.

I'll shoot you an email offline to coordinate getting you some example code and some documentation.

Mike

Mattm

unread,
Oct 28, 2011, 9:32:22 PM10/28/11
to IADS
Thanks guys, I appreciate all your help...

Matt

Emil Crisan

unread,
Oct 29, 2011, 9:25:56 PM10/29/11
to ia...@googlegroups.com
Hi all,

I am interested in this matter, too...from the Excel perspective.

Thank you,

Emil

--
You received this message because you are subscribed to the Google Groups "IADS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/iads/-/ccvJDN1UsUoJ.

James Bretz

unread,
Oct 31, 2011, 1:09:36 PM10/31/11
to ia...@googlegroups.com
We actually have built a "Data Export Wizard" and will include it in the
next major release of Iads. Using this wizard, you can choose a Matlab
statement to run after export. I'll add to our request database the ability
to fire off a macro in Excel. I think we've tried this before but the
function failed due to a permission issue. We'll try again.

As for being able to "choose" what actions are to be executed in Excel, this
is another matter. It would be fairly easy to execute a macro by name, but
being able to "do anything" would probably mean firing off a script. We
could add the ability to arbitrarily fire off a VB script after export. I'll
add this to the list as well.

For the time being, you could use the ActionObject to fire off the Excel
automation script after the export... although the user would have to push a
button on the window to initiate it. Not the best, but better than nothing.
Jim

--------------------------------------------------
From: "Emil Crisan" <cem...@gmail.com>
Sent: Saturday, October 29, 2011 6:25 PM
To: <ia...@googlegroups.com>
Subject: Re: [IADS] Re: Automated way to select points that then brings up
an Excel Chart

> Hi all,

Emil

unread,
Oct 31, 2011, 6:21:05 PM10/31/11
to ia...@googlegroups.com
In my humble opinion, the ability to fire off an add-in or macro in Excel will open nice opportunities in using IADS.
Thanks for the idea of using an ActionObject with a button to fire off the Excel automation script.

Emil

James Bretz

unread,
Feb 10, 2012, 7:43:01 PM2/10/12
to ia...@googlegroups.com
Emil,

I was just looking through the code the other day and found the option to
fire off an Excel macro.

\\ExcelStatementToRun=MacroNameToFire,OptionalArg1,OptionalArg2,OptionalArg3

If you add this to the PropertyBag of the DataGroup, it will fire off a
Macro by the name in the first argument. I tested without any optional
arguments and it seems to work ;)

I'll make sure this get's into the documentation,
Jim

--------------------------------------------------
From: "Emil" <cem...@gmail.com>
Sent: Monday, October 31, 2011 2:21 PM

James Bretz

unread,
Feb 15, 2012, 4:36:34 PM2/15/12
to ia...@googlegroups.com
All,

Emil and I worked on the issue of automating Excel through a DataGroup
export offline, so I thought I'd post the results:

1) In order to fire off a Macro upon DataGroup export, you need to first get
the Macro into Excel.

The easiest way we found is to put the Macro into the 'personal.xlsm' file
in the XLSTART directory (C:\Program Files\Microsoft Office12\XLSTART).
Excel will load this file upon startup automatically.

Below is a link for a tutorial of this process. Make sure you set the
workbook to "hidden" as the tutorial suggest, otherwise the exported data
will go into the personal.xlsm file (not good.. we want it to create a new
workbook). One more thing that the tutorial actually misses is that you need
to save the workbook as a "macro enabled workbook" (xlsm file). This is
required by the newer versions of Excel.

http://office.microsoft.com/en-us/excel-help/deploy-your-excel-macros-from-a-central-file-HA001087296.aspx

I created a macro named Plot as follows, saved the personal.xlsm file into
the XLSTART directory, and exited Excel:

Sub Plot()
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'MyDataGroup'!$B:$B")
ActiveChart.ChartType = xlLineMarkers
End Sub

2) Go to the DataGroup table in Iads and add the following entry to the
PropertyBag column of the DataGroup you wish to perform the Macro upon
export. In my example, I executed the newly added 'Plot' macro:

\\ExcelStatementToRun=personal.xlsm!Plot

Notice the scope declaration 'personal.xlsm!' in front of the macro name
'Plot'. You need to add this or the Macro will not be found when executed
from a DataGroup.

3) Run Excel from the Microsoft Start menu *before* exporting any DataGroup
that fires a Macro from Iads.

When I exported the DataGroup, Iads executed Excel and put in the data, but
the Macro failed. It appears that when you add a macro to the personal.xlsm
file, it will load each time you run Excel from the Start menu, but it
*won't* load if you let Iads execute Excel from scratch. The bottom line is
that I had to start Excel 'by hand' from the start menu, and then perform
the export (I.e. let Iads attach to an already running Excel). It seems
there might be some security operation that doesn't allow macros or personal
sheets to load from the automation interface (the way Iads starts Excel).

4) Export the DataGroup

Data fills the sheet and the Macro is fired off (finally!)


So to recap:

A) Setup your Macro in a file called personal.xlsm (save it as a macro
enabled workbook)
B) Create a DataGroup at add
\\ExcelStatementToRun=personal.xlsm!YourMacroName
C) Run Excel from the Start menu
D) Export the DataGroup from Iads

Hope this helps,
Jim


--------------------------------------------------
From: "James Bretz" <j...@iads-soft.com>
Sent: Friday, February 10, 2012 4:43 PM

Reply all
Reply to author
Forward
0 new messages