There's no easy way to do this properly within lanVIEW. By properly, I mean with standard functions.
I have implemented something like this in the past for reading and
writing INI files, and the best way I found was (contrary to the
version on the OpenG website) to pass a REFERENCE to a cluster into the
sub-vi, and then comb through the cluster (iteratively so that you can
have clusters in clusters and so on) and parse the INI file (Main
cluster.Sub-array1.Element for example). This way, I was able to
have an auto-adjusting INI file read and write function which adapts to
any input cluster I throw at it.
I can't post it, because it belongs to my employer, but if you need tips::
1) You can list cluster contents via VI server, and get a reference for each sub-element.
2) You can cast them to the correct data type by reading out the
Typedef and passing this to a CASE structure. You can then access
the correct properties for that data type.
3) Make very sure to close all Control references that you have
opened. This is probably the hardest thing to do, and gave me
quite a few headaches due to the iterative (and linked in my case)
nature of the references.
Oh, and performance can sometimes be a bit slow.
I am working on a newer version which should be significantly faster, but Sshhh. That's secret.
Hope this helps
Shane.
PS: One thing which isn't very nice is that it's only possible to
return a flattened cluster (String). Re-casting this will allow
data-flow to be retained. This creates many copies of the cluster
which may be a problem. Otherwise you can forget data-slow and
simply update the cluster without any inherent data-flow. Then
you need to read the cluster via the VI first (Sequence 0) and then
read out the already updated cluster terminal itself (Sequence 1).
Message Edited by shoneill on 08-11-2005 09:21 AM
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)