Jump to content


Photo
- - - - -

Plotting Excel data for min/max limits


  • Please log in to reply
16 replies to this topic

#1 tmunsell

tmunsell

    Active

  • Members
  • Pip
  • 18 posts

Posted 23 October 2008 - 01:25 AM

Hi. I am currently attempting to display real-time performance values on a graph. I have the values needed in an xls file for the minimum and maximum limits. I would like to display these limits as lines on the graph, and then have the live data displayed on the same graph in real-time. This must be a continous process, during which time we are running a jet engine. This data will not be saved or printed, but only shown to aid the engine operator in judging the engine's performance during the test.

I've attached a screenshot of the final graph which is created in Excel and printed for the customer. Is it possible to recreate this graph in Labview, with the limit lines, and live data showing up as a dot while the engine it moving through the band?

Thanks in advance!

Todd

#2 Minh Pham

Minh Pham

    Very Active

  • Members
  • PipPipPip
  • 170 posts
  • Location:Sydney
  • Version:LabVIEW 2010
  • Since:2006

Posted 23 October 2008 - 05:22 AM

QUOTE (tmunsell @ Oct 22 2008, 11:04 AM)

I've attached a screenshot of the final graph which is created in Excel after the test and printed for the customer. Is it possible to recreate this graph in Labview, with the limit lines, and live data showing up as a dot or a line while the engine is running? I already have the subVIs needed to get the live data from the DAQ. I just need to be able to add the "permanent" limit lines to the graph so we will know if it is falling within the limits.

Thanks in advance!

Todd


Depend on how you are capturing the 'live data', if it returns in the form of array then the best is to use the build array option to create multiplots
to the GRAPH. If it returns in the form of point, we can using CHART (Use bundle node to create multiplots) like the example attached.

Good luck,
>>>> Stop coding >>> Start Wiring >>>>

#3 Doon

Doon

    More Active

  • Members
  • PipPip
  • 43 posts

Posted 23 October 2008 - 07:43 AM

Hi Todd,

As Minh Pham said, you simply need to bundle your "limit" data along with your "live" data. I would suggest something along the lines of iteratively updating a predefined 2D array (two columns with your 'limits' with a third column for your 'live' data). This assumes your graphs will have a consistent number of data points.

One question for your consideration: Do you plan to load the limits from the Excel sheet and/or subsequently export the data for printing in Excel? I ask because your topic implies a desire to do so, in which case, this issue is not as open-and-shut.

Have a nice day,
-H



#4 tmunsell

tmunsell

    Active

  • Members
  • Pip
  • 18 posts

Posted 24 October 2008 - 03:58 AM

Thanks for the info!

The data we are receiving is from a Daytronic System 10 DAQ unit. We are currently displaying the data in real time in digital displays. There are no arrays for the data that I will need to plot.

There are two inputs that need to be plotted on the graph (i.e. Engine RPM vs Engine Pressure Ratio). One needs to go to the X axis, and the other to the Y axis. I've tried just using a simple XY graph, but the live data isn't displaying at all, although it shows up fine on the main digital indicators that I am already using. As the engine accelerates, the engine pressure ratio (EPR... Pt7/Pt2 in the graph above) rises, as does the exhaust temperature (EGT). The X and Y axis values (labels) needs to stay as it is displayed, but the live data (point or line) needs to follow the actual EGT and EPR as it changes. The dots on the graph above are individually saved points. Basically, I'd just like to be able to see a dot moving on the graph as the engine accels/decels.

As for inputting the data, I don't have to use a spreadsheet. The limits are fixed data that just needs to be displayed so that I can see if the live data is falling within the min and max lines.

I could input it manually using numeric constants for the values and build an array. The only problem is that different engine sub-models have different min/max limits. I thought it would be easier to just select the filename that is to be used for each one, rather than manually entering all the info into the app each time. Of course, I suppose I can use a switch control or something like that to select the data that is used for a particular engine.

Can this all run within the while loop that I'm using for the rest of the application? Should I place the chart outside or inside the loop?

Although I've been using LV for almost a year, I'm still in the process of learning it. I've got the basics down, but haven't experimented with graphs yet.


Thanks again.




QUOTE (Doon @ Oct 22 2008, 02:22 AM)

Hi Todd,

