-
Posts
1,981 -
Joined
-
Last visited
-
Days Won
183
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by drjdpowell
-
Thanks, it’s working fine now.
-
References deallocate when their owning VI hierarchy goes idle. When calling by reference synchronously, as your doing, the dynamic VI is running under the hierarchy of its caller. When one uses the asynchronous methods (“Run VI” or ACBR Fire-and-Forget) then that creates a new VI hierarchy. Added later: using ACBR Call-and-Collect also creates a new hierarchy (I’ve not used it before); the following mod causes the reference to deallocate. You can figure out what hierarchy a VI is running under by using “Call Chain”. With the original version, the call chain of “ThrowDVR.vi” showed it to be running as a subVI of the calling VI.
-
Shared clone reentrant execution. How can I get clones shared?
drjdpowell replied to _Y_'s topic in LabVIEW General
Perhaps it would be best if you explained what you’re trying to do.- 4 replies
-
- asynchronous
- reentrant
-
(and 2 more)
Tagged with:
-
Looking at this one, I would get rid of the child classes entirely and just have two VIs, “DisplayMessage-Bool” and “DisplayMessage-Numeric”. But this is perhaps because the example is (as most examples are) a very simple case. Even with child classes, though, I would just rename the methods. I’m not sure it is desirable to "contractually require functionality in subclasses”. That’s the author of the parent class trying to constrain and dictate the design of every yet-to-be-thought-of child class. Too easy to over-constrain. “Must override” and “must call parent” are different in that they are often actual requirements to make the child class function with parent-type code, and thus it is reasonable for the parent’s author to dictate this.
-
Just my two cents, but as the designer of a child class, I wish to have my child objects function properly in code written for the parent (and thus am interested in overriding and/or calling parent methods where required), but I am not actually interested in being required to do things with code written for the child.
-
Shared clone reentrant execution. How can I get clones shared?
drjdpowell replied to _Y_'s topic in LabVIEW General
The “shared clones” setting affects operation of statically-called VIs (such as an ordinary block-diagram use). Dynamic use depends on the options to the “Open VI ref” function; in your case option 0x8 creates a new clone with each use (with “auto dispose ref” you are destroying the clones and just reusing the clone numbers in new clones). To use “shared clones” dynamically, look at the NI example "AsynchronousCallAndCollectUsingOption0x40.vi”. — James- 4 replies
-
- asynchronous
- reentrant
-
(and 2 more)
Tagged with:
-
I was just recently sorely wishing NI-IMAQ had by-value image frames. — James PS to manigreatus> have you considered turning it inside out; make a by-value object and keep it in a DVR if (and only if) your application needs it?
-
That code should work fine without the DVR. It shouldn’t hang the application. — James BTW> look into “Variant Attributes” as a higher-performance way of doing look-ups like that.
-
Organizing Actors for a hardware interface
drjdpowell replied to Mike Le's topic in Object-Oriented Programming
One can have a “Hardware” actor, that is the only process to actually communicate with the actual hardware. That actor pulls from the hardware, but pushes status changes to other actors. [AQ may be thinking of this “Hardware” actor rather than the actual hardware.] -
Random comments: 1) An “action engine” is a by-ref construct very similar in use to a DVR, so I don’t understand how you could have experience application hang with an action engine. Having an action engine with a DVR inside it seems redundant and overly complicated. 2) I actually have some mixed by-val/by-ref objects, but they are “naturally” that way, because they are a by-value object that “decorates” or extends a reference. For example, a “configurable forwarding address” which wraps a communication reference (queue, etc.) with by-val instructions on how to modify messages sent to this reference. I also have some mixed objects that I would probably have been better off making entirely by-ref.
-
Sequencing alternatives to the QSM
drjdpowell replied to PHarris's topic in Application Design & Architecture
One other useful technique is to create an “abort” notifier in your “Controller” process, pass this as part of a “Do<whatever>” message, and have the execution loop check this notifier at appropriate points. It can even use “Wait on Notification” in place of any “Wait” nodes it might require. Package the “wait on notification” inside a subVI that outputs a “process aborted” error cluster, and you can stick it in any chain of subVIs sequenced by the error wire. — James PS to Daklu> I was excepting you to mention a true state machine as a “Sequencing alternative to a QSM”.- 17 replies
-
- qsm
- queued state machine
-
(and 2 more)
Tagged with:
-
Organizing Actors for a hardware interface
drjdpowell replied to Mike Le's topic in Object-Oriented Programming
If you’re following the Actor Model then actors should not share data by-reference. This means that different Actors often must either keep a copy of the info they need, or request the info from other actors when needed (the first option is probably best). For your “Resistance=5” example, the UI could send a “Set Resistance Request” Message, and the Controller would check the value against its copy of the parameters. If invalid, it would sent a “Resistance=<old> value” back to the UI, followed by some message to display a warning to the User. If valid, it would send a “Set Resistance” message to the Hardware Actor. The Hardware would then send a “Resistance Update” message to the Controller, who would send a copy to the UI. -
Funny, I got my CLA late last year with exactly the same set of marks, 10-16-18-26, with an architecture quite different than the example. I was annoyed by the low architecture mark, as I felt the architecture was complete and solid. — James PS. I was particularly annoyed by a comment of "Architecture not abstracted to switch over to field hardware.” I used abstract parent classes, with “Simulated” child classes injected at runtime, and a large comment explaining the intention to replace the simulated modules with hardware ones as required.
-
Those VIs work fine for me, and they don’t contain any references to subVIs that aren’t part of the standard LabVIEW package. You might have a problem in your LabVIEW installation. I would suggest you try reinstalling LabVIEW.
-
Be more specific. What “example VIs” are you talking about?
-
How to handle extra data in a queue?
drjdpowell replied to george seifert's topic in Application Design & Architecture
And one can have a single task waiting on multiple notifiers, which is also event like and something one can’t do with queues (though, unlike with the event structure, the notifiers all need to have the same datatype). -
Look into “local variables” and “Property nodes (Value)”. Both can read or write to both controls and indicators.
-
LAVA was down for some kind of upgrade around the new year. I suspect the problem is associated with that.
-
Tried it from a totally different location on a different computer. Same thing, same symptoms. Could someone else have a go at trying to upload something to the CR? You don’t have to actually complete the submission; just try and upload a file.
-
Open reference to a dynamic dispatch VI
drjdpowell replied to Vladimir Drzik's topic in Object-Oriented Programming
No. The static VI just calls the dynamic VI, passing in the class instance and so allowing dynamic dispatch. Below is the static VI I use: -
I still have the problem, and I can’t even upload images to the CR. Tried both uploaders and multiple browsers.
-
I am having a problem uploading a new version to the Code Repository, but you can download it from bitbucket. It is extended to work with multi-D (rectangular) arrays.
-
Now I can upload images to a post, but still not upload a new file to the CR: attachment=7615:ThisUploadFailed.png]
-
Is LabVIEW Object Oriented or Actor Oriented?
drjdpowell replied to manigreatus's topic in Object-Oriented Programming
Are they “orthogonal”? Actors encapsulate their internal data, and messages to the actor can be thought of as methods of an object.