graphing software?

hi everyone,

I wasnt sure where to post since there is no off topic section. is remotely advanced related question.

Im looking for a way to get more details from the .csv files generated by Morningstar's msview software.

here is a few examples:

1reVgy0C2t8wTLJ7BeyMJ831LQTKm.jpg

1IhPR21qkPqOPNhrYg4UywrcXW9ff0.jpg

1WIP7KXClTafIeMDU2Nyvkk9YO2Nj.jpg

you can see that these are very basic graphs and sadly this feature is not "live" as its only available for finished log files and no adjustments, what you see is what you get.

I think it might be possible to use these same .csv files in a more comprehensive graphing software but I have no idea where to look for this.

I would like to be able to zoom in on certain areas for more detail, thats what I need most but would also like to change colors so that the background is black and mabey add a grid in the background and work with multiple .csv files at once or combine them if possible.

Im also interested to know what the other solar controller manufacturers offer that has this ability (graphs) and if they are more comprehensive.

is anyone else using graphs and if so would it be possible for you to post a screen shot of them here?

Im hoping to find something that I can use to make them somewhat like this:

realtimegraph.gif

BTW preferably freeware and opensource even better!

thanks

Comments

  • Windsun
    Windsun Solar Expert Posts: 1,164 ✭✭
    Re: graphing software?

    Just import the csv file into Excel or some clone.

    But your graph quality will be limited by the number of datapoints, not the program most likely, and a lot of the events are all or nothing (1/0).
  • westyd1982
    westyd1982 Solar Expert Posts: 85 ✭✭
    Re: graphing software?

    If you can program in C, you can use the gd2 graphics library to draw exactly what you want (on Linux install with apt-get install libgd2-noxpm-dev). I track battery voltage and load current by reading a log file I save from my SunSaver MPPT (see the attached graph). The following is the code snippet to draw the graph:

    [HTML]
    /*

    Copyright 2010 Tom Rinehart.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see http://www.gnu.org/licenses/.

    */

    /* On Linux, compile with: cc filename.c -o filename -lgd -lpng -lz */

    /* You need to write a main() function to call this */

    void drawgraph(char *logfilename, char *graphfilename) {
    /* Declare the image */
    gdImagePtr im;
    /* Declare output files */
    FILE *pngout, *infile;
    /* Declare color indexes */
    int white, ltgrey, dkgrey, black, red, green;
    int month, day, year, hour, minute;
    float voltage, current, x1, ya1, yb1, x2, ya2, yb2;
    int i;
    char s[32];
    char inputline[1000] = "";

    /* Allocate the image */
    im = gdImageCreate(520, 160);

    /* Allocate the color white (red, green and blue all maximum).
    Since this is the first color in a new image, it will
    be the background color. */
    white = gdImageColorAllocate(im, 255, 255, 255);

    /* Allocate the color black (red, green and blue all minimum). */
    black = gdImageColorAllocate(im, 0, 0, 0);

    ltgrey = gdImageColorAllocate(im, 170, 170, 170);
    dkgrey = gdImageColorAllocate(im, 85, 85, 85);
    red = gdImageColorAllocate(im, 255, 0, 0);
    green = gdImageColorAllocate(im, 0, 150, 0);

    for (i=0;i<23;i++) {
    gdImageLine(im, 40+20*i, 20, 40+20*i, 140, ltgrey);
    gdImageLine(im, 40+20*i, 136, 40+20*i, 140, black);
    }

    for (i=0;i<5;i++) {
    gdImageLine(im, 20, 40+20*i, 500, 40+20*i, ltgrey);
    gdImageLine(im, 20, 40+20*i, 24, 40+20*i, black);
    }

    /* Draw shadow */
    gdImageLine(im, 21, 141, 501, 141, dkgrey);
    gdImageLine(im, 501, 21, 501, 141, dkgrey);
    gdImageLine(im, 22, 142, 502, 142, ltgrey);
    gdImageLine(im, 502, 22, 502, 142, ltgrey);

    /* Frame graph */
    gdImageRectangle(im, 20, 20, 500, 140, black);

    /* Label graph */
    for (i=1;i<=11;i++) {
    sprintf(s,"%d",i);
    gdImageString(im, gdFontGetSmall(), 20+20*i-(strlen(s)*gdFontGetSmall()->w/2), 144, s, black);
    gdImageString(im, gdFontGetSmall(), 260+20*i-(strlen(s)*gdFontGetSmall()->w/2), 144, s, black);
    }
    // strcpy(s,"noon");
    strcpy(s,"12");
    gdImageString(im, gdFontGetSmall(), 260-(strlen(s)*gdFontGetSmall()->w/2), 144, s, black);

    for (i=1;i<=5;i++) {
    sprintf(s,"%d",i+10);
    gdImageString(im, gdFontGetSmall(), 16-(strlen(s)*gdFontGetSmall()->w), 140-20*i-gdFontGetSmall()->h/2, s, red);
    sprintf(s,"%d",i);
    gdImageString(im, gdFontGetSmall(), 506, 140-20*i-gdFontGetSmall()->h/2, s, green);
    }

    // Draw voltage label in red
    strcpy(s,"Battery Voltage");
    gdImageString(im, gdFontGetSmall(), 20, 6, s, red);

    // Draw current label in green
    strcpy(s,"Load Current");
    gdImageString(im, gdFontGetSmall(), 500-(strlen(s)*gdFontGetSmall()->w), 6, s, green);

    // Set clipping rectangle
    gdImageSetClip(im, 20, 20, 500, 140);

    i=0;
    infile = fopen(logfilename, "r");
    if(infile != NULL) {
    while (fscanf(infile, "%[^\n]\n", inputline) != EOF)
    {
    sscanf(inputline,"%2d%*c%2d%*c%4d%2d%*c%2d%f%*f%*f%*f%f%*f%*f%*f",&month,&day,&year,&hour,&minute,&voltage,&current);
    x2=(hour+minute/60.0)*20.0;
    ya2=(voltage-10.0)*20.0;
    yb2=current*20.0;
    if (i < 1) {
    x1 = x2;
    ya1 = ya2;
    yb1 = yb2;
    }
    gdImageLine(im, 20+x1, 140-ya1, 20+x2, 140-ya2, red);
    gdImageLine(im, 20+x1, 140-yb1, 20+x2, 140-yb2, green);
    x1 = x2;
    ya1 = ya2;
    yb1 = yb2;
    i++;
    }
    }
    fclose(infile);

    // Set clipping rectangle
    gdImageSetClip(im, 0, 0, 520, 160);

    // Draw date at top of graph
    sprintf(s,"%02d/%02d/%d",month,day,year);
    gdImageString(im, gdFontGetLarge(),im->sx / 2 - (strlen(s) * gdFontGetLarge()->w / 2), 2, s, black);

    /* Open a file for writing. "wb" means "write binary", important
    under MSDOS, harmless under Unix. */
    pngout = fopen(graphfilename, "wb");

    /* Output the image to the disk file in PNG format. */
    gdImagePng(im, pngout);

    /* Close the files. */
    fclose(pngout);

    /* Destroy the image in memory. */
    gdImageDestroy(im);
    }
    [/HTML]
  • notsobright
    notsobright Solar Expert Posts: 247 ✭✭
    Re: graphing software?

    hi Windsun
    Windsun wrote: »
    Just import the csv file into Excel or some clone.

    But your graph quality will be limited by the number of datapoints, not the program most likely, and a lot of the events are all or nothing (1/0).

    now that you mention it, I did not know these progs could make graphs. just now Ive done this with openoffice

    1Q1RJNwP1zcQzBbI5OCz9SawGHrS.jpg

    so far I can get near what Im looking for except zooming into a certian part of the graph but it does scale so it is more useful than msview but I have yet to figure out how to save a template so that I dont have to change settings everytime.

    hey, I think if anyone here can answer this question it would be you, you probably overlooked it above so I'll repost

    Im also interested to know what the other solar controller manufacturers offer that has this ability (graphs) and if they are more comprehensive.

    from your experience, which manufacturer offers the best OEM software in general?


    westyd1982 wrote: »
    If you can program in C, you can use the gd2 graphics library to draw exactly what you want (on Linux install with apt-get install libgd2-noxpm-dev). I track battery voltage and load current by reading a log file I save from my SunSaver MPPT (see the attached graph).


    hi westyd1982, thanks again for sharing. I not a programmer but Im learning. problem is the time involved to get these types of projects sorted out and what could go wrong in that time with out having full control of my controller. ;-)

    if it would only work as advertised and expected! Ive had several other projects prior to getting into this solar hobby. I want to expand it to my home at some point also but I really expected there to be more advances in this field that there is. even the amount of info around is suprisingly thin.

    case in point: the most advanced monitoring equipment/software available to the public is the pentametric system. from reading that manufacturers website (Bogart Engineering) they started out in this field as a hobby and in much the same way as we have and they experienced unexpected results so they had to DIY monitor the exsisting equipment and to do this they had to make the equipment, now they have the best off the shelf monitoring system available! at least when you factor in the costs for such equipment.

    I shouldnt even have to be trying to make sure a controller is doing what it says it is doing anyway and it should have full montioring capabilities built-in from the start with software that is developed to be the best not this basic stuff that has no soul.

    I wish I was farther along with my programming skills but I am trying every chance I get. I was very relived to find your work here on the forums but its still suprizing to me there is not more like it out there.

    thanks
  • dogman
    dogman Registered Users Posts: 9 ✭✭
    Re: graphing software?

    Hello:

    I have been looking for local monitoring software that displays better graphics.
    i have the Morningstar TS-MPPT-60 controler, a Magnum inverter with a trimetric meter and I would like to have local display and monitoring for all of it combined.

    Each piece has an output of some kind, I just wish I could network them all together on a local display and be able to access that over the net. I don't want to count on some company and there web page to be able to view my data.

    The TS-MPPT-60 has serial and eithernet MOBUS access and it's seems to be documented.
    The inverter has a RS485 port so I hope to be able to interface to that.
    The trimetrics meter has a RS232 output only that I hope I can capture data from.

    Having been a programmer a long time ago and having most of the tools needed, I hope to write a program to collect and display the data. My week point is graphics display programming. If anyone has any good reference or samples it might help. i hope to do it under windows but I have more experence with linux.

    My thoughts have been to use a cheep net book computer to collect and display the data and have it acting as a web server connected to the internet with a secure connection.

    Off grid with 6 Simpliphi 3.4KWH 48 volt batteries, 2 Morningstar TriStar MPPT controllers with TS-RM-2  monitor, 1 with 9 Silfab 310 watt panels and 1 with 18 Grape solar 220 watt panels, Magnum MS4448PAE inverter with BMK battery monitor, Tri-Metric battery monitor and Utility company style KWH used meter.

  • notsobright
    notsobright Solar Expert Posts: 247 ✭✭
    Re: graphing software?

    hi dogman

    I found this for live graphing but I havnt tried it yet:
    http://www.live-graph.org/


    also the msview historical graphs have an undocumented feature. I posted more details about it here:

    http://forum.solar-electric.com/showpost.php?p=72954&postcount=34
  • markr
    markr Registered Users Posts: 14
    Re: graphing software?

    Hi,

    A while ago I ran across this page:

    http://www.ladyada.net/make/tweetawatt/index.html

    Dig into the "Design" section to see how to use some Google modules to graph in a web page. The code is available for download and it is fairly easy to set up Python to run it, all open-source.

    There is another example under "Resources" in the furnace monitoring project. The furnace monitoring code reads a spreadsheet (or your csv file) and graphs it. A later version does not require the spreadsheet.

    It looks like there is enough info to make it work with a little bit of effort.

    Enjoy,

    Mark R.