Jump to content

Question about LabVOOP and call dynamically VI


Recommended Posts

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

Link to comment

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

Link to comment

@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

nav_m.gifRefactoring 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

Link to comment

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

Link to comment

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 projects

Tomi

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.

Link to comment
  • 1 month later...

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

Link to comment

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

Link to comment

QUOTE(Tomi Maila @ Jun 5 2007, 03:35 PM)

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

Link to comment

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.

Link to comment

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. :nono:;)

Link to comment

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? :)

Link to comment
  • 3 weeks later...

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.