-
Posts
453 -
Joined
-
Last visited
-
Days Won
30
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by Mads
-
The recommendations (from myself and others) were all covered in this thread: http://lavag.org/topic/15980-openg-filter-array-revised/ I summarized the recommended changes in this file. Not all the VIs in the library were changed, but most of the ones that repeatedly resize the arrays were modified to reduce the memory footprint and increase the speed.
-
The array functions were subject to a lot of discussion and rework here on LAVA in this thread back in 2012: http://lavag.org/topic/15980-openg-filter-array-revised/ At the time I was quite eager to get the improvements included in the official OpenG release. I made a complete replacement of the existing array library, back-saved it to 2011 and posted it there...but I could not see a way forward from there so I asked a question similar to yours on that thread. Ton then sent me a PM though asking me to recompile everything back to LV 2009, sign up on SourceForge, and send my SF ID to Jim or Jonathon. I got around to do the sign-up, sent the ID, did not hear anything at first, and then things got hectic at work so I dropped the ball. I've never picked it up since. Ideally it would be simpler to contribute, and the path to do so could be clearer. In the mentioned case I wished there was a way to just hand off the 2011 code to someone who would then do the boring tasks involved in getting an update released...But that's just not the case (at least that is my impression), and I'm not blaming anyone for it.
-
I have some architectures where different resources (COM-ports for example) are shared by handlers that are created dynamically to manage that single resource. Functions that need access to a given resource do it by contacting the relevant handler through its (single) input queue, and the message protocol requires them to provide a return queue for the reply. For historical reasons the return queue reference is not an actual reference, just a name generated by a given set of rules. So the handlers need to acquire and close return queues for every transaction. Typically each handler will do this 10-20 times per second, and there are typically 10-100 handlers running in one and the same application.The continuous acquisition of references has never caused any problems at these rates, and they are used in applications that (have to) run 24/7 on both PCs and PACs.
-
LVOOP with DVRs to reduce memory copies - sanity check
Mads replied to Troy K's topic in Object-Oriented Programming
I know you are asking if DVRs and LVOOP, but my first reaction was - why the nested while loops, why a functional global (and, if used, why not put the analysis and report functionality within it, at least that would eliminate some data copies), - why build the measurement array one element at a time (and if each measurement can be 100's of MB - perhaps it would be more efficient to put the temporary data on disk instead of in memory...) - and why not use for-loops instead, with auto-indexing... If you really can wait for all the measurements to be done before doing the analysis, you can skip the functional global and instead pass an array by wire. Use for loops with auto-indexing to make the indexing and memory allocation automatic. Building arrays one element at a time in a loop is costly, both in memory and speed (every execution of the build function triggers a data copy operation that just becomes larger and larger the bigger the array gets). In your case it is *very* costly due to the sizes involved. The most memory efficient way to build an array is to pre-initialize it to its final size prior to filling in the results (using the replace element function then, not insert) it with data. If the data type has a fixed footprint (i.e. not an array of variable length e.g.) LabVIEW can do it for you (and with the best performance) if you use a for-loop with auto-indexing on. If the footprint is unknown, but you have an idea of its upper bound at least - initialize an array to the maximum size, then scale it down after filling in the measurements (or up again by a factor if found to be too small somewhere in the process). Alternatively you can write the measurements to disk (unless that's too slow), then pass a list of paths or file references to the analysing function. If the analysis can and *has* to run in parallel with the measurements (to avoid halting the measurements), use the same model as has been done here to pass report data; use a queue (producer-consumer model). Perhaps the report loop can be merged with the analysis loop,or is there a need to analyse any quicker than you can report? All of this applies even if you make a measurements class and have different subclasses for each type of measurement (or type of output from a measurement...). -
The first use case I thought about for the new functionality was that I could use it for things like cursor moves and window resizing. Those are events that typically fire in rapid succession, require fast reactions, but only to the last occurrence. Prior to 2013 I've done this by reducing the handling of each event into setting a flag, which would then trigger a flag-resetting process elsewhere. This does not produce the same responsiveness though, and adds (what should be) unnecessary code.
-
Gave up the downloaders and downloaded the giant file with FileZilla instead. Probably, I've never seen any platform ISOs on the NI-site...it would be greatly appreciated if they did start to publish platform DVDs, having to wait for the physical ones is boring, and should be unnecessary these days.
-
Using VISA in an executable running as a service
Mads replied to MartinMcD's topic in LabVIEW General
We've never experiences any VISA problems from shut-downs...but if the software required actions to be done prior to quitting, I do not think the application instance close event would do the trick, it does not seem to fire when the service is quit from the services panel. Does anyone have a way to filter/intercept such an event and run shutdown code? PS. Uou should also have RunAsService=True in the executables ini-file so that the service ignores any user logoffs (see http://www.ni.com/white-paper/3185/en). -
And remember to vote for: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/New-build-option-Service/idi-p/943246
-
Platform ISOs? Have they ever done that? I've always missed having such available. Normally they just post individual components and we have to wait for the platform DVDs to build a proper installer for our VLM... The driver DVD is out though. There are downloaders available too, but they always seem to fail right at the end, at least from any of my computers.
-
Using VISA in an executable running as a service
Mads replied to MartinMcD's topic in LabVIEW General
We've converted most of our applications into services on regular Windows (95/Vista/7/8) targets using srvany, and they work without any modifications. Are you sure the app works properly in the first place, before being converted into a service? Does it rely on access to configurations e.g that it might not have access to when it starts up as a service? If that configuration file is expected to be in a system folder the servic emight not refer to the same folder...) The link you posted talks about VISA server, not the VISA-RunTime...and it's the RunTime that's needed for the service to access a local serial port. -
Every now and then I try using an XControl.. and get annoyed by its limitations. Graph annotations is another example... I just used the IP-address XControl here from the LAVA repository - it is a great use case, but the fact that you cannot tab out of this XControl like with other controls breaks the consistency of the GUI. I have not tried to get around it by modifying the code, but found a page on ni.com that says it's not doable. Is that really the case? Silly...
-
We use terminal servers for this all the time. Moxa, Advantech, Digi and Westermo. The virtual serial port drivers that come with these devices never (the ones from Digi might be the exception) handle network connection issues gracefully. If the network goes down for example, the drivers will freeze - and this can cause VISA to freeze or crash. However, if you use raw TCP/IP connections and write your own client (VISA has in-built functionality for this as well...I'm not sure if that's robust though), then you can make all of them work nicely.
- 7 replies
-
- rs232
- serial ports
-
(and 2 more)
Tagged with:
-
I've tracked down the crash that came after upgrading to 2012 SP1(f1); it is caused by an add-on installed with VIPM. Clearing user.lib on its own did not fix it, neither did moving things out of the project folder. But when I removed the add-ons from vi.lib the crash stopped. The funny thing though is that if I then just put back the stuff from user.lib the crash returned. So maybe there are multiple items crashing LabVIEW (both in user.lib and the other places)...I'll do some more digging.
-
After upgrading first to SP1, then immediately applying fix 1 - LabVIEW is no longer able to run without crashing with an access violation: "Access violation (0xC0000005) at EIP=0x00EFD480" A common/known issue, or was I just "lucky"?
-
If it's there as you say; Have you tried to open the front panel of the VI with an invoke node in the built application? If you do that you can hit the broken run-button on it (as long as the front panel was included) - and it will tell you why it cannot run. That's often the quickest way to troubleshoot dynamic VIs that refuse to run in the built app.If nothing else the feedback you get this way is quick and typically verbose. Have you tried copying the code and saving it in a VI with another name - and calling that one?
-
As the error says; the path is not valid, and even if it was fixed, you are not allowed to dynamically call VIs included in the application file this way, so you need to put it in an external folder and generate the path to that location. However, if you do not need the VI to be replaceable after the build then you could also just load it into memory by including it in a case structure where it will not be called. Put it e.g. in a true-case and wire a boolean control set to false to the case selector (before 2011 you could have used a false constant, but now such unused cases will be stripped out by the compiler, with a control they are not). With the VI forced into memory like this you can call it dynamically by wiring the name of the VI as a string to the Open VI function.
-
No such error when I run it (3GB files even). I removed the wait function altogether. Running LV 2012f3 32 bit. It's not just an update issue , if you hit F5 or reopen the directory the OS has not updated the number to its correct size? Does it happen on a number of different files and sizes (above 1 GB)?
-
This is the reason I've suggested the following idea... Solving this smoothly with external code will definitely be a challenge, and it might not be possible at all - at least not without introducing behaviour that will seem weird to the user.
-
How does an update of OpenG like this progress? Is there anyone who will start to evaluate putting any of the suggested improvements into an official release at some point?
-
I really hope they include it in 2013, or better yet, in a service pack. The longer it is allowed to be as it is, the harder it will get to get it changed I guess. And the more code we'll see using it, with bad performance as a result.
-
According to the LabVIEW 2012 Features and Changes it does not preallocate: Note The Conditional tunnel option performs memory allocations as often as the Build Array implementation. Therefore, just like with the Build Array function, National Instruments recommends you consider alternatives to the conditional tunnel in portions of your application where performance is critical. And a quick test I ran just now indicates the same; its performance matches that of a continuous build function. I think a change in this behaviour is planned for LV2013.
-
Auto-show/hide tree scrollbars - supporting multiple child text items?
Mads replied to Mads's topic in User Interface
The Tree_ShowScrollBar.vi sets each item as the active cell and calculates the width of its string. However that cell string is just the "Left cell string", not the item's full "Child Text", so it fails as soon as there is an item with such additional text. -
Auto-show/hide tree scrollbars - supporting multiple child text items?
Mads replied to Mads's topic in User Interface
Thanks. Managing the vertical scrollbar is relatively simple. It's the horizontal part that gets a bit tricky , at least if you have the rightmost column set to be "infinitely wide" and/or do not want to show the next (empty) column. If that was not the case I could use the same approach and use the "Number of columns"-property. Instead I'll probably need to calculate the width of the text in each column - and compare the widest item on display with the width of the tree. Not unlike how the mentioned vi.lib-VI does, but taking all columns into account. -
Has anyone made a VI that will show or hide the vertical and horizontal scrollbars of a tree control depending on whether they are needed or not? I've done one myself for listboxes, and though there was one already for trees (it's hidden in vi.lib\tree\Tree_ShowScrollBar.vi), but that one does not seem handle cases where the children have more than one text item. (You basically end up with those items invisible).