-
Posts
453 -
Joined
-
Last visited
-
Days Won
30
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by Mads
-
To analyze large time series remotely I have a client application that splits the data transfer using two methods; It will break down the periods into subperiods that is then assembled into the full period by the receiver *and* if the subperiods are too large as well they are retrieved gradually (interlaced) by transferring decimated sets with a decimation offset. So, as a result of this I need to merge multiple overlapping fragments of time series (X and Y array sets). My base solution for this just concatinates two sets, sorts the result based on the time (X values) and finally removes duplicate samples (XY pairs) from it. This is simple to do with OpenG array VIs (sort 1D and remove duplicates VIs) or the improved VIM-versions from @hooovahh, but this is not optimal. My first optimized version runs through the two XY sets in a for-loop instead, a for loop that picks consecutive unique values from either of the two sets until there are no such entries left. This solution is typically 12-15 times faster than the base case (<10 ms to merge two sets into one set with 250 000 samples on my computer e.g.). Has anyone else made or seen a solution for this before? It is not as generic as the array operations covered by the OpenG array library e.g., but it still seems like something many people might need to do here and there...(I had VIs in my collection to stitch consecutive time series together with some overlap, but not any that handles interlacing as well). It would be interesting to see how optimized and/or generalized it could be solved. I have attached the two mentioned examples here , they are not thorougly tested yet, but just as a reference (VIMs included just in case...). Below is a picture of the front panel showing an example of the result they produce with two given XY sets (in this case overlapping samples do not share the same value, but this is done just to illustrate what Y value it has picked when boths sets have entries for the same X (time) value): Merging XY series LV2022.zip
- 1 reply
-
- 1
-
-
Ah, yes, thanks. The attachment in the original post is now without the OpenG dependency and has been converted back to LabVIEW 2018.
-
Many years ago I made a demo for myself on how to drag and drop clones of a graph. I wanted to show a transparent picture of the new graph window as soon as the drag started, to give the user immediate feedback of what the drag does and the window to be placed exactly where it is wanted. I think I found inspiration for that on ni.com or here back then, but now I cannot find my old demo, nor the examples that inspired me back then. Now I have an application where I want to spawn trends of a tag if you drag the tag out of listbox and I had to remake the code...(see video below). At first I tried to use mouse events to position the window, but I was unable to get a smooth movement that way. I searched the web for similar solutions and found one that used the Input device API to read mouse positions to move a window without a title and that seemed to be much smoother. The first demo I made for myself is attached here (run the demo and drag from the list...). It lacks a way to cancel the drag though; Once you start the drag you have a clone no matter what. dragtrends.mp4 Has anyone else made a similar feature? Perhaps where cancelling is handled too, and/or with a more generic design / framework? Drag window out of listbox - Saved in LV2018.zip
-
Getting from UID to object reference when owning VI was opened outside project
Mads replied to Mads's topic in VI Scripting
I was wrong, the reason this did not work was something else...So, I now have it working.👍 Thanks for all the help @Darren and @Rolf Kalbermatter -
Getting from UID to object reference when owning VI was opened outside project
Mads replied to Mads's topic in VI Scripting
For some reason that does not seem to be the right application reference either...Open VI ref for the owning VI in that context still returns error 1004. -
Perhaps not fully a scription question, but I am not sure where it fits better...(and perhaps easy to answer for anyone with a little bit more scripting experience than me too): Upgrading to LV2024 from 2022 I noticed that some shortcut menu plugin did not work anymore and the reason is that NI has for some reason redesigned the framework to always nullify any references a plugin might try to hand off to a dynamically called VI...To get around this you will either have to avoid using dynamic VIs (but this will prevent you from making plugins that stay open without blocking access to anything else until you close the plugin window..), or hand off UIDs instead of references. This is where I ran into an issue though; I can pass on UIDs, but to get from UIDs to a reference (event structure ref in this case) within a specific instance of a VI I only found this method: I successfully use the scripting function UID to GOBJ Reference.vi (found in the hidden gems palette e.g.) by feeding it the UID to the event structures I found. This also requires a reference to the owning VI though (which the plugin framework also will not allow me to pass without nullifying it), so I pass on the name of the owning VI and use Open VI reference on that to get the right VI instance....For Open VI Reference to get the right VI instance though I use the Project.ActiveProject node, read the app property of that and feed that to the Open VI Reference...and this works. The problem is that if the owning VI was opened outside a project the activeproject node will not provide anything...(I think LabVIEW could have solved this by having a "virtual"/"root" project for such VIs which would allow all code relying on project refs to work even in such VIs...but no). So...How do I get the proper application instance ref to feed into Open VI Reference if the VI does not belong to a project? Or alternatively; is there a way to get from UID to GObj Ref (in this case event structure references) that bypasses this issue? PS: The 2024 changed shortcut plugin framework seems to work in a slightly mysterious way as the refererences I might create based on UIDs received from it will *also* be nullified when the plugin finishes (not just references handed directly) - so the dynamically called VI that tries to work via the UIDs will have to make sure it creates those references after the plugin has finished with this cleanup... 😮
-
There is no change when it comes to Real-Time support now with 5.0.4 right? Still need to stick to 4.2 to use it on RIO-targets?
-
I agree, with the former😉 It is time to pause the planning to redecorate the kitchen when there is a fire in the living room (no matter how fire retardent the new paint is going to be).
-
Here is one quick draft of a VI for 2D searches. You might also save it as a VIM to use it on other types of 2D arrays... Search 2D Array.vi
-
One important thing to note is that if the application was built with the "Pass all command line arguments to application" key checked the OS Open Document event is never triggered 🙁 (come to think of it this might be why it has not worked as expected in the past 🤔). This might be a show stopper in cases where you *sometimes* want to be able to launch the app with additional/other arguments, e.g. to trigger some special behaviour. We do that to allow system administrators to disable some features in the application depending on the user's access, or point the application to an alternative configuration e.g..
-
Yes, it does work 🙌 When that tip first got out way back it did not seem to do the job properly, but it does now, in LabVIEW 2022 at least. I could not get the filter-version of the event to give me anything for some reason, but the regular does and it picks up opening multiple files together. (Looking at the issue again earlier I noticed VIPM e.g. still uses the helper app (VIPM File Handler.exe), but perhaps that is just a legacy / if it ain't broke, don't fix it thing. This is "supersecretstuff" too though, so trusting that it will continue to work is another issue.)
-
The "LVShellOpen"-helper executable seems to be the de-facto solution for this, but it seems everyone builds their own. Or has someone made a template for this and published it? Seems like a good candiate for a VIPM-package 🙂 (The downside might be that NI then never bothers making a more integrated solution, but then a again such basic features has not been on the roadmap for a very long time🤦♂️...)
-
Did you figure out this crash @smarlow?
-
Here is a good thread that covers various related scenarios: https://forums.ni.com/t5/LabVIEW/why-open-new-clone/td-p/2976973 Regarding the queue; if it is not in use anywhere (regular dequeue e.g.) so that the close can be detected there? If it is polled in the timeout you probably do not need to run that timeout every 10ms as that will put a high load on the CPU. For users to perceive things as "real-time"/instant anything below 300 ms or so will do. You can also wire the error wire directly to the stop terminal unless you have other cases there that generate a boolean, then using the status alone is more practical..
-
Not having looked at the details of the code you have, here is a quick general comment: If the dynamically called error monitor needs to close if the main VI closes I would not code that by having it monitor the boolean of the main (reading values using property nodes is not optimal in any case, globally or locally), but rather destroy the queue in main when it closes and then have the dynamic VI react to the queue erroring out, or use a dedicated user event, notifier or channel wire to message this (bidirectionally if needed). (There are countless ways to do this, all with their pros and cons. A named "System" notifier e.g. that is used for any part of the application that needs to know when to gracefully shut down, reload setting etc. is *one* simple solution that allows anyone to monitor it without polling or having anything pre-wired (just mentioning one such solution here is opening up for a bunch of protests from people preferring other methods due to cons with this particular method, but anyway...))
-
properties/methods for a serial port in FPGA: how to assign the port?
Mads replied to Jerzy Tarasiuk's topic in VI Scripting
Any code can contain errors. If you script the code you are just adding another layer where you can have errors (the script itself, in addition to the code it generates). When the script has created the code you still have to test the generated code to see if it works correctly. If you write it manually and test it (easier than testing scripts as you can test its intermediate steps directly as you progress) you can use that code for all ports, not just for one. Having to repeatedly create complex but similar code from scratch could justify doing it with scripting to reduce the risk of human errors, but here you can still handle it by having the code cover all scenarios and/or with code reuse . And much of the code has been written and tested for you already (examples) so all you need to do is add whatever extra functionality you need and test those changes. Have you tried solving this the easy way by relying on the RT OS and VISA support already, but observed that it does not meet the your reliability requirements? Or have you just assumed that it will not and are optimizing it prematurely, making the path to a working solution unnecessarily hard and complex?- 21 replies
-
- fpga
- serial port
-
(and 2 more)
Tagged with:
-
properties/methods for a serial port in FPGA: how to assign the port?
Mads replied to Jerzy Tarasiuk's topic in VI Scripting
Yes, I never said they did, but I did wonder why you need to script their creation.- 21 replies
-
- fpga
- serial port
-
(and 2 more)
Tagged with:
-
The top one, the SAC, will run even if the root loop is busy, AND allows you to set the inputs. This function was not available in LabVIEW until version 2011 or so. It is especially useful if you need your application to spawn VI clones to handle various events (TCP session handlers for example) regardless of what the user is doing in the GUI... The two bottom ones will be blocked if the root loop is busy, e.g. if the user happens to be viewing the time picker of a time control it will halt until the user closes the time picker. Before the SAC was introduced in LabVIEW you had to use the run method (bottom one) if you wanted to avoid having to wait for the dynamically launched VI to complete (it has the Wait until done input). The Call by reference node on the other hand had the advantage over the run method of offering control inputs to the call whereas the run method would require you to use set control invoke nodes for that. Here is a long thread about the root loop issue from before the SAC was introduced: https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Calendar-control-that-does-not-block-the-GUI/idi-p/1417794?search-action-id=359039184054&search-result-uid=1417794
-
properties/methods for a serial port in FPGA: how to assign the port?
Mads replied to Jerzy Tarasiuk's topic in VI Scripting
And to do that you can use the examples you find if you search for 987 in LabVIEW examples. But you are for some reason also trying to script the creation of such code, is that an additional requirement or could you just edit the examples and compile it into your bitfile?- 21 replies
-
- fpga
- serial port
-
(and 2 more)
Tagged with:
-
properties/methods for a serial port in FPGA: how to assign the port?
Mads replied to Jerzy Tarasiuk's topic in VI Scripting
The 987x modules *can* be accessed just like any other in-built serial port (using the VISA serial functions) as long as you have installed the 987x support package on the cRIO (option that should be available in the list when you choose to install the system image etc on it). No need to even think about their connection to the FPGA then. Now, before that support package was available you did need to add FPGA code, but even then that code is available as an example so you do not need to figure much out anymore...We used the FPGA-method 15 years back or so, now we just install the support package and use it with VISA.- 21 replies
-
- fpga
- serial port
-
(and 2 more)
Tagged with:
-
We do not have anything identical, but I do relate. The rate of critical bugs on cRIO seem to have risen. We currently have cRIO-9030 and 9041 devices that run fine for anything from 1 day to 3 weeks and then kills an application that we had no issues with prior to moving from 2018 to 2020. No worrying memory-, CPU- or disk usage up front - and nothing in the error logs. Tedious troubleshooting. There was a recall of some 9030s not so long ago too due to faulty components. On some there are even issues with the BIOS (>50% CPU usage when idle anyone...?). The known issues lists contain quite a few serious bugs too. Simplifying the RT application until the issue goes away is a tredious enough strategy. Add all the recent BIOS, OS, LabVIEW and driver issues and you are in a world of fun... Here is a similar scenario from 6 years ago:
-
Ah. Linux RT support is the big thing for us . We used ot have some VxWorks targets, but those are obsolete now. I'll revert back to 4.2b.