As Minh Pham said, you simply need to bundle your "limit" data along with your "live" data. I would suggest something along the lines of iteratively updating a predefined 2D array (two columns with your 'limits' with a third column for your 'live' data). This assumes your graphs will have a consistent number of data points.

One question for your consideration: Do you plan to load the limits from the Excel sheet and/or subsequently export the data for printing in Excel? I ask because your topic implies a desire to do so, in which case, this issue is not as open-and-shut.

Have a nice day,
-H



#5 Minh Pham

Minh Pham

    Very Active

  • Members
  • PipPipPip
  • 170 posts
  • Location:Sydney
  • Version:LabVIEW 2010
  • Since:2006

Posted 24 October 2008 - 06:02 AM

As you mentioned that you are displaying 'live data' so ofcourse you have to place your
chart/graph inside the loop that way your data is updated every iteration of the loop.

You cant have it outside the loop as it will only update the data when the loop stoped.


>>>> Stop coding >>> Start Wiring >>>>

#6 Doon

Doon

    More Active

  • Members
  • PipPip
  • 43 posts

Posted 24 October 2008 - 07:48 AM

QUOTE (tmunsell @ Oct 22 2008, 08:37 PM)

There are two inputs that need to be plotted on the graph (i.e. Engine RPM vs Engine Pressure Ratio). One needs to go to the X axis, and the other to the Y axis. I've tried just using a simple XY graph, but the live data isn't displaying at all, although it shows up fine on the main digital indicators that I am already using.

I think this is an issue of input formatting... as Minh Pham has indicated above, context help is your friend. I will never stop using it -- especially when building graphs.

QUOTE (tmunsell @ Oct 22 2008, 08:37 PM)

As for inputting the data, I don't have to use a spreadsheet. The limits are fixed data that just needs to be displayed so that I can see if the live data is falling within the min and max lines.

I strongly urge you to leave Excel. I have had all kinds of heartache with maintenance of ActiveX controls for MS Office.
However, to ensure expandability, it would be best to store limit data external to your application. This becomes especially important if you deliver executables. I suggest a basic format such as CSV.

QUOTE (Minh Pham @ Oct 22 2008, 10:41 PM)

You cant have it outside the loop as it will only update the data when the loop stoped.

Ditto that. . . Unless you start messing with VI Server ;) , you will need your graph/chart indicator in your loop.

For your reference I built a simple app that plots limits in an XY Graph:
Download File:post-3343-1224742877.vi



#7 tmunsell

tmunsell

    Active

  • Members
  • Pip
  • 18 posts

Posted 29 October 2008 - 05:56 AM

QUOTE (Doon @ Oct 23 2008, 02:27 AM)

I think this is an issue of input formatting... as Minh Pham has indicated above, context help is your friend. I will never stop using it -- especially when building graphs.


I strongly urge you to leave Excel. I have had all kinds of heartache with maintenance of ActiveX controls for MS Office.
However, to ensure expandability, it would be best to store limit data external to your application. This becomes especially important if you deliver executables. I suggest a basic format such as CSV.


Ditto that. . . Unless you start messing with VI Server ;) , you will need your graph/chart indicator in your loop.

For your reference I built a simple app that plots limits in an XY Graph:
Download File:post-3343-1224742877.vi


Thank you very much, Doon and Minh Pham! You have been very helpful. The app you posted should save me a lot of time. I've always been better at "reverse-engineering" things, especially when it comes to learning a new programming language. :)



#8 tmunsell

tmunsell

    Active

  • Members
  • Pip
  • 18 posts

Posted 30 October 2008 - 02:13 AM

QUOTE (Doon @ Oct 23 2008, 02:27 AM)

I think this is an issue of input formatting... as Minh Pham has indicated above, context help is your friend. I will never stop using it -- especially when building graphs.


I strongly urge you to leave Excel. I have had all kinds of heartache with maintenance of ActiveX controls for MS Office.
However, to ensure expandability, it would be best to store limit data external to your application. This becomes especially important if you deliver executables. I suggest a basic format such as CSV.


Ditto that. . . Unless you start messing with VI Server ;) , you will need your graph/chart indicator in your loop.

For your reference I built a simple app that plots limits in an XY Graph:
Download File:post-3343-1224742877.vi



