The VI's that Franz Joseph send me looked very promissing, Especially the
LV_structure_decoder library
written by William van Drent. However they did not work anymore under LV
5.1.1 (That's what I use).
I looked at both programs for a while to find the difference between LV 4
and LV 5.1.1 (where does it go
wrong). But the example (top VI) has 36 subvi's. I could not find the reason
maybe I should take a user
manual form LV4 and compare it to the LV5.1 user manual.
I already spent more than one day in total on this which is way more than
solving my immediate problem
would take. So I am leaving it for now.
I did build my own decoder, and I found out that the label name ARE in there
(I thought they were not,
I read over it in the manual). If only I could call it recursively it would
be easier.
Then the decoding of the structure should be combined with the flattened
data and I'm there.
If I want a cluster into ASCII I think I have to flatten the data and feed
both the type descriptor and the flattened data to the VI which should
return a string (the flatten to string can not be inside the VI, if you
create a control from the input of the flatten to string you get a date/time
cluster which in itself reveals a little bit from the code underneath).
So.... do you have a working solution under LV5.1.1 ? Then I would be very
interested!
RB.
Hans �hra wrote in message <8cf5jo$69p$1@news.ffi.no>...
>Hi
>
>I think I wrote somthing like what you are looking for, some time ago. The
>Vi was intended to take any type and write it to a configuration file and
>read back to the variable. It also decode clusters inside clusters, and do
a
>lot more. A screen shot of the cluster Person, and how it is decoded as
>string is attached. I also have some more complex examples of how it can be
>used.
>
>As someone pointed out the way of storing variables has changed in LV and
>the decoding only has been tested with LV 5.1. It sure not work for LV 4 or
>earlier.
>
>IT SHOULD HAVE BEEN A NI JOB TO INCLUDE A VI TO DECODE THESE STRUCTURES.
>
>Hans
>
>
>
>Remco Breen wrote in message
>news:954849346.228231@dibbs3.eur.cis.philips.com...
>> A challenge to all you wireheads out there:
>>
>> Is there somebody amongst you who is LabVIEW-nerd enough to create a VI
or
>> CIN to which you can wire any cluster and it will return a string
>containing
>> the elements of the cluster with their labels.
>> For instance a cluster containing the string "name", the U8 "Age"
>> and enumarated U8 "gender".
>> It returns:
>> "name: Harry
>> Age: 84
>> gender: male"
>>
>> I use clusters a lot to input and output values to and from VI's.
>> Sometimes these results are very suitable to be saved in a file or output
>> in a status window. If there was only a way to access the type definition
>of
>> a cluster (after all Labview gets that information from somewhere if you
>> attach a wire to something). Number of elements and per element type
>> and label.
>>
>> Persuing this a little further: Maybe a new function should be added to
>> LabVIEW which returns type information so you can build behavior like the
>> "add" function to which you can wire anything. Of course inside this VI
>you
>> 're building you have to create different functionality for different
>types
>> (case structure).
>>
>> But I would already be happy with the first thing I wanted.
>> The implementation I have in mind right now is a VI I wrote which request
>> the status of a serial device, the device returns a status byte, I turn
>this
>> byte into a boolean array and the array into a cluster. I use a cluster
of
>> named booleans which represent the possible errors of the device. It
looks
>> nice
>> on the screen and is easy to test using unbundle by name. Now I would
like
>> to log the errors....., the definition of what bit represents which error
>is
>> already in the cluster, why go through it again?
>> Another example, a VI request info from the device and returns (in a
>> cluster) address of the device (U8), the name (string), the BIOS-date
>> (string) and version number (string). I would like to show this
>information
>> in a status-line after I've initialized the device.....
>> Another example: I try communicating with a device. In a statusline I
>would
>> like to show:"Connecting using: Port: COM1, Baudrate: 28800, Databits: 8,
>> Stopbits: 1 , Parity: no parity". Apart from "Connecting using: " the
>labels
>> and the values are already in the cluster.....
>> I can generate a lot of these example and I'm sure you can too.
>>
>> I find myself wireing these things out and having to change them when I
>> change something to the cluster. A cluster cast to string would be nice.
>> Anybody any idea how to handle this (maybe using an ActiveX variant or
>> adaptation of flatten to string ???).
>>
>> RB
>>
>>
>
>
>