-
Posts
1,981 -
Joined
-
Last visited
-
Days Won
183
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by drjdpowell
-
Is it possible to remove a VI from a subpanel without the subpanel reference (just using the VI's reference)?
-
Can you get a strict VI ref without statically linking to the VI?
drjdpowell replied to Stobber's topic in LabVIEW General
I just tried making a strict reference constant a type def, and I could easily update it in multiple locations from the type def. -
Uh, my demo is command pattern over TCP. I needed to create two new classes and four simple VIs, and if you are willing to use standard Variant/Object messages for data then you only need one class and two VIs. One of those VIs (configuring the command with any meta info) is optional, so that leaves a single Command.lvclass:Do.vi as the only required. Surely this is simpler than any abstraction design, no?
-
Didn't like my "envelope" demo, eh? Personally I would drop the command pattern for the data message (using standard Variant or Object messages instead) and just use command pattern for actual commands. Then there is one class per message transfer, with server decoupled from client.
-
Can you get a strict VI ref without statically linking to the VI?
drjdpowell replied to Stobber's topic in LabVIEW General
You can also create a constant from a strict reference to the VI, then just delete the reference. -
How to find VIs still running in the background?
drjdpowell replied to Stobber's topic in LabVIEW General
Yes, I encountered the same problem with User Events. I now use a watchdog Queue separate from communication. No one ever posts data to this Queue; the watchdog just waits on it to be destroyed. When it does, it posts a shutdown message on the communication Queue/UserEvent (which is always created/owned by the receiving subactor). The watchdog does have to do polling, not on this watchdog Queue, but rather on the communication reference itself, as the watchdog must also abort itself if the subactor shuts down. An advantage of a watchdog Queue separate from communication is that the subactor can continue to receive messages from subsubactors that it has created, should it need to as part of its shutdown procedure. -
How to find VIs still running in the background?
drjdpowell replied to Stobber's topic in LabVIEW General
If your actors are dynamically called, you can use a Queue or other reference created in the top-level. When the top-level goes idle it destroys the reference and this can be used to trigger an error in the watchdog. I stopped bothering to write shutdown code for most subactors a while ago and happily hit the top-level abort button if needed. -
Note: I was on vacation when this conversation was going on, and I haven’t read it in great detail. I only use Command-Pattern messages in limited cases, favouring a variation on string-variant messages mostly. But the framework I use can do Command Pattern, and can decouple the command from the “serverâ€. So I made a test example. In it, the Client sends a request (non-command-pattern for simplicity) for a data message (DataAA.lvclass). As part of its reply “addressâ€, it specifies an “envelope message†(CommandAA.lvclass) that it wishes to receive the data message inside of. The TCP Framework keeps the reply address in flattened form while on the server side, so the server never needs to load class CommandAA. The “Do.vi†method of CommandAA.lvclass invokes the “Read.vi†static method of DataAA.lvclass. The methods one needs to write are Write and Read for the Data message, and Do for the Command (with an optional method to add metadata to the Command if desired). [aside: AQ proposed a slightly different form, where the Command class is a child of the Data Message Class; he would need an additional method to support building the Command from the Data message.] Command Pattern Uncoupling.zip drjdpowell_lib_messenging-1.2.1.29.vip drjdpowell_lib_cyclic_table_probes-1.1.0.8.vip
-
Hmm, your right, I seem to have a misunderstanding of what this package is for; it does state that it is to allow deployment of the list of VIs without the Vision Runtime license. Yet I felt sure that I needed this in a past project to access a key VI in development mode without Vision. Must have just needed it for an EXE. Thanks for the help.
-
Is anyone familiar with what functions are included with the Vision Common Resources download. This link seems to indicate a long list of functions, many of which don’t show up for me (for example “IMAQ Copyâ€). Is this link wrong (or is there something wrong with my machine)?
-
Can Event Structures Handle Big-Data Display Updates?
drjdpowell replied to AlexA's topic in User Interface
Just to be clear, I’m talking about using a Message User Event created by the receiving module, instead of a Message Queue, and passed to other modules so they can send messages. This is different that the archetypal User Event, which is created in the sending process and passed to other modules so they may choose to register. The later is usually a separate User Event for each strictly-type message, while the former uses a weakly-typed message like the Lapdog message objects you are using. Using a Message User Event is interchangeable with using a Message Queue, and avoids the extra work of sending messages from a separate event-structure loop. I don’t really understand why your “File IO” actor is displaying “Microscope Images”, but if it needs to do UI work like that, then why not use an event structure? -
Can Event Structures Handle Big-Data Display Updates?
drjdpowell replied to AlexA's topic in User Interface
Didn’t you already have that problem? If your “Do Action A” event sends a “UI—>CTRL:Do Action A” message to your second loop, nothing will actually happen till it finishes with “Somebody->CTRL:Do Long Running Action B”. -
Can Event Structures Handle Big-Data Display Updates?
drjdpowell replied to AlexA's topic in User Interface
I routinely use User Events to receive messages in anything that is a UI component, and often in things that aren’t a UI component (so I can give them a ‘debug’ UI if needed). To me, the topmost loop you have is redundant; it does nothing other than stream the Event Queue into the Message Queue, with no ability to do any actual work (since it doesn’t have access to any state information) and it requires you to write lots of extra build-and-parse message code. Pointless. -
Does LabVIEW really suit for OOP?
drjdpowell replied to Maxwell_Peng's topic in Object-Oriented Programming
I wouldn’t think this is central to OOP. And I would tend to say there is good reason to NOT share things in this way, keeping objects with a single “owner” and doing “Sharing” via asynchronous messages. If you do want to share, use a DVR. -
Terminals and local variables don’t use the UI thread, and are asynchronous to the Front Panel controls they represent (unless you set the “Synchronous” option). Property and Invoke nodes do execute in the UI thread.
- 6 replies
-
- timed loop
- optimization
-
(and 1 more)
Tagged with:
-
There is no direct way to write a cluster. Partly this is because there is no direct one-to-one correspondence between LabVIEW and SQLIte types; in particular, a LabVIEW string can be either text of binary (SQLIte Text and Blob types). Note that it is relatively easy to wire a long set of “Get Column” into a corresponding cluster bundle (or an unbundle into the corresponding “Bind”). That is part of the reason for making “Get Column” and “Bind” property nodes.
-
Whatever timing method you choose, you will get the maximum flexibility by making it a separate loop from your actual periodic task. Have the separate timing loop signal the main loop handling the task via some messaging method such as a User Event. That way the main loop is not constrained by the timing technique; the OP’s process could be reading data every 15 sec AND saving to disk every 5 min AND updating some UI element every 500 ms (by using three external timing loops). And as a message-handler, the main loop can accept (and immediately act on) other messages than just “stop”. Meanwhile, the dedicated timing loop can be made a reusable component (as it only does timing).
-
Why would he be handling mouse-move events in his data collecting loop? Handle that somewhere else. Any finite timeout is unreliable if there can be repeated events; your 100ms timeout would fail during a mouse move. The only reliable timeouts are 0, −1, and a timeout recalculated after each event based on the previous time the timeout case executed. Added later: actually, 0 isn’t that reliable either.
-
Use an Event Structure with a 15,000 ms timeout, registered for the Value-change event of the Stop button.
-
GOOP Development Suite v4.5 is released
drjdpowell replied to spdavids's topic in Object-Oriented Programming
An ‘empty’ object in LabVIEW is just the default constant of that wire type. So you can just ask if your ‘Dough’ is not equal to the default ‘Dough’ constant. -
PRAGMA synchronous = OFF
-
Unloading VI From Subpanel
drjdpowell replied to GregFreeman's topic in Application Design & Architecture
Also, isn’t this unnecessarily complicated. You already are keeping track of the communication references to these subcomponents; now your going to have to keep track of the VI refs of their VIs (plus whatever mechanism you use to get the VI refs to the top-level subpanel owner). An “Insert into the attached subpanel” message is trivially simple. -
Unloading VI From Subpanel
drjdpowell replied to GregFreeman's topic in Application Design & Architecture
Why does each VI have a copy of the subpanel reference? I would just have the top-level owner of the subpanel just send send the subpanel ref to the chosen subView, after calling “Remove VIEW”. The receiving subView would call “Insert VI” as part of handling the message, but wouldn’t bother saving the reference. -
LV Dialog box holds Open VI Reference
drjdpowell replied to eberaud's topic in Application Design & Architecture
Getting the ref with “Open VI Ref” is blocking, but increasing the size of the pool when needed does not, so there isn’t a need to prepopulate the clone pool. On my benchmarks adding an extra clone is about 1000us, while reuse of a clone in the pool is about 100us (LabVIEW 2011).