user3032631
user3032631

Reputation: 11

make a dynamic chart on a plc

I'm searching for a way to make a graph on a user web page on a plc with data from the plc (datablocks or log files). The log files can be converted to CSV files.

I get data per our and day from the plc and want to put this into a dynamic chart.

What I want is that when there is new data from the plc, the graph should automatically change.

The plc is a siemens S7-1200.

Upvotes: 0

Views: 1963

Answers (4)

Ruben Imbers
Ruben Imbers

Reputation: 1

You can try the amChart Libraries. They provide both a free (with some ads) and a paid (adfree) version of Javascript dynamic charts. The data to fill in the charts can be provided via CSV from the same S7-1200 PLC where you are storing your data.

There's a Siemens forum entry covering this issue with an example: https://support.industry.siemens.com/tf/ww/en/posts/charts-from-datalog-files-directly-used-in-webserver/83762/?page=0&pageSize=10#pagetop

Upvotes: 0

Peter
Peter

Reputation: 21

did you look on this article? https://www.dmcinfo.com/latest-thinking/blog/id/8567/siemens-s7-1200-web-server-tutorial--from-getting-started-to-html5-user-defined-pages.

You should use a javaScript or JQuery library.. If you have some questions about PLC of Simatic S7-1200 u can contact me.

<div id="g1"></div>
<div id="g2"></div>

<script type="text/javascript">
$(document).ready(function(){
    var g1, g2;
    var g1 = new JustGage({
      id: "g1",
      value: getRandomInt(-100, 100),
      min: -100,
      max: 100,
      title: "Triangle Wave",
      label: "Value"
    });

    var g2 = new JustGage({
      id: "g2",
      value: getRandomInt(0, 100),
      min: 0,
      max: 100,
      title: "random data",
      label: ""
    });

    $.ajaxSetup({ cache: false });
        setInterval(function() {
            g2.refresh(getRandomInt(50, 100));
            $.get("IOtriangleWave.htm", function(result){
                g1.refresh(parseInt(result));
                g2.refresh(getRandomInt(50, 100));
            });
        },1500);
});
</script>

Upvotes: 1

Oskar Groth
Oskar Groth

Reputation: 28

What about using 1200 logging in csv? Then take it from plc with webserver and open with excel.

Upvotes: 0

Bill J.
Bill J.

Reputation: 163

You said that you want to "make a graph on a user web page on a plc with data from the plc ". Is this the same PLC, or did you mean a PC (Personal computer)?

You also said you are already getting the data from the PLC. How are you storing it, and are you storing it on your webserver?

You also said that you want to 'make a graph on a user web page on a plc with data from the plc '. Is this the same PLC, or did you mean a PC (Personal computer)?

For example, you could be storing the data in some form of SQL server. You would then need to program a dynamic web page that regenerates using whatever server side programming tool you like. This could be ASP and MS-SQL, PHP and MY-SQL, whatever tools you have available.

Upvotes: 2

Related Questions