Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Plot Trend Graph
PostPosted: Wed Mar 28, 2012 6:43 am 

Joined: Mon Dec 05, 2011 12:25 am
Posts: 15

Offline
Hi,

I am using T7a.
I want to show graph on trend through whatever value I have stored in Data Base. I am able to create database write values and read them. I am unable to plot graph on trend through those stored values.


 Profile  
 
 Post subject: Re: Plot Trend Graph
PostPosted: Wed Mar 28, 2012 2:28 pm 

Joined: Tue Mar 13, 2012 9:53 am
Posts: 644

Offline
That feature will be available in iX Developer 2, but is currently not available in iX Developer 1.3X. We expect iX Developer 2 to be available within the next few months. However, in 2.0 you will still need to write a C# script to do it.

We can help you with any 2.0 scripting questions you might have once the software is released.

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer


 Profile  
 
 Post subject: Re: Plot Trend Graph
PostPosted: Wed Jun 06, 2012 3:36 am 

Joined: Thu Nov 17, 2011 2:10 am
Posts: 15
Location: Norway

Offline
I'm now trying to develop this with iX 2.0, for now - just testing to see if I can store an operators trends and bring them back up to read the values.

What I've done is that I've stored the following lines in a text document;
Code:
Globals.Tags.Trend11.Value
Globals.Tags.Trend12.Value
Globals.Tags.Trend13.Value


Now, when reading the text file into an array and put them in an AnalogNumeric foreach line, I get the correct tag. But it does not seem like the application understands that it is a tag?

Code:
      void Button1_Click(System.Object sender, System.EventArgs e)
      {
         string trendpen;
         string filePath = "";
         string line;
         
         List<String> stringArr = new List<string>();
         
         try
         {
            trendpen = this.ComboBox1.SelectedItem.ToString();
         
            filePath = @"" + trendpen + "";
         }
         catch
         {
            MessageBox.Show("Finner ikke angitt trend-fil. Velg fra nedtreksmenyen", "Feil i valg av trend", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
         }
         if (File.Exists( filePath ))
         {
            
            StreamReader file = null;
            try
            {
               file = new StreamReader( filePath );
               while ((line = file.ReadLine()) != null)
               {
                  stringArr.Add(line);                  
               }
            }
            finally
            {
               if (file != null)
                  file.Close();
            }
         
         }
         else
         {
            MessageBox.Show("Finner ikke angitt trend-fil. Velg fra nedtreksmenyen", "Feil i valg av trend", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
         }
         if(stringArr.Count >= 1)
         {
            AnalogNumeric1.Value = stringArr[0];
         }
         if(stringArr.Count >= 2)
         {
            AnalogNumeric2.Value = stringArr[1];
         }
         if(stringArr.Count >= 3)
         {
            AnalogNumeric3.Value = stringArr[2];
         }
 
      }


Maybe there is a functionality in 2.0 that does this for me, and also gives the oportunity to fetch "history" values as well?


 Profile  
 
 Post subject: Re: Plot Trend Graph
PostPosted: Wed Jun 06, 2012 7:15 am 

Joined: Tue Mar 13, 2012 9:53 am
Posts: 644

Offline
Normally I would use a DataLogger to log the changes. Then use a script to access the data in the database. The Script_Database_Export project attached shows you how to query the database.

If all you want to do is plot a graph of the data, then you can have the Trend chart save a history of the data it is plotting. There is an action that you can assign to a button that allows you to change the time range for the data that you are plotting. That way when the Trend chart history is turned on, you can select what time range you want the trend chart to plot.


Attachments:
Script_Database_Export.zip [189.96 KiB]
Downloaded 64 times

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer
 Profile  
 
 Post subject: Re: Plot Trend Graph
PostPosted: Thu Jun 07, 2012 12:07 am 

Joined: Thu Nov 17, 2011 2:10 am
Posts: 15
Location: Norway

Offline
It won't acctually log changes, rather creation of new trends with it's curves(?)
What I'm looking for is a script that makes it possible to create a new trend, with curves chosen during runtime, and be able to choose which of the generated trends to display.


Last edited by bjornidar on Thu Jun 07, 2012 1:01 am, edited 1 time in total.

 Profile  
 
 Post subject: Re: Plot Trend Graph
PostPosted: Thu Jun 07, 2012 12:45 am 

Joined: Fri Apr 27, 2012 12:33 pm
Posts: 44

Offline
Dear Mark

I couldn't open the example project in ix 2.0 :(

What will be the problem :(

Thanks


 Profile  
 
 Post subject: Re: Plot Trend Graph
PostPosted: Thu Jun 07, 2012 1:03 am 

Joined: Thu Nov 17, 2011 2:10 am
Posts: 15
Location: Norway

Offline
memethemyn wrote:
Dear Mark

I couldn't open the example project in ix 2.0 :(

What will be the problem :(

Thanks


You will have to open the project in iX 1.3x -> change the panel type and then open it in iX 2.0.
I could do it for you? - I dit it for you :)


Attachments:
Script_Database_Export_2.0.zip [197.57 KiB]
Downloaded 64 times
 Profile  
 
 Post subject: Re: Plot Trend Graph
PostPosted: Thu Jun 07, 2012 3:10 am 

Joined: Fri Apr 27, 2012 12:33 pm
Posts: 44

Offline
bjornidar wrote:
memethemyn wrote:
Dear Mark

I couldn't open the example project in ix 2.0 :(

What will be the problem :(

Thanks


You will have to open the project in iX 1.3x -> change the panel type and then open it in iX 2.0.
I could do it for you? - I dit it for you :)


Dear bjornidar

Thank you much..

Since I installed the 2.0 I had unınstalled the 1.3 :) But seems to install again..

Thanks again..


 Profile  
 
 Post subject: Re: Plot Trend Graph
PostPosted: Thu Jun 07, 2012 6:52 am 

Joined: Tue Mar 13, 2012 9:53 am
Posts: 644

Offline
Hi memethemyn,

It sounds like you want to use a Chart. You assign an array tag for the X and Y axis. Then whatever values are in those arrays gets plotted. If you are using data from the database, you will first need to query the database and get the data you want, then put that data in the array tags. The Chart will then plot the data. There are many different kinds of charts that you can use. In the "Chart Settings" you can change the chart type. They have line charts, so you can make it look like a Trend Chart.

Attachment:
Snap 2012-06-07 at 07.51.21.jpg
Snap 2012-06-07 at 07.51.21.jpg [ 38.49 KiB | Viewed 964 times ]


Attachment:
Snap 2012-06-07 at 07.48.11.jpg
Snap 2012-06-07 at 07.48.11.jpg [ 51.06 KiB | Viewed 964 times ]

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer


 Profile  
 
 Post subject: Re: Plot Trend Graph
PostPosted: Thu Jun 07, 2012 7:01 am 

Joined: Thu Nov 17, 2011 2:10 am
Posts: 15
Location: Norway

Offline
Will this work with historical values as well?


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: