1

I have represented some WW-objects in some Excel sheet and I need to create a CSV file that Wonderware accepts. That is, I need it in the "WW-format"shown here.

enter image description here

I am working with VSTO AddIns and everything should be done in C#. So are there some somewhat easy way to transform my WW object into the above shown or will I have to create everything manually?

  • I'm not sure what you're trying to achieve. Are you trying to create an object in a galaxy by importing a CSV file describing object's attributes? – PiotrS Aug 23 '19 at 09:22
  • There is a toolkit (DLL) called GRAccess, you can use that to read information about objects from a galaxy or to create/modify objects. I've used that to create a "galaxy builder" in C# that created galaxy objects from CSV in SP2012, SP2014 and SP2014R2. I'm not sure if it's still needed in the latest SP or if there's a built-in tool now. – PiotrS Aug 23 '19 at 09:25
  • I'm just a developer trying to automate other peoples work. I have sheets that contain the WW objects. Let's say I have an Excel-sheet representing four WW-objects with 15 setpoints each. What I need is then to generate the CSV-file with the data from the Excel sheet but that WW-acceptable file has some shitty syntax. From what I understand, I need to go the opposite direction of what you did. I need to generate the WW-object from Excel data. Just wondering if I have to manually create the WW-accepable file from scratch or if there's a better solution – PardonMyCheckmate Aug 23 '19 at 10:09
  • I also just don't understand the file. Like what does the hundreds of 0 represent that corresponds to ConfigVarSecurityType and so on? I just have no clue how to read and understand the file and Google gives me little @PiotrS – PardonMyCheckmate Aug 23 '19 at 10:28
  • Your Excel-sheet looks similar to files I've worked with when developing galaxy builder. I agree the format is not intuitive and difficult to understand if you don't know System Platform well. What is the planned workflow here? Based on your description so far I can think of 2 options: A: 1. Someone creates XLS file with parameters of objects 2. Your software transforms it into CVS 3. You import the CSV into ArchestrA using Galaxy Load B: 1. Someone creates XLS or CSV file with parameters of objects 2. Your software creates the objects in the Galaxy using GRAccess toolkit (DLL) – PiotrS Aug 23 '19 at 11:06
  • Let's take it from the beginning. I have developed a VSTO AddIn that allows the PLC-developer to generate ranges in Excel that contains the WW-object. Let's say my PLC-man needs an object of 20 setpoints and 3 instances then one single button will create that. Then first the PLC-developer populates the fields that he knows about (DataBlock, DataType and so on) and saves it. Now the WW-developer opens the same sheet and populates the rest of the data (Attributename, modulename and so on). [CONTINUED] @PiotrS – PardonMyCheckmate Aug 23 '19 at 11:12
  • Alright now all the data is inside my worksheet and now I need to generate a CSV-file that ArchestrA accepts and this is where it gets convoluted. I need to generate a file like the one that I posted in OP but that's somewhat of a task. Like let's take ConfigVarSecurityType, that setpoint alone has a long string of "0,0,0" - we're talking 500 0's. And I've no idea what this means. I'm not even sure if the file I'm looking at is including of data or if it's just of an empty object. – PardonMyCheckmate Aug 23 '19 at 11:14

1 Answers1

2

Based on discussion in comments I can recommend this:

The file you shown in your post is most likely produced by ArchestrA -> Export -> Galaxy dump. I understand you want to programmatically create a file in such format (resembling galaxy dump csv) and then use it to perform Galaxy Load in ArchestrA. To understand the meaning of different columns in galaxy dump I suggest you start by reading these sections of the Application Server User Guide: Application Server User Guide - TOC

This will give you overview, but won't answer all questions, for example ConfigVarSecurityType is not even mentioned. Some of these columns are just "This is what it has to be" without the need to deeply understand. So what I'd recommend next, is to create a simple object in ArchestrA with few attributes of different types and different access settings. Then export that object to CSV, then change some attribute's properties and export again to see what has changed in CSV. Then try to change things in CSV, load it into the Galaxy and check in ArchestrA if the changes are what you expected. Through this exercise you'd learn the structure of the CSV and then you'd be able to write the logic to create a file like this in C#.

An alternative approach is to use GRAccess toolkit and develop a software that directly communicates with the Galaxy repository to create and modify objects (i.e. you don't need the galaxy load step). In my experience GRAccess is not intuitive at all, the documentation is not super clear but it's rather complete. GRAccess approach gives you better control of importing/creating objects e.g. you can decide what to do when an object or tag already exists and you can interact with the user (e.g. ask skip/overwrite?) while importing.

If you Google "GRAccess Wonderware" you can find several examples how people use it to manipulate their galaxy objects programmatically.

PiotrS
  • 180
  • 3
  • 16