I am trying to find an automated method of converting a spreadsheet file containing a signals list into an XML format that corresponds to a LabVIEW cluster. See spreadsheet file.csv for example of signals list.
The cluster is made up of an array of three clusters (each containing 4 elements: name, data type, value and description) and an array cluster of group listings with 2 elements (group and array of tag names).
See Cluster to XML.vi for example. The output string shows the required format in XML.
First off, I've attempted to create the array of clusters. I'm not sure if this is the best method but this is what I've tried so far:
For Signal List 1, see signal list to XML (simple).vi, I indexed each row and inserted the elements into the cluster of arrays. For Signal List 2, see Signal List to XML.vi, I attempted to automate the process, incrementing the index value with each iteration. I tried this with a for loop, however it only allowed me to return a string value rather than array. When I use a while loop, I am able to insert the first cluster in the Tags2 but the process ends there.
How can I repeat the process for N number of rows?
Also another problem is I am unable to assign names to the elements in the clusters (name, data type, value and description). I tried indexing the arrays into elements and bundling by name, but only gives the name string as an option. I've tried to look online, but can't find much guidance.
How can I assign names to the elements?
Any help will be much appreciated!
I'm not entirely sure what you are trying to do, but have some comments that might be helpful.
Many thanks for your help.
I misunderstood the task given to me, so turns out I will be using python rather than labview to perform the csv to XML conversion.
Though I appreciate your time and suggestions!