-
Posts
453 -
Joined
-
Last visited
-
Days Won
30
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by Mads
-
The RT Image folder does not seem to be updated with the newly released version 5 of OpenG Zip...How is the process to install it on Linux RT targets now? I looked for an .so file for 5.0 or an option to install it in NI Max, but have not found it yet?
-
So you do have modbus communication, but the problem is that you *sometime* get a timeout? You are able to read/write data from the device, it just is not stable? If so the serial port seems to be working and all you probably need is to tune the timeout parameter or troubleshoot the device that replies slowly or not at all on some polls...What are the timeout parameters in this driver and their values? I would connect a simulator instead to the port (ModSlave32 e.g. if the device is a slave,or ModScan 32 if it acts as a master...You can also run a trial of our Modbus Master that can be downloaded here: https://www.clampon.com/products/software/modbus-test-master/) that will let you view/ debug the communication (how often does it poll, do the poll commands look OK (can be verified in online verification tools e.g.) and does it timeout even if the simulator sent out a reply etc...). Using a simulator tool to verify that the connected device replies as it should if connected to that is also a good thing to do. (If that is not what you meant I would test this without involving Modbus or anything first. You can use a terminal program on the PC you connect to the serial port. We have one written in LabVIEW that simple to use, it can be downloaded here: https://software.clampon.com/ClampOn_Serial_Tool_CurrentVersion.zip On the sbRIO you can run one of the serial IO examples that just initializes the port, writes something and reads...then check with the terminal program if you get what you wrote and read whatever you send from the terminal program. Once you have basic serial comms workingyou can go back to the modbus driver and see if that has any issues when the basic functionality is OK. If it does you take it from there..) I've never had a need for NI Serial on any of our cRIOs or sbRIOs, only VISA and as you say the support for 9870/71 add-on...Perhaps they just list that driver as needed to cover the case where it is actually used with equipment that requires it? You could try to download the NI Serial driver separately, but normally NI Package Manager should present it as a possible option during software installation from NI Max, especially if you are using a system image.
-
NI Serial is not required for the use of serial ports built-into the sbRIO-9627, only VISA. So that is not the problem. I would try to simplify this down to a simple VI that initializes the port and tries to read or write to the port. Check if the initialization returns any errors and whether you get any data in or out of it (connect a PC with an RS485 uinetrface to the RS485 port and see). Note that if you are using 2-wire RS485 you will need to set the port in 2-wire mode for it to work... (I would also stick to the 2020 RT RIO-install instead of the 2021 system image, but that's an unrelated story... )
-
Issues building applications in LabVIEW 2023 Q3
Mads replied to Mads's topic in Development Environment (IDE)
No they did not have one (too busy with Emerson this time around perhaps), but they have opened one *now* to get feedback: https://forums.ni.com/t5/LabVIEW-Public-Beta-Program-in/bd-p/labview-2024-beta -
Issues building applications in LabVIEW 2023 Q3
Mads replied to Mads's topic in Development Environment (IDE)
Ran into another 2023Q3 issue with Matrix functions as well when buidling another application in the same project, the solution to that has been discussed here already though: https://forums.ni.com/t5/LabVIEW/Impossible-to-build-a-working-EXE-in-2023-Q3-if-matrix-functions/td-p/4327930 I'll test today if any of these issues have been addressed in 2024 Q1...(not discussed in any of the release documents so far as I can see). -
Issues building applications in LabVIEW 2023 Q3
Mads replied to Mads's topic in Development Environment (IDE)
Now that 2024 Q1 is released maybe we can just skip to that ๐ฎ It will be interesting to see if the issues highlighted in this thread has been resolved(?). -
Issues building applications in LabVIEW 2023 Q3
Mads replied to Mads's topic in Development Environment (IDE)
So far I have gotten around the main crash/freeze (now with the 32 bit version, but I will revert back to the 64 bit and test too) by recompiling the FPGA bitfile that the RT version of the code would deploy. I can understand that it is necessary, but not that LabVIEW is not able to handle it better and produce a recompilation request or any other type of explanatory warning... -
Issues building applications in LabVIEW 2023 Q3
Mads posted a topic in Development Environment (IDE)
Having mostly completed a major update of one of our largest projects I wanted to evaluate if we should take the step from LabVIEW 2022 Q4 32 bit to LabVIEW 2023 Q3 f2 64 bit before release...Unlike many we seem to rarely experience issues when upgrading (7-2022...), but this time I've hit a wall. I had read about how people have problems with buidling applications with VIMs in 2023Q3, but there seems to be all kinds of other issues going on. At first builds would fail with Bad VIs, but clearing the compile cache removed that. Now instead, LabVIEW hangs on "Initializing build", then crashes after a while. I've reinstalled/fixed the full LabVIEW installation, mass compiled everything including the entire VI lib etc...but to no avail. I see a lot of users say they have moved back to 2023 Q1, or plan to wait for 2024 (will there even be a new release in 2024 I wonder...), but are there users out there that do get things to work fine, even with RT Linux targets and 64 bit? I'll reinstall once more and this time try the 32 bit version...but if things still do not work I think we'll skip 2023 and hope for better days in 2025(?). -
How far from the goal are you now, and have you identified where the time is spent? If you e.g. just manually launch the LabVIEW application and flag when it does its first action, how much of the minute is spent already and how much time does the rest of its tasks use? You say you want the program to be launched by Windows as quickly as possible too, how much time does it take for Windows to launch it now compared to any other simple application/service you can set up?
-
When I first saw the compount add I though that must be use because it is quicker than multiplying by 3, but in the tests on my machine it is the slower. With the replace logic though it does not matter anymore. A digression: Branch prediction is an interesting phenomenon when dealing with optimizations. In this particular case it did not come into play, but in other cases there might be a benefit in making consecutive operations identical ๐ : https://stackoverflow.com/questions/289405/effects-of-branch-prediction-on-performance
-
You beat us well @ShaunR ๐ Normally I would use replace in situations like this too, to get the advantage of the preallocated memory. I improved some of the OpenG array functions that exact way (which is now included in Hooovah's version), but lately I've gotten so used to the performance and simplicity of conditional indexing that I did not grab for it here ๐คฆโโ๏ธ.
-
A bit quicker it seems is to use conditional indexing, like this: On my machine I got the following results (turned off debugging to avoid it interfering with test and removed the display of input as I would occationally get memory full errors with it): Original: 492 ms ensegre original: 95 ms ensegre with multiply by 3 instead of 3 adds: 85 ms Conditional indexing: 72 ms There might be even better ways..The efficiency of conditional indexing is often hard to beat though. demo_rev1.vi
-
On a related note GDevCon 4 just ended in Glasgow with a record number of attendees....๐ (Maybe that is partly because the alternatives are not as good/many anymore, but let me be optimistic for a while...) If Emerson does not want to kill or starve LabVIEW, maybe there is a nice future beyond 10 years as well. Retirement age is steadily getting pushed upwards though so personally it would be nice if things went on for another 25 years, or even better; allowed our kids to make a career working with G everywhere in 2050๐
-
Where do y'all get your (free) artwork for UI elements?
Mads replied to David Boyd's topic in User Interface
We use the nuvola icon set for a lot of things. -
The link only points to Jordan's profile, but he might have been involved back then yes...
-
I had noted a simple recipe earlier from here somewhere for manually installing lvzlib.so (OpenGZip 4.2beta) on Linux RT 2020 and newer now that the "Custom Install" option no longer exists / works in NI Max, but I seem to have lost it and cannot find it again. Do anyone know where that discussion was, or has the recipe?
-
When it comes to "Remove Duplicates" the performance of OpenG is a bit of a curious case (unless I am just overlooking something obvious). The original OpenG function builds the output arrays one element at a time, but still (in my LabVIEW 2022 at least) outperforms the alternatives I make where I reuse the input array. The latter use less memory it seems, as expected, but it is as if LabVIEW has become smarter when there are repeated build operations (but not for the functions we have gone through previously...(yes debugging is disabled..) ๐คจ The attached version is a simplified one of the original suggested revision. As mentioned it does seem to use less memory than the original OpenG, but is still slower ๐ Remove duplicates.zip
-
Not sorting the array we are processing, sorting the array of elements to delete. That is done just to facilitate the filtering algorithm, it does not affect the array that is to be processed. (Unless the sort has somehow gotten misplaced somewhere in the code that has been bounced around here...)
-
Performance mainly becomes an issue when the task at hand is heavy. I do not think saving microseconds on a small array/filter list is worth losing milliseconds or seconds when the array gets large. So that would be the rationale for simply ignoring the "quick on small arrays, slow on large" and choosing the one that is the fastest in the worst cases. However - there is one case where this can become an argument *for* keeping the other algorithms too; namely when you have to repeatedly run through small array/filtering jobs....๐คจ Life is never easy๐ฌ The "Revised version" is the best middle ground; quicker than all on most small and medium arrays, and still 2x times quicker than OpenG on worst case scenarios. The Rev2 one is 10 times quicker then...but in truly worst case scenarios you typically end up writing customized algorithms instead of using generic libraries anyway...(I would then often skip the deleted array indexes output to get things even quicker e.g.).
-
An inversion error snuck in, if you look at the code and invert the inversion its right ๐ Attached here... Filter 1D test - fixed.zip
-
The old read me file says that only 8 functions were changed so I took a look at one of them now: Filter 1D array Improvement when filtering every 5th element in a 100k array: 2.4x Improvement when filtering every 100th element: 2.2x Improvement when filtering every 1000th element: 1.8x OK, but not that impressive... However, looking at the algorithm I saw that there are repeated 1D Array searches for the whole array of elements to filter, that is costly. So I threw in a new alternative where that search is based on the sorted search instead. That makes a big difference when the number of items to filter is big, for the test cases above the results on my computer were Improvement when filtering every 5th element in a 100k array: 227x Improvement when filtering every 100th element: 22x Improvement when filtering every 1000th element: 3x Now the last algorithm changed two things, it uses both conditional indexing and sort/search sorted array. The sorting bit could just as well be added to the original revision...I guess the reason why OpenG still does not use conditional indexing is to be backwards compatible (very far now though...), and then the in-built sorted search would not be available either. That could be replaced by a binary search function that was available back then too though. Filter 1D test.zip
-
Looks good @hooovahh, feel free to use it / the inspiration ๐ in your VIMs. PS. Twelve years ago (!) I made other optimized implementations of many of the OpenG functions and posted them here. I could not find them though, but I attached it here now. I am sure some of them are not that much quicker anymore / have better alternative implementations now, but some of them probably are better. I have not gone through them again yet. 1509324986_OpenGArrayRevisedR4LV2011.zip
-
You cannot. The costly method (more so the larger the array and the number of deletes are) is to do repeated deletes (decrementing delete indexes as you go if you do it in order e.g., see attached example code). It is costly in both memory and speed due to reallocation on every round. (The same goes for array building; do not do it one element/subarray at a time, pre-allocate the full size then replace (or use auto-indexing in for loop to have LabVIEW pre-allocate automatically)). For multiple deletes nowadays I suspect conditional array indexing will most often be the most (or at least quite) efficient way to handle it. Something like this (NOTE this particular example assumes sorted (and non-empty) delete indexes!): If the evaluation of which elements to delete can be done within the loop the logic gets simpler... Doing a quick test on my computer, comparing it with deletes of half the elements in an array of 100k elements (extreme case), this cuts the time of the operation from a whopping 3 seconds to 0,4 ms (OpenG does multiple deletes from the end instead of start, that is only marginally better (1,5 sec) than deletes from the start (3 sec), as you can see in the example code). Before effective conditional indexing in for-loops was added to LabVIEW a more efficient algorithm (still, but only very slightly) would involve shifting array elements (using replace, which is very fast and does not allocate) we want to keep to the front, then taking the subarray with the new size in one operation. I have added that to the attached example. Methods of deleting multiple array elements.vi