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..
How Can I refresh Databaseviewer automatically ?
-
- Posts: 51
- Joined: Fri Apr 27, 2012 12:33 pm
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: How Can I refresh Databaseviewer automatically ?
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
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
-
- Posts: 51
- Joined: Fri Apr 27, 2012 12:33 pm
Re: How Can I refresh Databaseviewer automatically ?
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...
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 (123.12 KiB) Viewed 31286 times
-
- 3.JPG (136.59 KiB) Viewed 31286 times
-
- 2.JPG (53.3 KiB) Viewed 31286 times
-
- Posts: 51
- Joined: Fri Apr 27, 2012 12:33 pm
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: How Can I refresh Databaseviewer automatically ?
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.
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.
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer