Thang Nguyen Posted April 27, 2007 Report Share Posted April 27, 2007 Hi, This is the first time I work with LabVOOP and call danamically VI. There are some issues I don't know how to solve. I attach here my test classes so you can run it. This program works with the simulator DAQmx. I have two classes. One is Instrument class. This class provides the function read from instrument. In this case it is DAQmx simulator. The second class is DAQControl. This class has a process VI which will be call dynamically and run parallel with the main VI. This VI and the remaining of the class transfer data by queue. I have problem with making this process VI run and transfer data to this VI. I hope you give me the solution. Appriciate your time for reading and answering this question. Thang Nguyen Quote Link to comment
Tomi Maila Posted April 27, 2007 Report Share Posted April 27, 2007 I took a look at your VI. First don't make your process VI a dynamic dispatch VI but a normal VI. So remove the dynamic dispatchness from the connector pane. Second you don't pass your process VI any data, not event the queue reference you use to pass data around. You need to pass the queue reference to your process VI somehow. One way to do this is to create a named queue. If a queue with the same name already exists you get a reference to this named queue. So create a named queue "ProcessQueue" in the "Launch Process.vi" and enqueue your object to this queue. Then create a named queue "ProcessQueue" in the "Process.vi" and dequeue the object from the queue. This way you can pass your object to your process VI. Just make sure it's not dynamic dispatch VI... Tomi Quote Link to comment
Thang Nguyen Posted April 28, 2007 Author Report Share Posted April 28, 2007 @Tomi: Thank Tomi, I finally make the process VI run. I did use the name queue to get the reference to the queue. I attach here my code. But I still have the issue with reading the variable with the class. I have the question in the topic Refactoring the ReferenceObject example in LV 8.2 http://forums.lavag.org/index.php?showtopic=3788&st=30of Jim Kring, and I am still working on it now. Currently, this process can only read one time, because it can not get the data of the channel anymore. It use the queue and it can only get the data for one time only. Hope you can give me some idea about this issue and advice how to make my code better. Thank you everybody, Thang Nguyen Quote Link to comment
Tomi Maila Posted April 28, 2007 Report Share Posted April 28, 2007 Thang, I would really appreciate if you would post screenshots of the relevant parts of your code instead of posting your complete projects make you questions as clear as you can not referring to other threads I'm willing to help. You must however understand that everybody me including reading this forum are busy and may not have time to start debugging other people's projects. That's why it's necessary to make answering the questions as easy as possible for them. The more prepared questions you can make, the better answers you will get and the more people can answer you. Currently most of the readers read your post but as it doesn't make any sence without following the links and downloading your project, the simply ignore it. Help your self by helping us. Tomi Quote Link to comment
Thang Nguyen Posted April 28, 2007 Author Report Share Posted April 28, 2007 Hi, Finally, I made it run. Actually I combine the example of Jim Kring, name queue of Tomi, and the solution to pass data in the GOOP Developer of Sciware. You are awesome :worship: . I am still studying. Could you give me any recommend to make it better? Highly appriciate your help. Thang Nguyen QUOTE(Tomi Maila @ Apr 27 2007, 12:04 PM) Thang, I would really appreciate if you would post screenshots of the relevant parts of your code instead of posting your complete projectsTomi Hi Tomi, I want to post the screenshots, but there are two many VIs in this project, so I don't know which should I upload. I will attach here some important screenshots. 1 is the main GUI 2 is create VI of the class instrument. 3 is the create VI of DAQ control, which will do the logging. 4 is the launch process VI 5 is the read data VI which read the current variable of the class. Quote Link to comment
Tomi Maila Posted April 29, 2007 Report Share Posted April 29, 2007 Hi, Make your instrument class generic and derive (inherit) your specif instrument from this generic class. This way you can later switch the instrument and your applications using the instrument class don't need to notice anything. Tomi Quote Link to comment
Thang Nguyen Posted June 6, 2007 Author Report Share Posted June 6, 2007 QUOTE(Tomi Maila @ Apr 26 2007, 04:22 PM) Second you don't pass your process VI any data, not event the queue reference you use to pass data around. You need to pass the queue reference to your process VI somehow. One way to do this is to create a named queue. If a queue with the same name already exists you get a reference to this named queue. So create a named queue "ProcessQueue" in the "Launch Process.vi" and enqueue your object to this queue. Then create a named queue "ProcessQueue" in the "Process.vi" and dequeue the object from the queue. This way you can pass your object to your process VI. Just make sure it's not dynamic dispatch VI...Tomi Hi Tomi, I used the name queue to pass data between the main VI and the process VI. But with this solution, I cannot create multiple instance of one class because the name queue is hard code. I still cannot figure out how to make this more flexible so I can create multiple intance for this class. Thank you, Thang Nguyen Quote Link to comment
Tomi Maila Posted June 6, 2007 Report Share Posted June 6, 2007 I cannot create multiple instance of one class because the name queue is hard code. Yes you can. Open a VI reference and use clone name property for the VI reference to specify the queue name. This is different for each instance so you get separate queue for each instance. Tomi Quote Link to comment
Tomi Maila Posted June 6, 2007 Report Share Posted June 6, 2007 EDIT: See Jim Kring's blog article http://thinkinging.com/2007/03/29/reentrant-vi-clone-name/ Tomi Quote Link to comment
Thang Nguyen Posted June 7, 2007 Author Report Share Posted June 7, 2007 QUOTE(Tomi Maila @ Jun 5 2007, 03:35 PM) EDIT: See Jim Kring's blog article http://thinkinging.com/2007/03/29/reentrant-vi-clone-name/''>http://thinkinging.com/2007/03/29/reentrant-vi-clone-name/' target="_blank">http://thinkinging.com/2007/03/29/reentrant-vi-clone-name/Tomi Hi, I am sorry but I still can not run my process VI, I attach here what I did First is the folder structure of the VI in the class Logging. Second is the create VI which I use the clone name for name queue. One problem is the clone name of this VI is different with the name on the title of windows. Third is the Launch Process VI which will has the name queue and call the process VI dynamically. Fourth is the process VI which use the name queue to get the data pass from the create VI. With the process VI, because I cannot open directly the clone of this VI so I cannot debug it. As Jim Kring told about debug with the clone, so please tell me how to do it. Please take a look, thank you for your time. Thang Nguyen Quote Link to comment
Tomi Maila Posted June 7, 2007 Report Share Posted June 7, 2007 I don't have much time to take a look at your stuff. A quick look indicates that you are using clone name for the create VI. This will not work as your create VI is not the one that is cloned by the process VI. So use the clone name for the process VI you are about to launch to create a named queue. Then inside the process VI find out the clone name of the process VI a second time to get reference to the same queue you already created for this particular clone instance. I may be able to give more detailed help at the end of the week. Quote Link to comment
Tomi Maila Posted June 7, 2007 Report Share Posted June 7, 2007 Thang, if you are ready to wait for a few more days, there will be something interesting coming up from the LabVIEW open source community that may help you to taggle your problems. I cannot go into detail yet. Tomi Quote Link to comment
Yair Posted June 7, 2007 Report Share Posted June 7, 2007 QUOTE(Tomi Maila @ Jun 6 2007, 08:05 PM) Thang, if you are ready to wait for a few more days, there will be something interesting coming up from the LabVIEW open source community that may help you to taggle your problems. I cannot go into detail yet. Tease. Quote Link to comment
Thang Nguyen Posted June 7, 2007 Author Report Share Posted June 7, 2007 I have no choice, but it sounds interesting . I will try to do now as what you told me. Quote Link to comment
Thang Nguyen Posted June 7, 2007 Author Report Share Posted June 7, 2007 Hi Tomi, I make it run now. These are two modified VI. Thank you so much. But please tell me how to make it better. Quote Link to comment
Tomi Maila Posted June 8, 2007 Report Share Posted June 8, 2007 QUOTE(Thang Nguyen @ Jun 7 2007, 12:11 AM) But please tell me how to make it better. In a few days you'll get the answer p.s. See also another thread: http://forums.lavag.org/index.php?showtopic=8394&st=0&gopid=31246' target="_blank">http://forums.lavag.org/index.php?showtopi...amp;gopid=31246 Quote Link to comment
Thang Nguyen Posted June 9, 2007 Author Report Share Posted June 9, 2007 One thing I need to ask: I can get the name of the clone process VI from the create VI because this store the link to the VI, and from the clone VI. But I cannot figure out how to get the name of the clone VI in the destroy VI to destroy these clones. Or we let them suicide? Quote Link to comment
Tomi Maila Posted June 12, 2007 Report Share Posted June 12, 2007 If you still have problems with this issue, please check out OpenG Active Object Template. Tomi Quote Link to comment
Thang Nguyen Posted June 27, 2007 Author Report Share Posted June 27, 2007 Hi Tomi, To build the executable file, do I need to put the process VIs in the Dynamic VIs and Support Files listbox? Thank you, Quote Link to comment
Tomi Maila Posted June 28, 2007 Report Share Posted June 28, 2007 QUOTE(Thang Nguyen @ Jun 26 2007, 10:18 PM) To build the executable file, do I need to put the process VIs in the Dynamic VIs and Support Files listbox? I've not tested building process but I guess the following should work. Place the whole class including the dynamically called process VI outside the executable. Tomi 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.