From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-03-2021 09:26 PM
I'm trying to use the 3rd party Offline Maps plugin in my main UI - but it's quite laggy and bogs down the whole State machine. So, I ran it in a separate loop under the main state machine loop and changed the execution to "Standard" so that both while loops get their own thread. This improves performance, but I have to wrap my head around starting/stopping/restarting this 2nd loop. Should I use a queue for this and build a state machine for the 2nd loop or is there a more efficient way? Maybe I'm over-complicating the whole thing?
I wouldn't mind having it as another separately-called VI, as I have a number of them (mostly-headless) that the master UI launches and communicates with via queues, but then the map UI elements aren't in the same VI window.
Solved! Go to Solution.
01-04-2021 07:35 AM
From your description a seperate loop and a queue is the way to go.
Certainly don't have any code which takes a long time to execute in your loop with your event structure. This will cause blocking behaviour of your UI and is how I suspect you had designed it to begin with.
A good design would be to have your event structure waiting for any user events which are then handled by a separate loop, information (Like what event has been occured) should be communicated with a queue. This means your UI won't totally freeze whilst code executes, although if the code relating to one event does take an inordinate amount of time to execute it will prevent other events being handled.
If this is the case have a seperate loop for your inordinately long code.
This obviously doesn't scale overly well, but to give more advice we would really need to see what code you have done so far and a slightly more detailed description of what you are doing with this map. Actual VI's please rather than pictures. It sounds like there may be a lot of dependencies in your code so zip them all up and post everything...or even better simplified version of what you are trying to do.
01-04-2021 07:37 AM
Also, personally I would steer clear of playing with execution priority. It has never solved any of my problems, and even if it did I suspect it would be a treatment of the symptoms of a more fundamental problem which should be addressed instead
01-05-2021 02:52 AM
@chops88 wrote:
I wouldn't mind having it as another separately-called VI, as I have a number of them (mostly-headless) that the master UI launches and communicates with via queues, but then the map UI elements aren't in the same VI window.
Ignoring the questions of performance or configurations, you can insert VIs into subpanels, which do make them be part of the same window. Presumably your map control is a .NET control, which is slightly trickier, because those are drawn as their own window, but for most cases the implications from that are probably not relevant.
01-05-2021 05:58 PM
I had one event structure in the main loop, and another in the map loop. But I just wasn't aware of SubPanels before so I think that's probably going to solve the problem entirely - let alone having the ugly mess of 2 fairly complex state machines stacked on top of each other in the diagram.
On a side note, since starting with Labview a few years ago I've gotten a lot better at other languages in the meantime and I gotta say, sometimes its really nice to see the code in front of you visually, but debugging on a remote target is painful, and my god wiring is really tedious. I'd love it if there was some AI in the backend that reviewed common design patterns, your design history and suggested things intelligently. I do use Ctrl-Space lots, but some thoughtful help would be a little easier than rt-click, 7 context menus, place, wire, wire, wire, wire, wire, wire, s*** I mis-wired, unwire.... clean up wires, wire. wire wire... lol These are the times I miss the keyboard as the primary input method.
Appreciate the offer to look at the design - not sure I'm allowed to pass anything along for IP reasons, etc.
01-06-2021 12:50 AM
For commonly used things, there are a number of options you could go for:
01-06-2021 08:01 AM
You know, I boasted once that it took me over a year to miss a semicolon after switching to LabVIEW!
Of course, I still can't drive a sideways mouse but, my right-click finger is REALLY strong!
If you splurted your coffee on your keyboard reading this ....you got it!