OK, I've tried adding your app to mine, but I'm running into an error that I can't quite understand. As shown in the attached file, I connected the data (tapped into the wires going to the digital indicators for Pt7/Pt2 and EGT, and removed the sliders) and ran it into where your "DAQ inputs" were bundled. I'm not sure that the error message means. The data that I'm reading is DBL, so I thought it would work by inputting it as is. I'm sure I'm missing something obvious, but I've been reading and troubleshooting for 3 hours now and I'm getting a headache! :) Please excuse my messy-looking block diagram. I needed to get it up and running asap, and I'm planning on cleaning it up as soon as I get everything working properly. Also, I placed everything in the main while loop for now, since I haven't read anything on running parallel loops yet.



#9 PaulL

PaulL

    The 500 club

  • Members
  • PipPipPipPipPip
  • 529 posts
  • Location:Tucson AZ
  • Version:LabVIEW 2013
  • Since:1997

Posted 30 October 2008 - 06:32 PM

QUOTE (tmunsell @ Oct 28 2008, 05:52 PM)

OK, I've tried adding your app to mine, but I'm running into an error that I can't quite understand.


What is happening is that the code is attempting to replace an array element (right after where the comment is "If I only had a DAQ"), but the replacement array element (from the section where the comment is "If I only had a DAQ") differs in type from the element it is replacing (and the array element type for that array). Specifically, the replacement element type is a cluster of two doubles, but the array element type is a cluster of two arrays of doubles.

The simplest thing to do is to put each of the doubles in the array element into arrays. So insert a build array on each of the wires before the Bundle function in the "If I only had a DAQ" section.



#10 tmunsell

tmunsell

    Active

  • Members
  • Pip
  • 18 posts

Posted 30 October 2008 - 07:44 PM

QUOTE (Paul_at_Lowell @ Oct 29 2008, 01:11 PM)

What is happening is that the code is attempting to replace an array element (right after where the comment is "If I only had a DAQ"), but the replacement array element (from the section where the comment is "If I only had a DAQ") differs in type from the element it is replacing (and the array element type for that array). Specifically, the replacement element type is a cluster of two doubles, but the array element type is a cluster of two arrays of doubles.

The simplest thing to do is to put each of the doubles in the array element into arrays. So insert a build array on each of the wires before the Bundle function in the "If I only had a DAQ" section.


Thanks Paul. I had a feeling that is what I needed to do, but I was putting the Build Array on the broken line, which obviously didn't work. I'll give it an ops check tonight with our Fluke 725 and let you know how it works. Every day I'm learning more and more about LV, thanks to the good folks on this forum!



#11 tmunsell

tmunsell

    Active

  • Members
  • Pip
  • 18 posts

Posted 12 November 2008 - 11:33 PM

QUOTE (tmunsell @ Oct 29 2008, 02:23 PM)

Thanks Paul. I had a feeling that is what I needed to do, but I was putting the Build Array on the broken line, which obviously didn't work. I'll give it an ops check tonight with our Fluke 725 and let you know how it works. Every day I'm learning more and more about LV, thanks to the good folks on this forum!


Well, everything seems to be working now. There's only a couple things left to do.

I would like to figure out how to run multiple While Loops simultaneously, and set up my app to allow me to select the chart/data files to use for each engine model. I'm not sure if that will be easy, so I may just have to make copies of the main app for each model, since each model has different limits and ranges (for the X and Y axis).

I'm also reading about how to manage the memory better. What I've read so far has been very vague, with no specific examples. Got lots to read, I guess! :)

Thanks again



#12 Dan DeFriese

Dan DeFriese

    Very Active

  • Members
  • PipPipPip
  • 202 posts
  • Location:Milwaukee, WI USA
  • Version:LabVIEW 2010
  • Since:2004

Posted 12 November 2008 - 11:57 PM

QUOTE (tmunsell @ Nov 11 2008, 07:12 PM)

I would like to figure out how to run multiple While Loops simultaneously, and set up my app to allow me to select the chart/data files to use for each engine model.


Just to clarify, are you now testing multiple engines simultaneously? Or are you just wanting to select different profiles for each engine model (1 engine under test at any given time)?

~Dan



#13 tmunsell

tmunsell

    Active

  • Members
  • Pip
  • 18 posts

Posted 14 November 2008 - 04:47 AM

QUOTE (Dan DeFriese @ Nov 11 2008, 09:36 PM)

Just to clarify, are you now testing multiple engines simultaneously? Or are you just wanting to select different profiles for each engine model (1 engine under test at any given time)?

