LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add a case to a case structure programatically

Hi!
Is it possible to add a new case to a case structure by doing it
programatically? If yes, perhaps anybody can tell me how?!
Thanx a lot,
Oliver.
0 Kudos
Message 1 of 7
(3,236 Views)
No you cannot programatically add a new case. However, there are methods like plug-ins (see Examples>Programatically Controlling VIs>Dynamically Loading and Calling VIs) that give you a lot of flexibility. What exactly are you trying to do?
0 Kudos
Message 2 of 7
(3,236 Views)
I try to explain my plan with an example:
I have a few pre-define animals with some attributes: Each pet is one case.
For example: The dog has 4 legs and is a pet. The next case is the tiger. It
has 4 legs and is a wild animal.
Now a want to add a new user defined animal (a new case) , for example a
parrot with two legs.
Perhaps you get an idea of my problem. I think I have to realize it with
some files, in which I write the data.
Or do you have another idea?
Thank you,
Oliver.
0 Kudos
Message 3 of 7
(3,236 Views)
Hi Oliver,

what is about sorting your animals in a cluster, in which you have a name,
no. of legs and other attributes.

Niko
0 Kudos
Message 4 of 7
(3,236 Views)
Oliver Meike wrote:
> I try to explain my plan with an example:
> I have a few pre-define animals with some attributes: Each pet is one
> case. For example: The dog has 4 legs and is a pet. The next case is
> the tiger. It has 4 legs and is a wild animal.
> Now a want to add a new user defined animal (a new case) , for
> example a parrot with two legs.
> Perhaps you get an idea of my problem. I think I have to realize it
> with some files, in which I write the data.
> Or do you have another idea?
Why not...

Use a cluster to hold the attributes of one animal.
Then you can create an array of clusters to hold your database
of animals (for that is what it is).


> Thank you,
> Oliver.


--
Remove "spamkill." when replying to this message
0 Kudos
Message 5 of 7
(3,236 Views)
The idea is not bad, but I want to keep my new added animals even if I
restart LV.
Is there another idea?
Thanx, Oliver.
0 Kudos
Message 6 of 7
(3,236 Views)
Anytime a user adds an animal, save the contents of your array of clusters in a file (e.g. a delimited text file). When your program starts up the next time, read the file and use a write local variable or a porperty node (.value) to display the previously stored data.
You may also want to give the user the ability to delete an animal or to sort the animals, etc., which you can do by manipulating the array and writing it back to the local variable.
0 Kudos
Message 7 of 7
(3,236 Views)