Thang Nguyen Posted April 19, 2007 Report Share Posted April 19, 2007 Hi, I am currently working on a project which requires both data acquisition and control the system. Because I don't have experience on the control side, so I don't know how to make a good architecture for the program. That why I need your advices. In my past projects, data acquisition, in the main program, I have two loops. One is get the event from the GUI, and the second one is processing the events, doing the sequential tasks. I work with OOP (GOOP & LabVOOP), so all of the tasks as logging and displaying are done by those objects. In the main program, I create all of the necessary objects, and then get the references from the controls on GUI. Then in DAQ process VI, I will call the Read VI of each instrument then pass the data to the Display object, Logging object. (I learned this from the GOOP example ) One of the issues of this architecture is I have to get the references of all the GUI and pass to Display object form the beginning then in the Display object, the process VI just pass the data to these references. This is not really flexible. If there are some events happen when the process run, I can not update those references immediately. I have to stop the processes, then change the input references. For example, I have some signals which are displayed on numeric indicators, and I have a check box for each signal to select weather it is plotted in the Waveform Chart. First, if I select 3 channels to be plotted, the display object will get the information though the initialize stage to display in the process VI. But if I want to select more channels, I can not update in the run-time, or I have to stop the process, and then update it. Could you give me some recommendations? I highly appreciate your time for reading and answering this question. Thang Nguyen Quote Link to comment
Kurt Friday Posted April 20, 2007 Report Share Posted April 20, 2007 Why don't you make a method which allows you to update the display object and call it within the event structure when you modify the channels to display? Quote Link to comment
Thang Nguyen Posted April 20, 2007 Author Report Share Posted April 20, 2007 QUOTE(SciWare @ Apr 18 2007, 10:18 PM) Why don't you make a method which allows you to update the display object and call it within the event structure when you modify the channels to display? Thank you so much, I forgot about it . One of the problem I meet with LabVOOP is I can not copy the class. The class objects and the icons in each VIs do not change automatically. Quote Link to comment
Kurt Friday Posted April 21, 2007 Report Share Posted April 21, 2007 QUOTE(Thang Nguyen @ Apr 20 2007, 12:12 AM) Could you tell me about the Data Store and Class store ref in the ObjectRefnums.ctl?I don't know where you create it. Thank you, Thang Nguyen Open up "Class".New.vi and you will see that a unique instance of the DataStore is created by opening a VI reference to the DataStore as reentrant and then adding the reference to the object cluster. This allows each object instance to have its own unique data store. Class store is called in "Class".ClassStoreGetRef.vi (not reentrant) and returns a reference to the object cluster so that it is available to class. The ClassStore is a repository of all the object instances, this allows the object inspector to get all the instances and to also check if an instance already exists when you are creating objects by name. Quote Link to comment
Kurt Friday Posted April 21, 2007 Report Share Posted April 21, 2007 QUOTE(Thang Nguyen @ Apr 20 2007, 12:12 AM) Could you tell me about the Data Store and Class store ref in the ObjectRefnums.ctl?I don't know where you create it. Thank you, Thang Nguyen Open up "Class".New.vi and you will see that a unique instance of the DataStore is created by opening a VI reference to the DataStore as reentrant and then adding the reference to the object cluster. This allows each object instance to have its own unique data store. Class store is called in "Class".ClassStoreGetRef.vi (not reentrant) and returns a reference to the object cluster so that it is available to class. The ClassStore is a repository of all the object instances, this allows the object inspector to get all the instances and to also check if an instance already exists when you are creating objects by name. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.