LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using clusters as inparameters with GOOP

We're developing a system with GOOP, and have some thaughts about how to manage indata to functions in the classes.

Our first thaught was to create a strict type def cluster for each function, containing all the data nedded for the function (or perhaps two clusters, one for indata and one for outdata) and then using unbundle by name function whenever the data is to be used. If the data is to be passed on to another function, of the same class or a different class, this would demand a bundle by name funtion to enter the data into the cluster this function needs.

For this solution, however, it seems that we have to have the strict type def of the called function among the controls for the calling function. Just choosing the co
nnector of the called function, and then choosing cluster tools->bundle by name doesn't seem to suffice for LV to recognize the cluster.

Does anyone know a way to get around this problem?

Another question about GOOP:
What will happen if I have two objects of the same class, and do the same operation on both objects in parallel? Will this act as two identical vi:s running simultaneousely, or will one object wait for the other to release the vi?

Similar question about clusters in strict type defs for functions: Will changes to the strict type def of one object also happen for all other objects of the same class?

Sorry for a long an tedious question, but I'm thankful for help on this issue.
0 Kudos
Message 1 of 3
(2,539 Views)
I can answer a couple of your questions:

Your first question, to use bundling by name you have to have the same type cluster wired to the middle terminal of the bundler. You can get this structure by either installing a constant of the Strict typedef type on the diagram, or creating a front panel control of the proper type and the hiding it.

Your last question, if you change the structure of a typedef, the change will appear everywhere the typedef is used the next time the VI calling it is opened--which is sort of one of the main reasons for having typedefs in the first place.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(2,539 Views)
Martin,

> What will happen if I have two objects of the same
> class, and do the same operation on both objects in
> parallel? Will this act as two identical vi:s
> running simultaneousely, or will one object wait
> for the other to release the vi?

You are using the term "object" too often and some of your word choices makes it is hard to understand what you are asking. I have rewritten the question below:

What will happen if I have created two instances of the same GOOP class, and call the same member VI on two class instances in parallel? Can two calls the member VI run simultaneously if passed references to different class instances, or will one instance wait for the other to release the class member VI?

First, you should make sure the
class member VI is reentrant (VI Properties setting). This will ensure that it can run in two locations simultaneously. Once this problem is solved, both can run simultaneously if operating on different class instances. The gatekeepers here are the VIs called "Get Data to Modify" and "Set Modified Data". These acquire and release a mutex (aka Semaphore or Mutual Exclusion) on the object. Once a call to "Get Data to Modify" is run on an instance, no other calls to "Get Data to Modify" will return (for that object instance) until "Set Modified Data" is called to release the mutex on the class instance. The key here is that they only mutex an instance of the class, not all instances of the class... but you need to make sure that your member VI is reentrant so that you can call the member VI from two locations concurrently.

Good luck,

Jim
0 Kudos
Message 3 of 3
(2,539 Views)