How Can I refresh Databaseviewer automatically ?

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
memethemyn
Posts: 51
Joined: Fri Apr 27, 2012 12:33 pm

How Can I refresh Databaseviewer automatically ?

Post by memethemyn »

Hi..

In my Pump Test System Project I have to refresh databaseviewer automaticaly each 500 or 1000 miliseconds. How can I do this?

Thanks Already..

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: How Can I refresh Databaseviewer automatically ?

Post by mark.monroe »

You need to rerun the query every few seconds. First create a periodic timer, and then run the SendSelectQuery function. The timer should only run when that particular screen is opened and stop when it is closed. Rather than creating the timer in a script module, you can create it in the screen that includes the Database Viewer component.

Code: Select all

DatabaseViewer1.SendSelectQuery("Select * from DataLogger1", "Database.sdf");
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

memethemyn
Posts: 51
Joined: Fri Apr 27, 2012 12:33 pm

Re: How Can I refresh Databaseviewer automatically ?

Post by memethemyn »

Mr. Mark..

I will try timer script as you show. But I have another idea as using demo controller and C1 register to use as a periodic timer. I tell you the way I followed step by step.

First in tags page i choose the demo controller.
Then I set a variable as C0 as shown on the picture.
When I want to write script into the controller I press Ctrl+Space but DatabaseViewer1 not shown in the box :( Only DatabaseViewer Shown in the box.

Will this way be an other way to create periodic timer. Because it is simple then scripting for me :)

Thanks Already...
Attachments
4.JPG
4.JPG (123.12 KiB) Viewed 31305 times
3.JPG
3.JPG (136.59 KiB) Viewed 31305 times
2.JPG
2.JPG (53.3 KiB) Viewed 31305 times

memethemyn
Posts: 51
Joined: Fri Apr 27, 2012 12:33 pm

Re: How Can I refresh Databaseviewer automatically ?

Post by memethemyn »

any help :(

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: How Can I refresh Databaseviewer automatically ?

Post by mark.monroe »

A component is only available on the page where it is placed. Otherwise you get into a situation where you are trying to access a component that has not been created. Since it is only created/available when that screen is open.

You could associate an AnalogNumeric box with your "timer tag" on the screen where you want to refresh the DatabaseViewer. Then uncheck the "Visible property" of that box. Now go to the script window on the screen and put your code in the "ValueChanged" event for that invisible AnalogNumeric box. When the value of the tag that is associated with the AnalogNumeric box changes, its "ValueChanged" event will fire, and your code will execute.
Snap 2012-06-18 at 07.38.58.jpg
Snap 2012-06-18 at 07.38.58.jpg (38.89 KiB) Viewed 31290 times
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Post Reply