Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wonderware to Excel

Status
Not open for further replies.

EagleElectric

Electrical
Sep 15, 2003
1
I may be in the wrong place, excuse me if I am. I am creating a wonderware application and I need to create some reports. The reports are already made in Excel. I am able to export the data from wonderware to a .CSV file but I need to move the data to the report every 15 minutes. I have tried to create a macro in VBA to do this but Excel will not export the data more than one time on a time basis. I also need the data to be entered in consecutive lines on the spreadsheet depending on what time it is. I am having trouble getting excel to do this. Should I just have a macro that runs when the spreadsheet is open and have wonderware open the spreadsheet at the given times for the transfer? This seems like a lot of opening and closing of excel and I am trying to limit the amount of extra programs opening and closing due to using up the computer memory for extra functions. My question is is there a way to write a macro that this can take place without having to be proficient in Visual Basic or another language.....any help would be appreciated.......
 
Replies continue below

Recommended for you

seeing this inquiry brought back fading memories...

i understand that the report generator is excel; whereas, wonderware provides the data (csv files). you want to append to existing data? collected 15 mins earlier?

the statement" excel to export the data more than one time on a time basis" is not clear to me. perhaps you can clarify.

meanwhile, i seem to recall that wonderware has it own capabilities to generate reports or rather generate data files (csv) containing information to analyze. a suggestion is to generate the data files (csv) when required (i.e. 15 mins) and run excel to generate the report only 1/day.

please clarify.
-pmover
 
You can achieve want you want or at least something similar.

Here is what I have done in the past. I used Wonderware and Excel to create a power plant monitoring system. I used Wonderware just as a GUI. I performed all calculations in one Excel Workbook, stored them all in another Excel workbook, and displayed all the calculated points on Wonderware.

I used a modbus ddeserver to pull the information into my excel calculations workbook, where it updated every 10 seconds based on the settings in the ddeserver. I then linked the calculated values to the historian workbook which in turn also updated every 10 seconds. I then used a macro to essentially copy and paste the values every 5 minutes. I essentially had an open ended loop that would copy and paste the values every five minutes. This worked well as a crude historian. I also used dde to pull the information from excel into wonderware and display it.

I did all of this on old pentium II machines and they had no problem running all of these programs. The only thing that would slow down the system, was when excel would autosave the historian workbook every 30 minutes.

I am positive that you can build something that will suit your needs. Perhaps you could use dde to pull the info from wonderware into excel or from your ddeserver into excel. Then you could print your reports every 15 minutes or do like I did and create a large table that stored the values.

Here is the continuous loop Macro that I used to continually copy and paste the values in my historian workbook.

Sub do_loop()
Application.OnTime Now + TimeValue("00:05:00"), "Macro1"
End Sub

All this does is call Macro1 every 5 minutes. It worked pretty well.

Hope this helps.
 
We have had good success in small to medium size file application by simply setting the autosave function in Excel to save the file in CSV format and setting Wonderware to retreive the file as needed. You have to establish a Historian in Wonderware and play around with display formatting but it dramatically cuts down process demands on the host PC and saves storage space since you are simply overwriting the file everytime.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor