First, my apologies if this has been covered elsewhere, but all of the posts I could find about this were quite old and addressed a slightly different situation. If I’ve missed an explanation somewhere please let me know.
I need to export a large amount of trend data from a Citect SCADA (now Aveva) application into a spreadsheet format (CSV, DBF, XLS would all be fine). The system is currently running Citect SCADA 2016 (a.k.a. version 8.0) on Windows 10. I am looking to export about 700 tags, which are sampled at 1 second intervals over a time span of several hours, so the amount of data is quite large.
Some years ago, I made a script which did this in the following way:
1. Open Microsoft Excel via the Exec() cicode function
2. Open a list of trends to export (from .INI file)
3. Get the name of the first trend to export from the list
4. Copy trend data to clipboard using TrnExportClip() function, with a user defined start time, end time and resolution (that is, time between the samples).
5. Paste into excel using DDEExec function
6. Return to step 3 and get the next trend name in the list, copy, and paste into the next column over in excel. Continue repeating steps 3 to 5 until all trends have been exported.
This worked fairly well when the amount of data to export was not too large (e.g. 100 tags instead of 700) and had a fairly low resolution (e.g. 60 seconds instead of 1 sec). However in this new project we need a lot of high resolution data as we are prototyping a new design of machine and need it for analysis, and the script is no longer practicable. We would like to run the machine for 10 or 12 hours and then stop and export the data at the end of the day, however the data is generated faster than it can be exported. With so many tags to export at high resolution, it might take 30 mins to export 1 minute of data.
I’ve done some research on this but all of the posts (here and elsewhere) that I could find relating to exporting trend data to a spreadsheet compatible format relied on similar principles, e.g. TrnExportCSV instead of TrnExportClip. I expect TrnExportCSV may be a little faster, but is limited to 8 tags in the one file, whereas we need many more. If I were to repeat the TrnExportCSV function over again in order to export all the data I would end up with nearly 100 separate CSV files, rather than 1 complete file with all the data (this is why I wrote the script to paste it all into the one file in the first place).
Citect’s process analyst is able to export the data to clipboard / file, but this presents other issues: the resolution is quite limited for a start (if I stretch the display window to 12 hours the sample time will be on the order of minutes rather than seconds) I would also have to add all 700 trend pens to the display screen before exporting.
There does not seem to be, from what I can see at least, an inbuilt function in Citect that does what we need. Even at the time I made it, I thought the script I made was fairly clunky and I wrote it mainly because I couldn’t find an alternative. However, I have the feeling that I am missing something which is probably fairly obvious. Exporting trend data to spreadsheet format is not a particularly unusual thing to want to do, and it seems unlikely to me that software that has been around for as long as Citect and is as widely used as Citect would not have implemented a spreadsheet exporting function, but I just can’t find it.
Does anyone know of a way to do this?
Thanks for your time,