~Dan



I just need to be able to select different profile for each model engine. We can only test one at a time.
I had to insert the app that Doon posted into the main loop for it to run properly. If that won't use more memory, then I can leave it as is.

I have also figured out how to read csv files for the data I need for each model, but I have to change it (and the x and y axis ranges on the charts) when we run a different engine. I just need to be able to select the model when the main app starts, or I will have to create copies of the app with different charts, and make the changes in each one so the appropriate app can be started when needed. That's no big deal, since I have plenty of harddrive space, and the app doesn't take up much space anyway. I'm just trying to make things easier and more configurable for the other engine operators.

The reason for the multiple while loops may not be needed. I can still put everything in the main loop, but I'm not sure if that effects memory usage or not.

Hope I'm not confusing anyone. :) I've attached my main app and subVIs if that will help. Please excuse the mess... I'm slowly working on cleaning it up. I want to avoid using structures if I can so others can more easily troubleshoot it if I'm not available. They are all good at reading basic wiring schematics, but the structures may confuse them (as structures do to me at times).



#14 Dan DeFriese

Dan DeFriese

    Very Active

  • Members
  • PipPipPip
  • 202 posts
  • Location:Milwaukee, WI USA
  • Version:LabVIEW 2010
  • Since:2004

Posted 14 November 2008 - 12:01 PM

Sorry, I don't have 8.6 installed yet. Can you save for 8.5 and repost.

Without looking I'd suggest opening a file dialog near the beginning of execution so the operator can select the profile file. When I see what you have maybe I can offer a more elegant method.

Are you hesitant to use sequence structures, or are just wanting to limit any kind of structure that would hide wires?



#15 tmunsell

tmunsell

    Active

  • Members
  • Pip
  • 18 posts

Posted 14 November 2008 - 09:58 PM

QUOTE (Dan DeFriese @ Nov 13 2008, 09:40 AM)

Sorry, I don't have 8.6 installed yet. Can you save for 8.5 and repost.

Without looking I'd suggest opening a file dialog near the beginning of execution so the operator can select the profile file. When I see what you have maybe I can offer a more elegant method.

Are you hesitant to use sequence structures, or are just wanting to limit any kind of structure that would hide wires?


Mainly, I don't want to hide the wires. It would make it easier on the other folks if they can see them all and trace them easily, as on a typical schematic.
The other reason is that I'm not familiar with structures either. I'm still learning the software as I go.

I've attached the app in v8.5. Any help is appreciated!



#16 Dan DeFriese

Dan DeFriese

    Very Active

  • Members
  • PipPipPip
  • 202 posts
  • Location:Milwaukee, WI USA
  • Version:LabVIEW 2010
  • Since:2004

Posted 15 November 2008 - 12:58 PM

QUOTE (tmunsell @ Nov 13 2008, 05:37 PM)

Mainly, I don't want to hide the wires. It would make it easier on the other folks if they can see them all and trace them easily, as on a typical schematic.
The other reason is that I'm not familiar with structures either. I'm still learning the software as I go.

I've attached the app in v8.5. Any help is appreciated!

Clean code is always easier to trace. Good thing this is LabVIEW, otherwise, I would have no clue what you are doing :rolleyes: !
Anyway, one more band-aid ain't going to hurt at this point so for the time being you can try using an enumerated type to select the engine profile as shown below.

Your application is very simple in concept, but its written in a very obfuscated way. With a little work it can be made much easier to read and manage. But first you'll need to learn the concept of a "state-machine" architecture.

Good Luck.



#17 tmunsell

tmunsell

    Active

  • Members
  • Pip
  • 18 posts

Posted 19 November 2008 - 05:52 AM

QUOTE (Dan DeFriese @ Nov 14 2008, 09:37 AM)

Clean code is always easier to trace. Good thing this is LabVIEW, otherwise, I would have no clue what you are doing :rolleyes: !
Anyway, one more band-aid ain't going to hurt at this point so for the time being you can try using an enumerated type to select the engine profile as shown below.

Your application is very simple in concept, but its written in a very obfuscated way. With a little work it can be made much easier to read and manage. But first you'll need to learn the concept of a "state-machine" architecture.

Good Luck.


Thanks! I did some more reading after seeing your post and think I have it figured out now! Thanks again. I'll let you know how it works out.