06-25-2018 10:57 AM
I see the problem, and will have an answer for you shortly (about the source of the problem, and a beginning of a fix). But this points out a Very Important Lesson to learn when developing programs in LabVIEW:
Whenever you make a Cluster in LabVIEW, always create a TypeDef for (and use) it.
Another thing to be careful about is the order of elements in a Cluster. The order that the elements appear in a Cluster are not necessarily the order that they actually exist in the Cluster. For example, your FuncBlock_Cluster shown on the Front Panel has three elements: a Cluster IdFuncBlock_Cluster, an Array BaseArea_Array, and another Array LinkArea_Array. However, their actual (and "storage") order in the Cluster is BaseArea, LinkArea, and IdFuncBlock. [Incidentally, you probably shouldn't add _Cluster or _Array to the end of variable names unless it is really important for their function].
I'll be back shortly with more information after I play around a little with your Attachment.
Bob Schor
06-25-2018 01:09 PM
Problems/inconsistencies between GXML Data and FuncBlock_Cluster:
The following changes were made:
Oops, sorry to do this, but I've got to take a brief break, will be back shortly with code that I hope will demonstrate a possible solution (or at least a start towards one).
Bob Schor
06-25-2018 01:56 PM
Forgive the interruptions. Your example was in LabVIEW 2017, which I don't have readily available. I opened it in LabVIEW 2018, did some testing, then realized I had a problem sending you (a) a Version you could read and run, and (b) a Version that I could also test and "tweak", as needed. So I saved it as LabVIEW 2016 (which you can open and run just fine), and am attaching it here.
You'll notice that I'm sending you a LabVIEW Project, wrapped up in a Project File. It is a whole lot easier to develop LabVIEW code in a LabVIEW Project environment, not the least of which is that QuickDrop will find all of your Project elements when you type the first few letters of their name (What? You don't know about QuickDrop?).
Inside the Project file, you'll find the Project (just double-click it, and it will open, giving you access to everything), the Top Level VI (which I tend to give the prefix MAIN), and a folder, Types, holding the four Cluster TypeDefs. Here's a Snippet of the routine:
The code on the left builds the three elements of the Function Block Cluster. Notice the VI Icon sitting "on top of" the Bundle-by-Name function. When I created the TypeDef for the Cluster, I created an Icon for the TypeDef. When you put a Cluster (constant) on the LabVIEW Block Diagram, they tend to be "big and ugly", and don't give you any information as to what they represent. But a few Versions ago, NI added a nifty Feature (that I wish they'd extend to Arrays) that if you right-click the Cluster Constant, it changes into its Icon. And, if you made a Pretty (and informative) Icon, you get Self-Documenting Code!
The bottom two For Loops generate two Array elements. I took a "short-cut" with the first of these (sorry). Once the three Clusters were build, I assembled them into the Function Block Cluster, generated XML from this Cluster, and wrote it to an XML file. I then opened the File, read the XML, and Parsed it to produce the output cluster. Once you run this yourself, you can see how the XML file differs (in structure) from yours. Remember that I simplified the structure of BaseArea.
Bob Schor
06-26-2018 02:13 AM
Thank you very much for the information and suggestion, now i try to transform it in an array of this cluster but i couldn't, may you once more help, please. Thanks in advantage Your sincerely Michele
06-26-2018 04:36 AM
In the attach i try to create an array of cluster and it looks like work correctly, could be correct? thanks Michele