11/9/2006 6:50 PM | |
Joined: 10/13/2005 Last visit: 9/3/2024 Posts: 33 Rating: (3) |
Hi. I would probably do like this. 1. Use controls on a WinCC page for showing the information from the external database. Controls like textboxes and labels would be the best ones for showing the information. 2. Use some other controls for input parameters for the query of the data in the external database. Controls again like textboxes but also comboboxes, listboxes and so on. Use a button control for updating of the WinCC page. 3. Execute some VBS or C script when the Update button is pressed. The script should use code that accessed the external database (using the parameters provided for the query). Also check the input parameters' validity before using them in the query (like that numeric input is truly numeric and perhaps also for sql injection code in the parameter input fields). You should probably use ADO (Active Database Objects) in the script for connecting to the database and then retriving the results with the sql command query. There's a lot of examples all over the net for how this works. Also try http://www.wincc.net. Show the results in the textboxes and other controls, either by putting the results straight into the controls or by writing the results to WinCC tags and then linking the controls to the tags. ADO works at least with databases likeMs Sql Server, Oracle, MySql and I guess any other datasource witch has a provider that can be used by ADO. 4. Use WinCC reports for printing of the information. Make a report that has fields linked to certain WinCC tags. Make a button in the WinCC page that says "Print report". There's a command that can be used in c-scripts for printing of WinCC reports (can't remember its exact name right now). But update the tags values that the report is linked to before issuing the print report command. Well. This would be one way. There's a fair amount of VBS or C code that would have to be written but not at all impossible. Hope this helps. |
Follow us on