03-26-2010 09:57 PM
Hi all,
Can someone give me some practical examples for Flattened String to-from Variant VI? When I say practical, I don't mean examples that show what the functions do. I mean examples that show how are they used in a real situation, especailly for tesintg application. Can't view vi during this weekend, so please attach a picture.
Yik
03-27-2010 12:21 PM
This is useful if you want to convert a variant to a string, a situation which I would expect would be relatively rare. You can probably find an example in the OpenG config VIs - they treat the data as a variant and when they have to save an unknown data type, they probably use this to convert it to a string. The same can be done if you have a variant which you want to transfer using a serial or TCP connection.
Essentially, it would be limited to situations where you have a variant (which usually means you have a utility VI where you don't know the data type it will get in advance) and you need to transfer the data somewhere else (a file, another application, etc.), thus requiring you to convert it to flattened data.
03-27-2010 01:47 PM
Here is a case where I use the varient functions. In a nutshell I have a Test Exec machine that enqueues vectors read from a ini (sample attached). The queue contains a state that will run, the vector to test, and a varient of all data necessary for the exact state that will execute in the cunsumer loop.
The attache picture will give you an idea on how I read and write the state specific data to the device specific ini file.
Of certainty, I have masked some of the information as the project is propriatary but, it could serve as an example of when the feature is desirable.
In my test applications there a 4 major modules and three queues. The modules are UI, the Test Executive, the Test state, and the Display and all flow control is driven via the TEqueue, TSqueue, Dqueue and UI events. By using the varient data type I can re-use all of the test mainline and only need to edit the test state cases and some cosmetics on the Main GUI- 90% or more re-use.