07-23-2013 10:15 AM - edited 07-23-2013 10:19 AM
Hi,
I have a large program where I am acquiring user input via nested strict type def's. The idea is that I can change/add fields in a centrally located control and have the rest of the program automatically adapt. One of the functions is to log these fields to a spreadsheet.
I am having trouble finding a programatic way to log the cluster to a spreadsheet. I have attempted multiple methods including some of the functions within openg as well as using variants.
Currently I am unpacking the clusters, converting all data types to strings, and building them into an array to send to 'Write Spreadsheet to File.vi'. It's apparent that this method is laregly dependant upon which fields are in the cluster and is by no means 'programatic'.
TIA,
Chris
07-23-2013 10:18 AM
One method I have contemplated is converting the cluster to an array and using a for loop to build a string to log to the spreadsheet. The problem I run into here, is finding a vi that tells me what data type the field is so that I can choose which data conversion to use.
07-23-2013 10:31 AM
One way to do this is to use property nodes.
07-23-2013 10:34 AM - edited 07-23-2013 10:35 AM
Adnan,
Thanks I will give this a shot.
Chris
07-23-2013 10:35 AM
No, it returns values. I understood your issue; you should try what I suggested.
07-23-2013 10:36 AM - edited 07-23-2013 10:37 AM
Yes, I see that, sorry. I missed the indexing of the loop and sub function.
You are actually a bit too fast on your response, I noticed this right after I posted and then changed my post. 🙂
Thanks again!
07-23-2013 10:50 AM
OK, so the problem I am having now is that this appears to work with a single cluster. Although when having nested clusters it produces a class name of 'cluster' for all of them since it is not going inside each cluster. The obvious solution for this would seem to be using a nested for loop to go another level deeper, although this is not an option, it will not index again.
Thoughts?
07-23-2013 10:53 AM
I could create a property node for each of the nested clusters within the original cluster, although with this I would lose the ability to change fields in the cluster and not have to make other changes within the program.
Chris