Jump to content

Rolf Kalbermatter

Members
  • Posts

    3,772
  • Joined

  • Last visited

  • Days Won

    241

Posts posted by Rolf Kalbermatter

  1. 8 minutes ago, Mads said:

    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? 

    Where you refering to this?

    https://lavag.org/profile/19157-jordan-kuehn/

     

  2. 5 hours ago, Porter said:

    Unfortunately as soon as I build vipm package, the *s get replaced with 32 and dll. So when I open the vis on x64 labview, they are pointing to the wrong dll.

    My solution is link the CLFNs to libmuparser-lv.dll and have a post-install vi copy the appropriate version of the shared library to that filename. I know it looks weird to see a dll in linux, but it doesn't seem to break anything. 

    I would consider that a bug in VIPM. It should not rename the DLL and linkage name in the VI in this case or at least offer an option to disable-that. But your solution with the Post Install works and is what I always do. VIPM always lacked a few features to properly handle 32-bit and 64-bit binaries. I haven’t checked in the latest version but there was no way to distinguish files to be only installed for 32-bit or 64-bit only and even if the latest version would support that I’m hesitant to use it as VIPM tends to create packages that won’t be installable by older versions of it.

  3. 3 hours ago, Porter said:

    I tried the .\libmuparser-x*-lv.* trick for the CLFN path but when I build a VIPM package, it converts it to libmuparser-x32-lv.dll because I am building on LV 32-bit, Windows. So then the VIs are broken on 64 bit and Linux. If I can preserve the wildcards in the CLFN path it would be ideal.

    Here is my latest attempt. Statically linking to libmuparser-lv.dll but located in the vi.lib next to mupLib.lvlib: lv_muparser-2.2.0.6.vip

    A star before the file ending is translated to 32 resp 64, a star for the file ending is translated to the respective platform specific shared library file ending.

    Is your shared library name different between bitnesses? Otherwise you do not need a star at all before the file ending.

  4. 2 hours ago, Porter said:

    Give this a try: lv_muparser-2.2.0.4.vip

    It worked with LV2020 x32 and x64, Windows.

    In Linux I had to manually copy the .so file to libmuparser-lv.dll. Permission issues with the installer of course. I think that Labview needs to be run as root during the install but my community edition was activated under my user account. After doing that manual copy it worked fine though.

    All CLFNs are statically linked to "<resource>\libmuparser-lv.dll"

    If you make that libmuparser-lv.* you can leave the default file ending for the shared libraries. .dll for Windows, .so for Linux and .framework or .dylib for Mac OS.

    And you don’t rename the default name of libraries under Linux but typically create a symlink with whatever non-versioned name you need.

  5. 3 hours ago, Andy75 said:

    OK, thank you for the hint. I'll try it on Monday. Since my experiance it is unusual to place a DLL beside to the exe file and not within the support folder of the application. Is there a special reason why you did it this way?

    It’s actually how Microsoft wants DLLs distributed with an application unless it is installed directly into the system (or GAC for .Net assemblies). For DLLs that get directly referenced by LabVIEW VIs it is not important as the application builder adjusts the path to whatever relative directory you told it to move the DLL but for other DLLs that LabVIEW and/or the application builder doesn’t know about it is important to place the DLL in a standard Windows searched location.

  6. On 8/18/2023 at 9:55 PM, Reds said:

    The NI P&L statement has a revenue line item called "Software Maintenance" at about $37mm per quarter. It's trending downward. Does any know if LabVIEW revenue is included in this P&L line item? What other things might be in this bucket besides LabVIEW?

    NI System Link, NI TestStand, NI Measurement Link, NI MultiSim/Ultiboard (barely) , NI LabWindows/CVI (pretty much not anymore), MATRIXx (not sure they still sell that other than to legacy customers), Diadem (not actively sold anymore), and a few others that they have stopped working on.

    Other than LabVIEW, TestStand and System Link, NI has pretty much stopped any other software development, so part of the down turn is likely that sales from those other software is dwindling as existing customers jump the boat and no new customers are boarding for them.

  7. There is no simple fix to that. In order to draw anything on a Windows GUI you do need GDI objects. Every Window is one, every subwindow, every icon or bimap is one, every line or arc could be one, every text can be even two or three. You can open them, draw them to the device context and close them afterwards but opening/creating them costs time so if you foresee to use them again it’s a pretty smart idea to keep them around instead of spending most of your program execution time in creating and destroying them continuously.

    The only thing LabVIEW programmers can do is to try to combine more operations into a single object and/or finding the objects that are rarely needed and pay the runtime performance penalty to recreate them each time instead of keeping them around. Also I’m pretty sure that 3D controls with alpha shading may look cool to some people but tend to increase the GDI object count substantially. Classic and Dialog controls are a lot easier to draw!

  8. 9 hours ago, ShaunR said:

    I'm surprised it works at all tbh.

    The Intialise is in side the while loop but the close is outside. Either move the initialise to outside the loop or the close to the inside.

    You start to read when there are greater than 0 bytes (1 or more), but you want 23 bytes. Either accumulate bytes as they come in until you have 23 and then decode into the numerics and strings or wait until there are 23 bytes at the serial port (rather than greater than zero) then decode.

    See how far those changes get you.

    And the Scan From String does a greedy pattern match, this means the first %s will eat the entire string as any character matches %s and then there is nothing left for the other 7 %s to process => error 85 as the Scan from String can't satisfy the second %s.

    If you have a space as separation character as it seems you have from the format you show you should rather use following Scan From String format string

    %[^\s]\s%[^\s]\s%[^\s]\s%[^\s]\s%[^\s]\s%[^\s]\s%[^\s]\s%[^\s]

    For this you should also right click on the string constant and enable '\' Codes Display

    The format string basically says, take every character until you see a space and put this in the first output parameter, then take the space and repeat this for the remaining 7 output strings.

    Possibly 23 character could also mean that each substring consists of exactly 2 characters plus the 7 separation characters. If so you could also use:

    %2s\s%2s\s%2s\s%2s\s%2s\s%2s\s%2s\s%2s

     

  9. You’re saying that an event registration terminal should behave like a tunnel?

    They are not the same thing as the name already says (and the symbol shows)! It’s also more like a shift register although the right side of a shift register can’t be unwired.

    And the behavior makes sense. For tunnels it can be a pitta to have to wire each output but it’s also desirable that it can be easily “reset”. And that behaviour was defined ca. 1986! For event registrations it is almost never needed to connect the right side terminal (I did that maybe once or twice in my entire LabVIEW programming). Alternative would have been to make only a terminal on the left side but then you couldn’t dynamically register an event.

    Inconsistent? Maybe if you take a puritan look, ,useful? Definitely!

    And I can assure you the LabVIEW team debated over this probably several weeks if not months before deciding on the current solution. 

    The only improvement I could think of nowadays is to allow to hide the right side terminals!

     

  10. 59 minutes ago, ShaunR said:

    It is indeed. But it doesn't have to be They could have decided it should behave like Queue's and an Event Reg merely creates a reference to the internal queue. IMO, Darren's nugget is a side effect of an implementation peculiarity (which you have explained in exquisite detail) rather than a philosophical design - a peculiarity I hope never changes :) .

    That would be a management nightmare. There would be no possibility to handle more than one event registration to subscribe to the same even generator without very involved buffer management. By placing the event queue into the event registration object it is fairly simple.

    1) Hey here is my event queue, post any event you get to it.

    2) I only have to check that queue to see if there is any event to handle. Not some other queue that might or not might have events present that I already processed but need to remain in it because not all event registrations have yet gotten to read that event.

    There is a relatively cheap check needed in the event generator to see if the event registration queue is still valid before trying to post a new event to it but that’s much easier than turning the single.queue into a pseudo random access buffer for use with multiple registrations.

    Similarly the event registration needs to check that the event generator is still valid when trying to deregister itself from it on its own destruction but that’s again a fairly simple Is Not an Object/Refnum check.

  11. 2 hours ago, ShaunR said:

    Oh I don't know. They could delete the registration queues of any registration that referenced the event that was destroyed - they have to delete the registration queue at some point, right?. Luckily, that hierarchy isn't implemented and hopefully it would be too tiresome to implement.

    That would make little sense. That event queue is owned by the registration refnum, and the registration refnum registers simply a callback in the event object. The event is able to have multiple callbacks registered as it "queues" them up internally. That's what makes it possible to have multiple registration refnums connected to the same event object.

    That makes resource management fairly easy, avoids polling and objects owning other objects. Once the event goes away it simply will stop posting any events to the registered callback (it forgets about the callback since it is non-existent). The event queue in the event registration object still exists until that event registration object itself is destroyed. And if you close the event registration refnum earlier it simply deregisters itself from the event.

  12. It's not a bug and there is nothing that could be fixed here.

    The user event is not the same as the event registration!

    The user event is an event object that manages events in an internal FIFO queue to pass the event over to the event wait node AND/OR to any number of attached event registration handlers.

    When it is registered with the register node, a new independent object is created that contains its own event queue and that event registration is then connected to the event with an event registration handler that simply passes the event to this queue in addition to the internal event queue. Once the event is gone, all the events that are stored in the internal queue of the event are of course gone, but the events also were passed to the queue of every attached event registration queue. That queue remains valid until the event registration refnum is closed itself.

    The event registration is special as it can attach to any object that can expose an event interface, such as ActiveX objects, or .Net classes too (if they have defined events). Also LabVIEW front panel objects actually can provide an event interface and their refnum can be connected to a Register Event node.

     

     

  13. crossrulz is very correct. VISA only supports TCP/IP and that in two flavors. The first with the ::INSTR postfix is according to the VXI-11 standard that provides a resource discovery service (ala Bonjour) on the device that allows NI Max to query for connected devices and query their specific settings. The second variant uses the ::SOCKET postfix and is raw TCP/IP communication. The resource specifier needs in that case also a port number in addition to the IPv4 device address.

    UDP communication in LabVIEW is only possible with the UDP native nodes in LabVIEW. No NI-MAX will be getting harmed nor in any other way getting involved in this!

  14. On 8/5/2023 at 1:36 PM, dadreamer said:

    I would post here a link to LabVIEW 2.5.2 distro as well, but I don't know if I'm allowed to. I found it in the web archive years ago, there was no registration number or any owner's information. It was just LabVIEW + Advanced Analysis Library, without extra toolkits. Latest OS where it works is Windows 98 (with few non-fatal errors). It should have worked with some hardware too as daqdrv, gpibdrv and serpdrv plus ther VI wrappers are included, but as I've been running it in a VM, no such tests have been done.

    2023-08-05_15-58-38.jpg.62639afe58b4ef69f544d81a03e2a384.jpg

    Even in such a minimalistic form it was quite an interesting version. For example, the cintools folder did contain more sources than in later versions. Many internal Managers, such as Dialog Manager or Window Manager, were exposed there. Some of them still exist in the modern code base, although NI has started to clean up the obsoleted functions few years ago.

    Also this is the only Windows version with most Mac OS relicts, e.g. Size Handle, Handle Peek, Handle Poke (I mentioned them on the other side). In theory those thin wrappers might be expanded onto many other Memory Manager functions, eliminating the need of calling them through CLFNs. But they were simply removed from the palettes and abandoned.

    Those handle functions only really worked on the Mac, since they were actually creating native MacOS handles, not the LabVIEW own flavor of them that was a sugar layer around the rather arcane Macintosh memory manager calls. Yes the Macintosh memory manager was famous for being not high performant and quite  crash sensitive. It worked for most Macintosh applications sort of, but LabVIEW really was considered a stress test for it. It was also regularly stressing the Macintosh Programmer Workshop C compiler that the LabVIEW team used to build the product. It was quite a regular happening that NI had to request Apple support to build a new version of it with bigger symbol table space, in order for the compiler not to fatally crash during build of some of the larger C source files.

    When the multiplatform version was started some of the real cracks in the LabVIEW team actually prefered to develop and debug on the Sun Solaris version of LabVIEW, since the compiler and debugger tools where a lot more powerful on there, even though everything was in fact all command line based.

    And yes LabVIEW 2.5.x was Windows 3.1 only. It was never tested nor build to run under Windows 95 or later, which would have been very difficult considering that it was released in fall 1992. The first version supporting Windows 95 natively was AFAIK LabVIEW 4.0. LabVIEW 3.1 or thereabout did however have a version that could be installed on Windows NT 3.1.

     

  15. I used to have a whole box of disks and CD ROMs of old versions, though nothing before 2.2.1 which was Mac Only. But after 30 years and 3 major relocations, almost all of this has eventually ended up in the big round archive called trash bin. It's just not practical to hold onto these forever, and that stuff actually weights quite a bit altogether. Not fun to carry around and also not fun to fill up storage space (that I seem to always have not enough).

  16. Why do you think you need to downgrade NI-VISA? Does something not work? Have you tried anything?

    While you indeed usually need to have a NI driver version that is not more than 3 years higher than the LabVIEW IDE you are using, that is somewhat less of a program for NI-VISA. First most NI VISA functionality in LabVIEW is built in, so there are not a lot of VIs that an NI VISA installer could add to your LabVIEW installation. Maybe the example VIs, but I'm not even sure about that.

    Second, the NI-VISA API itself has been very stable over many years and there is little reason to believe that you would run into compatibility issues with a bigger version difference.

    Basically on the development system where you run the LabVIEW IDE, you should make sure that the versions do not differ to much, but on remote systems where you only intend to execute built applications, almost every version of VISA would work, but it is always a good idea to use at least the same version or newer as you used to develop/built your program.

    • Like 1
  17. It looks fairly ok. But you have a problem. You need to free that handle and that is not trivial. You need to call DSDisposeHdl() from the LabVIEW manager functions, however it depends on various things as to what DLL that function needs to come from.

    Most likely however does your DLL already export a helper function. Have you checked the header for your DLL? Isn’t there an additional function named DisposeLStr or similar exported? Calling that correctly will properly deallocate the handle after you are done with it.

    One small correction, COM either means a serial communication port or the underlying technology for ActiveX (Component Object Model). There is a separate Python module to handle COM interfaces but that works differently. Here you simply call classic DLL functions.

  18. 36 minutes ago, ShaunR said:

    image.png.ae8051eb4d73a144975797957bb53b8b.png

    The closest in terms of no runtime cost would be Conditional Compile for CPU architecture: anything but x86, x64, arm32 and arm64 is Big Endian. Alternative would be to check the VI Server property for CPU type. My version of runtime check used to be to use MoveBlock to copy a two character string with different ASCII characters “BE” into an int16 and check its value to be equal to 0x4245

  19. 12 hours ago, bjustice said:

    Would love to know what you guys think.

    I always use Unflatten from String/Flatten to String. It even has a third Endianess selection to never byte swap. It may be not as fast as MoveBlock but has been fast enough so far for me.

    The only thing I don’t like about it is that it forces String on the flattened side but a Byte Array to String or String to Byte Array solves this.

    It would be trivial for the LabVIEW devs to allow Byte Array too, just a flag in the node properties that would need to change and should have been done so 20 years ago and set as default as a first step to allow the divorce of String==Byte Array assumption that still hampers proper adoption of non ASCII strings in LabVIEW.

    I even hacked a LabVIEW copy in the past to allow automatic adaption of the Unflatten from String Node to Byte Arrays but that was of course a completely undistributable hack. An according LabVIEW Idea Exchange suggestion from me was acknowledged by AQ himself but dismissed as highly unlikely to be implemented by LabVIEW R&D.

    https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Allow-Unflatten-from-String-to-also-accept-an-Unsigned-Byte/idi-p/3968413

  20. On 7/29/2021 at 3:14 PM, Yair said:

    I'm attaching some of Rolf's VIs from years ago. They do include code for writing an image to the clipboard (see the example in clipbrd.llb and look at the control or panel buttons). This would probably require adapting if you're on 64 bit LV.

    Clipboard - RolfK.zip 629.71 kB · 13 downloads

    For anyone looking at this library, I did an update in LabVIEW 2009 to properly support both 32-bit and 64-bit LabVIEW without any potential trouble.

    https://forums.ni.com/t5/LabVIEW/LV-slows-down-extremely-when-having-large-contents-in-clipboard/m-p/4251413

  21. Quote

    So, when I hit write for one case, it will upload that specific code. Any tips?

    What is a panther programmer? How do you interface to it?

    Your problem description sounds mostly like a basic LabVIEW programmer problem.

    Have you done some online programming courses and tutorials? Do you know how to write a simple LabVIEW program?

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.