Jump to content

Multiple override methods but no dynamic reentrant VIs

Recommended Posts

I am attempting to use LVOOP for the first time in an application and I have encountered a no-doubt common problem (I see direct and indirect references to the problem in this forum) but I am unsure of the best solution that allows for inheritance consistent with LVOOP design goals.

Problem: I want to instantiate several children of a single parent simultaneously. Any override methods that call the parent methods (the default when creating an override VI) cannot execute simultaneously since dynamic VIs cannot be reentrant. Some methods I would very much like the children to inherit (UIs, event response methods, time-critical methods) require parallel execution. How can I execute these methods in parallel while maintaining inheritance in the current LVOOP implementation?

(Not that it's necessary, but the "CreateGiftListWithLoopAndDelayOOP.vi"—where I have inserted a delay to simulate a function that requires a long time to execute—illustrates an example, admittedly somewhat artificial, of the problem, certainly not how one would in practice code it!)

Link to comment

Hi Paul,

I took a look at your example. Your example doesn't represent any problems. The problems in your example can be fixed by simply changing the delayed method to non-dynamically dispatched and reentrant. Would you like to share with as the real programming problem so that it would be easier to help.


Link to comment

Actually, Tomi, your response was helpful to me. I understood how dynamic terminals affect which VI to call, but I was confused about how they affect which data to use (data scope) if the method has no override. (It's simple enough now that I understand it.) I did what you suggested and it worked, of course, and I applied the same fix to some of the methods in my real project. I'm very happy about that--thanks! :worship:

The remaining question (where this all started for me, actually) is using a UI with controls that link to shared variables (network publish-subscribe variables with the DSC module). I want to use the same UI for each child class but have the controls link to the appropriate shared variables for the particular UI. I have tried two solutions:

1) Creating dynamic dispatch VIs of the UI where I bind the controls manually in the override versions. (This works but there is no inheritance.) This solution is attached. (ECS level.vi is the top-level VI and the FanUI.vis are the VIs in question.)

2) Changing the links from the controls to the shared variables at run-time. I would like to pass the shared variable names to the VI and change the links at run-time, but this (via an invoke node "DataBinding.Bind to Network Path") is only available when the VI is in edit mode, requiring a call from VI server (a workable but messy solution).

I would like to use a variation of method 1 somehow that retains some level of inheritance but I haven't figured out how to do this.


Link to comment

For the record, I was able to find a solution for my UI that uses shared PSP shared variables and maintains inheritance principles. I can write to the PSP shared variables using a DataSocket connection. I can specify the connection with a DataSocket Open inside the UI VI. This way I can use the same parent VI (no dynamic terminals) for my UI, since I identify the shared variables inside the UI VI from the class data and I write to these shared variables using a DataSocket Write. This methodology allows the UI VIs to use inheritance in the project. :thumbup:

I have attached my latest example (still very much a work in progress and not pretty since I'm still testing some basic ideas). (The next thing to do is to add functionality in the UI to subscribe to shared variable events arising from measurements elsewhere, which simply requires applying the methods here in "reverse"....)

I'm much happier now....


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.

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.