02-11-2014 02:37 PM
When making a new sub-VI that does work on arrays, for example, I try to make them self-contained so that I can test them easily with no upstream dependencies. This is easy to do by changing the array control on the front panel.
For class member functions, like a new static dispatch VI, all I see on the front panel is the class "cube" which execute with the default values of the class private data controls. Is there any way to change/set these from the front panel for testing?
Thanks.
02-12-2014 04:46 PM
Hi jordanglassman
That depends on the type of class you created. I mean, it depends on the class which the control has inheritance.
Please check this and tell us if it is helpful:
http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/creating_classes/
Thanks!
02-12-2014 04:58 PM
Why should inheritance matter? Let's consider a simple class, a class with several numerical members, X, Y, and Z. Now let's say I create a static dispatch member that does some complex algoirthm on the data members. I want to see if given a certain input class state, I get the right output, A, B, and C.
Is there any way to set the numerical input values, X, Y, and Z, from the front panel for testing? As far as I know, the only way to do this is to make/call the class initializer in a simple testing VI and then insert my SubVI in this VI. Easy, but a large extra step.
02-13-2014 10:13 AM
In some way it matters, but you are right, I did not understand the question.
Please read the last section of this link: http://labviewwiki.org/LVOOP_Frequently_Asked_Questions
I would also try the property node: Method although I am not sure if it is what you want
02-13-2014 11:34 AM - edited 02-13-2014 11:36 AM
It's not a simple solution, but you can create an xctl.
In the xctl. You'll set the data to type of class.
In the class, you give all your accessor methods you want to use as community scope and give the xctl friend access.
Then you write the facade to show your private data and handle the data events (example attached)
Here's a basic example with three numerics. And calling the DoSomething function with class cubes vs xctl.
Actually, there's another example loaded with LabVIEW: examples\lvoop\FriendshipCommunityScope
"I won't be wronged. I won't be insulted. I won't be laid a-hand on. I don't do these things to other people, and I require the same from them." John Bernard Books