LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question regarding DAQ/GOOP (Application Note 143)!

Dear Reader,

I have read Application Note 143 with a great interest, but have become a bit confused. I hope someone could clear the following problem for me!

In the mentioned application note (143) GOOP is discussed, and a climate control system example is used as an illuminating example. The climate control system has a cooler fan and a heater fan. These objects are separate objects and are not aware of each other. Ok, what happens now if the physical fans must be controlled with a single DAQ-card (AI/AO)? Is it then still possible to instantiate two parallell and independent fan objects, i.e. with two parallell and independent AO/AI loops, using only one DAQ-card, or does it take two cards to implement the pr
ogram this way?!

Grateful for your hint!

/M Eklund
0 Kudos
Message 1 of 3
(2,780 Views)
Hi,

You have encountered a classical problem in object-orientation, when two objects share the same resource, in your example, the DAQ-card. How do you handle this in GOOP?

There are of course a number of ways of dealing with this, but the key issue is to decide how to create and destroy the DAQ resource. The best way is probably to create a DAQ class that is able to handle multiple instance that share the DAQ-card. This is quite easy to handle inside a class, but much harder if you call the DAQ VIs directly from other classes (such as the heater or fan class). Once you have finished the DAQ-class, you aggregate this into the heater or fan class.

This way the Heater and Fan does not really know that they are sharing the physical DAQ card, they only see that they uses an instance of the DAQ class. It is the DAQ-class responsibility to handle the resource conflict between different objects of the DAQ class.

To deal with resource conflict within a class between multiple object, you probably have to create a common storage for all objects to store DAQ handles etc. One useful thing is to check nr of objects in the create method. This way you may find out if this is the first object created of the class (and thereby initate the DAQ-card). The opposite thinking is concerned in the destroy method (the last object should probably clean up).

GOOP does not directly support a common storage shared by all objects in a class, but that may easily be implemented by a simple shiftregister memory as a private method.

However, the new GOOP2, just released this August, does have support for shared attribute within a class, called "Class Attribute", which could be very useful in situations like this.

Please visit:
http://www.endevo.se/default.asp?lang=eng
and click on "Products". There are more information, downloads, presentations, white papers and examples about the new GOOP2, which together with the new GOOP Wizard 3, is called GOOP Inheritance Toolkit. This new GOOP has support for inheritance and also class attributes as mentioned before.

Regards,
Mattias Ericsson
Endevo, Sweden
Main developer of the new GOOP2 and GOOP Wizard 2 and 3
Message 2 of 3
(2,780 Views)
Hi Mattias,

thanks for the clarification! I will certainly try to solve my problem the way you suggested.

I hope to get the chance to work with GOOP2 in a future project!

Thanks again,
Mats Eklund
0 Kudos
Message 3 of 3
(2,780 Views)