Hello,
I am developing an application where operators will be doing some calculations and storing the results in a 1D array. These calculations will happen many times per day (~ 1000). So I would like to take the 1D array and store it into a table or 2D array. I can do this with variables using the type dyn_dyn_anytype, but I'm having trouble storing the 2D array into a DPE because dyn_dyn_anytype does not exist in PARA. I suppose I could create thousands of DPEs and store each 1D array into a new DPE, but I would like to avoid this method. (Unless this is the only way I can/should do it). Is there another way to store or archive 2D arrays in WinCC OA? Thanks.
Note: The end user wants all the data stored locally in the Raima DB for at least a week, and then the data will backed up on their main server (MS SQL).
How to save a 2D array in WinCC OA
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: How to save a 2D array in WinCC OA
I believe that the answer should be simple. You should not save an array like that in a datapoint element.
Remember that the Event manager will hold the realtime values of all datapoint elements in his memory. Your array sounds ( you say 'thousands' ) like a big array and sounds like something that should be in a file and not in a dp element.
You should not make the mistake of using The WinCC OA Raima database a relational database, because it is not. You solution might become a memory and/or performance monster. In the past we had projects that would :start up slow, redu switch was slow because people were storing stuff in datapoints that hardly ever changed.
If your array is small, then use comma-separated strings in a dyn_string. Do not use dpGet()'s all the time to acces the data but do a dpConnect() on the data and store the reuslt in a global dyn_dyn_float for much faster access.
Good luck and share the fun
Frenk Mulder
Remember that the Event manager will hold the realtime values of all datapoint elements in his memory. Your array sounds ( you say 'thousands' ) like a big array and sounds like something that should be in a file and not in a dp element.
You should not make the mistake of using The WinCC OA Raima database a relational database, because it is not. You solution might become a memory and/or performance monster. In the past we had projects that would :start up slow, redu switch was slow because people were storing stuff in datapoints that hardly ever changed.
If your array is small, then use comma-separated strings in a dyn_string. Do not use dpGet()'s all the time to acces the data but do a dpConnect() on the data and store the reuslt in a global dyn_dyn_float for much faster access.
Good luck and share the fun
Frenk Mulder
- vogler
- Posts:122
- Joined: Thu Oct 28, 2010 8:32 am
Re: How to save a 2D array in WinCC OA
instead of comma-separated string I would prefer to use jsonEncode/jsonDecode, so you don't have to care about encoding decoding stuff (e.g. replacing a comma in you data). But still keep in mind Frenk's words...
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: How to save a 2D array in WinCC OA
Hello,
the RAIMA database is used to store the current information and historical alerts.
The history for values is stored in the value archives.
Why aren't your writing the information directly to the MS SQL database instead of doing it only once a week?
Maybe then there is no need to save the information to the WinCC OA database too and only memory is used during runtime in the WinCC OA process doing the calculations.
Best Regards
Leopold Knipp
Senior Support Specialist
the RAIMA database is used to store the current information and historical alerts.
The history for values is stored in the value archives.
Why aren't your writing the information directly to the MS SQL database instead of doing it only once a week?
Maybe then there is no need to save the information to the WinCC OA database too and only memory is used during runtime in the WinCC OA process doing the calculations.
Best Regards
Leopold Knipp
Senior Support Specialist