-
Posts
3,848 -
Joined
-
Last visited
-
Days Won
262
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by Rolf Kalbermatter
-
OpenG LabVIEW Zip 5.0.0-1 - stuck at the readme
Rolf Kalbermatter replied to PA-Paul's topic in OpenG General Discussions
I checked on a system where I had VIPM 2013 installed and looked in the support/ogb_2009.llb. Maybe your newer VIPM has an improved ogb_2009.llb. Also check out the actual post I updated the image. -
OpenG LabVIEW Zip 5.0.0-1 - stuck at the readme
Rolf Kalbermatter replied to PA-Paul's topic in OpenG General Discussions
Not quite! It's better to actually modify the Copy Resource Files and Relink.vi. Just add an additional case structure to handle shared libraries. The VI in question is this one: This will unconditionally change the linking name of all shared libraries in your build. There is a possibility that that is not desired although I can't think of a reason why that could be a problem right now. Fixup Shared Library Name.vi -
OpenG LabVIEW Zip 5.0.0-1 - stuck at the readme
Rolf Kalbermatter replied to PA-Paul's topic in OpenG General Discussions
There is to my knowledge no way to modify the JKI Builder. Although I think they did fix in recent years a bug that sounded exactly like what I ran across. But the JKI Builder has many other limitations that I'm not fond of so I still rely on my own setup. I basically use ogrsc_builder_3.0.0.11 for the renaming of the VI hierarchy with the opglib prefix with one modifications and then a heavily modified version of the OpenG Package Builder to package everything into the OpenG package. One caveat here, the ogrsc_builder_3.0.0 is from ca. 2009 times (and in 8.6 source code version). It will likely not go well with modern lvclass' and lvlib's and even more likely with lvlibp's files. It does have support for at least lvclass and lvlib but that is most likely fairly unmature seeing when it was last touched. lvclass and lvlib still were fairly new back then and had several quirks even in LabVIEW itself. I changed deep in the belly of the OpenG Builder in OpenG\build\ogb.llb\Copy Resource Files and Relink VIs__ogb.vi, that for shared library names the file name is changed back to the previous <file name>*.* with some magic to detect the 32 or 64 in the file name if present. It's not fail safe and for that not a fix that I would propose for inclusion in a public tool, but it does the job for me. What basically goes wrong is that when LabVIEW loads the VIs, it replaces to magic place holders with the real values in the paths in the VIs in memory and when you then Read the Linker Info to massage that for renaming VIs, you receive these new fully resolved paths and when you then write back the modified linker info you cement the not-platform neutral naming into the VIs and save it to disk. The OpenG Package Builder modifications mainly have to do with a more detailed selection of package content and special settings to more easily allow multi-platform support for shared library and other binary compiled content. In terms of user experience it is the total opposite of VIPM. It would overwhelm the typical user with way to many options and details that it could be useful for most. I had hoped to integrate the hierarchy renaming into the Package Builder too, since the information in the Package Builder would be basically enough to do that, but looking at the core of the OpenG Builder in Build Applciation__ogb.vi will for sure make you get the shivers to try to reimplement that in any useful way. 😁 And yes the naming of the tools is a bit confusing. The OpenG Builder is the tool that massages an existing hierarchy into a new on with VI renaming and relocating them into a configurable tree and fixing up relative paths to be correct for the new names and locations, while the OpenG Package Builder grabs a list of files and simply pushes them into an OpenG package (basically a ZIP file with configuration file). It would be quite useful to integrate the OpenG Builder as an extra prepare step into the OpenG Package Builder but that is a taunting exercise. -
OpenG LabVIEW Zip 5.0.0-1 - stuck at the readme
Rolf Kalbermatter replied to PA-Paul's topic in OpenG General Discussions
The problems with the paths to the shared libraries should be fixed with version 5.0.3. It's a combination of using the <library_name>*.* format to let LabVIEW resolve to the right shared library with the first * being replaced with 32 or 64 and the second with the platform specific shared library file extension (dll and so). Also needed to fixup the linker info in the VIs after creating the renamed (with oglib postfix) VI hierarchy through the OpenG Builder functions. LabVIEW, after creating the renamed hierarchy, will store the fully resolved library name into all VIs, which of course is not very helpful as it pins the VIs then to only use the shared library that matches the LabVIEW platform used to create the package. Version 5.0.4 was adding a working low level API for supporting a progress interface to the storing of files into an archive. Version 5.0.5 was adding an extended interface to the Inflate and Deflate functions to compress and uncompress binary streams and control the header used (none, zlib or gzip). Previously only zlib was supported for Deflate and Inflate. Version 5.0.6 fixes a bug when dealing with UNC names that contain numeric characters such as an IP address in the server name. https://www.vipm.io/package/oglib_lvzip/ -
It's not listed in https://www.ni.com/en/support/documentation/bugs/24/labview-2024-q3-bug-fixes.html As LabVIEW user I feel happy for their attention to this. As OpenG ZIP developer I feel a bit cheated. 😁
-
Unfortunately yes. First signed up 50 minutes ago and started spamming about 5 minutes later, then spamming about every 5 minutes. Second signed up 10 minutes ago and just started spamming. Definitely related as it is both about Norton spam. I'm very anti violence but these guys really get the worst in me out! 👿
-
Unfortunately it seems not. They said both (the two I checked) that they were created less than an hour ago, when I looked this morning (GMT+2).
-
Using LabView to push files to GitLab
Rolf Kalbermatter replied to JESENDI JESNER's topic in LabVIEW General
What have you tried so far? https://docs.gitlab.com/ee/api/rest/ documents a REST API to gitlab servers. Did you look at that? Did you try anything? There is for instance the JKI REST API Toolkit that should let you talk to this. -
That's normal for cRIOs. They don't usually go lower than a few MHz. I still use them whenever possible, except for loops that must contain nodes that can't be put into a single cycle loop at all. Quite often you do need pipelining anyhow at some point and then often need higher loop rates than your final desired rate and you can always implement your own internal counters that reduce the loop rate further and updates the outputs with the desired lower rate.
-
It seems to start to work! Unless of course you have hired some elves that keep checking the forum and deleting any account created with nefarious motives. 😀 But it is quite some time that I came in the office in the morning and didn't get greeted by a stream of products of humanities lowest when opening LavaG. In fact there seems none, and the latest new member is already 21 hours ago and still has 0 accounted posts for, so he may be actually genuine. Just hope that the moderators new message queue isn't overflowing with held back posts. Although you can always hope that it will die down once they realize that it has exactly 0.0% reach factor.
-
That was regularly true in the past, some of the callgirl spam so far was already NSFW.
-
They finally found out how to spam every single subforum at least once in a night.
-
Not yet. I'm actually working on it. Did read yesterday about the opkg package format needed and got some ideas about how to support that properly. Next step is to get the necessary gcc cross compile setup working again and create the relevant shared libraries and do some tests on several LabVIEW versions. Shouldn't be many months, but don't expect the according release next week. 😀
-
I put a prerelease package under https://kalbermatter.nl/downloads/oglib_lvzip-5.0.4beta-1.ogp The package is now officially released as version 5.0.4-1 under https://www.vipm.io/package/oglib_lvzip/
-
Most likely not! The directories and files during installation are done inside VIPM. In VIPM 2017 you have to start it up as sudo, so the owner will be root. The Post Install script is executed inside the LabVIEW environment through VI Server. That is not launched with sudo and therefore has no write access to the root owned directory.
-
Next step is trying to find out how OpenG ZIP Library fails on the lvappimg. My suspicion still is that it is an issue with the fact that the library is compiled for 64-bit. So am going to test it with 64-bit on Windows. Except that I'm using of course the most recent version 5.0 of the library which had quite a bit of changes in the C code to support 64-bit archives. So there is a very good chance that it simply will work. I can provide you with a prerelase of 5.0.4 that should install under Linux with both VIPM 2017 and 2022 if that helps. That would show if it is still a problem in the current code base. As it is I have not a working 64-bit version of LabVIEW for Linux at this point.
-
VIPM has limited and varying support for that depending on its version. "Linux" in VIPM 2017 means any LabVIEW version for Linux. "Linux x64" is not a thing before VIPM 2016 or so, but means 64-bit in VIPM 2017 and newer. And "Linux" in VIPM 2022 means 32-bit LabVIEW only, which is pretty stupid considering that LabVIEW for Linux is 64-bit only since 2017. Definitely an oversight by the VIPM developers that should be fixed. You don't want to require to have to explicitly specify "Linux x64" as supported target for packages that don't even have binary dependencies inside. It's doable with a Post Install VI in the package that renames the shared libraries after installation, except with VIPM 2017 and maybe others, which needs to run with root privileges to do anything useful. As my main Linux test system is still LabVIEW 8.6, newer versions have various troubles for me from inability to get a full installer for them to installation trouble on my Linux VMs, I did not want to abandon this version but was under the wrong assumption that it would not support the wildcard library naming to distinguish between 32-bit and 64-bit files, since the first version of LabVIEW supporting 64-bit was 2009. Obviously Brian had been starting to work on 64-bit support earlier already and not all of that support was removed by some precompile symbols it seems, so it is already present in 8.6 LabVIEW. Most likely it would have been possible to release LabVIEW 8.6 for 64-bit but probably with some bugs here and there. Of course VIPM Package Builder doesn't really support setting specific platform and bitness limitations on individual files or file groups, only on the full package. But I'm using my own OpenG Package Builder instead which has all those possibilities, yet it doesn't really help if VIPM then goes and messes that up anyhow. But creating my own package manager is definitely one step to far for my mental health. 😁
-
I appreciate your cooperation but there are a number of difficulties with this! 1) I try to avoid dependencies in the package including the Script VIs in OpenG ZIP Library > 5.0. It's not strictly necessary as the dependencies should be already installed at the time VIPM gets to install the real package, but I had situations where this was adding an additional problem. 2) More seriously though, it's not the fact that trying to delete it might fail if the file isn't there. That I wouldn't care and could also ignore by simply adding a Clear Error.vi after the Delete. But even with this change of yours the Delete function will still fail either by trying to clear the write protection on the file it has no access too or if I skip that by trying to delete the file it has no access to. Even ignoring that error won't help as the Move consequently will fail then too. For VIPM 2022 ignoring any error from the Delete should however work, as it copied the files from the archive to the target location with the same user rights as what LabVIEW was started up with. For VIPM 2017 there is unfortunately no way to avoid having the 32-bit so installed. If I mark it as Linux only it will install in both cases. But!!!!! I just noticed that the <library name>*.* wildcard naming in the Library Name control for the Call Library Node seems to work even in LabVIEW 8.6 (which had no 64-bit release). This saves the day!! I just can install the shared library with the 32 and 64 bit postfix alongside each other and be done, without having to abandon support for 8.6!! Thanks Brian Powell!
-
Thanks, that makes a lot of sense. Unfortunately the 32/64-bit support in VIPM was for a long time more or less non-existent, just as my 64-bit version of OpenG ZIP. 😁 When it was added, ca. 2015/2016 or so, it was a quick and dirty fix but not a thorough design (design here doesn't mean it's a mega project, but that there would have been some deliberate choices and decisions). And later fixes seem to have made things rather worse than better. 😏Not that I'm complaining. Multiplatform support for a tool like VIPM or OpenG ZIP is a major pain in the ass! Especially the testing! That permission issue seems to get a bummer! It looks to me as if the installation of the files to the LabVIEW directory is done in the context of VIPM, so the files inherit root ownership when run in VIPM 2017. Then the Post-Install hook is executed in the context of the LabVIEW installation through VI Server and that operates of course non-elevated and has therefore no rights to change the file attributes or delete the file afterwards. And the platform specific indication in the package to only install specific files depending on the target bitness is not present (pre VIPM 2016), not 32-bit specific (VIPM 2016,2017) or to specific (VIPM 2022 and maybe prior). Having to select "Linux x64" for LabVIEW target bitness is anyhow not really correct, although understandable since the underlaying VI Server property in LabVIEW distinguishes the bitness of LabVIEW by modifying the according "App.TargetOS" property. And that was how we had implemented these package properties in OpenG Builder back in a far ago time. When adding 64-bit support to VIPM I would rather have seen them to extend the LabVIEW version property to {LabVIEW, LabVIEW 32Bit, LabVIEW 64Bit}, or something like that (technically LabVIEW x68 and LabVIEW x64 would have worked too, since the Intel platform was the only one that allowed for bitness differences in LabVIEW. But of course if you think that far already why limit it on such a thing that could have changed theoretically in the future and did with the addition of Apple Silicon Support which is not x64 but MacOS ARM64). Strictly speaking LabVIEW should only use Linux x64 (or Windows x64), if it runs on a 64-bit kernel and otherwise just Linux (or Windows NT). All those little pesky, hard to imagine, future developments!! Will have to think a bit about this, but it's going to be tough to allow for installation in both VIPM 2017 and VIPM 2022 with the same package I'm afraid!
-
shared library passing arrays in C dll to labview
Rolf Kalbermatter replied to alireza m's topic in Calling External Code
The file you get with "Create c. file" is just a function prototype with an empty function. You can of course turn that into a DLL but it won't do anything useful. You can fill in the function with some useful code and then it is a good starting point for your DLL. My usual working method is slightly different. I use the "create c. file" function to create a file containing the matching function prototype, then copy this prototype from that file into the real project C file that I use to implement my DLL. But in most cases I don't even need that intermediate C file as I'm usually able to create the correct function prototype myself.- 8 replies
-
- 1
-
- dll
- external code
-
(and 1 more)
Tagged with:
-
Seems VIPM 2022 got picky about interpreting Linux as a valid platform indication for anything but 32-bit LabVIEW for Linux? That would be in fact a bug. Error 8 is a permission error. In that Post Install VI I try to clear the write protection on the 32-bit shared library file to be able to delete it so I can copy the 64-bit DLL over it. Does the user under which you are logged in and run VIPM have admin privileges? I guess there is no (easy) way to see the permissions of the lvzlib.so right before that Post Install VI executes. Does the zero-mqtt toolkit also show as disabled in the VIPM 2022 version?
-
shared library passing arrays in C dll to labview
Rolf Kalbermatter replied to alireza m's topic in Calling External Code
If you use LabVIEW native datatypes, the Import Shared Library Wizard is NOT the right tool to use. Generally speaking if you are not able to configure the Call Library Node yourself correctly, use of the Import Shared Library Wizard is simply a way to setup your code for failure. There is absolutely no way that an automated tool could create always correct code from a C header file alone, except for really trivial APIs. The C syntax is to ambiguous to describe all aspects of an API and it does not at all describe memory management issues for any parameters that are more complex than scalars. Generally speaking, you either have a non-LabVIEW specific DLL that hopefully uses generic C data types as parameters and is not trying to pass dynamically allocated memory buffers to the caller, or you start with a LabVIEW VI, configure a Call Library Node and connect native LabVIEW datatypes to it, configure the according parameters to Adapt To Type, right click on the Call Library Node and select "Create c. file" and then use the generated prototype and fill in the function body with what you want to implement in the C function. For the code example 2) I provided you have to: 1) NOT use the Import Library Wizard, it can NOT deal with the complex types that LabVIEW native datatypes are. 2) configure your C compiler to look in the cintools directory inside the LabVIEW directory for header files 3) Configure a Call Library Node yourself with three parameters: 1) Adapt to Type, pass Pointers to Handles and wiring an according 2D LabVIEW array of Int32 to it 2) Integer, Pointer sized, Pass by Value 3) Integer, Pointer sized, Pass by Value As to your code, yes you can do it like that. "#include extcode.h" is however useless, there is nothing in your code that would need that header file. You then create a Call Library Node and configure it to have these parameters: 1) Array, int32, 2 dimensions, Pass as Array Data Pointer 2) Integer, int32, Pass by Value 3) Integer, int32, Pass by Value Make sure to always use "Initialize Array" on the diagram to allocate a 2D array with the same sizes as what you pass to the function in the 2nd and 3rd parameter and wire that array to the 1st parameter!!!! If the array is not allocated or allocated smaller than what you tell the function to fill in, you just created a "crash your computer" program! It may usually not crash (right away), but it will corrupt memory and eventually your LabVIEW program will crash, eat your harddrive or do something else that is undesirable and there is nobody to blame for that but yourself. And about the used datatypes: While int is always a 32-bit integer for all platforms on which LabVIEW can run and use of it in your C code is therefore not really a problem, other basic C datatypes such as long are not the same size on some of the platforms. Therefore it is useful to use explicitly sized datatypes such as int32_t for parameters that interface with the LabVIEW diagram. LabVIEW is very strictly typed and always uses explicitly sized datatype, the only exception are the two pointer sized integer datatypes, but they only exist in the Call Library Node, never on the diagram.- 8 replies
-
- 1
-
- dll
- external code
-
(and 1 more)
Tagged with:
-
shared library passing arrays in C dll to labview
Rolf Kalbermatter replied to alireza m's topic in Calling External Code
LabVIEW arrays are NOT C array pointers. You can NOT allocate an array with malloc() and hope to return that to LabVIEW in a way that LabVIEW knows that this is an array. You could return it as pointer sized opaque pointer but LabVIEW could not do anything with it directly. You have two options: 1) Preallocate an array in LabVIEW with the necessary size and pass it to the function. Configure the according pointer to pass the array as C data pointer. Important: The array MUST be allocated on the LabVIEW diagram. You can NOT use C Library memory management functions to allocate, resize and free memory buffers that you want LabVIEW to use on the diagram! #inclide <stdint.h> void GetArray(int32_t *arr, size_t dim_x, size_t dim_y) { for (size_t x; x < dim_x; x++) { for (size_t y; y < dim_y; y++) { arr[x + y * dim_x] = 0; } } } 2) Use a native LabVIEW array. #include "extcode.h" #include "lv_prolog.h" typedef struct { int32_t dims[2]; int32_t elms[]; } Int2DArrRec, *Int2DArrPtr, **Int2DArrHdl; #include "lv_epilog.h" MgErr GetArray(Int2DArrHdl *arr, size_t dim_x, size_t dim_y) { MgErr err = NumericArrayResize(iL, 2, (UHandle*)arr, dim_x * dim_y); if (!err) { int32_t *ptr = (**arr)->elms; for (size_t x; x < dim_x; x++) { for (size_t y; y < dim_y; y++) { ptr[x + y * dim_x] = 0; } } (**arr)->dims[0] = dom_x; (**arr)->dims[1] = dom_x; } return err; }- 8 replies
-
- dll
- external code
-
(and 1 more)
Tagged with:
-
I need a bit more info here! First: versions before 4.2 had no support for 64-bit, neither Windows nor Linux. Unless you use LabVIEW 2016 or earlier, your LabVIEW for Linux version is 64-bit. Since you can use 4.0.0 in Windows, I have to assume that you use the 32-bit version of LabVIEW there. Is there a chance that you could try it with 64-bit LabVIEW under Windows with the >= 5.0.0 version of OpenG ZIP Library? Second: it seems VIPM treats Windows differently to Linux as allowed target indicator: Windows NT: means all NT derived Windows versions indpendent of bitness Windows x86: is only Windows 32-bit Windows x64: is only Windows 64-bit Linux: is only Linux 32-bit Linux x64: is 64-bit Linux I tried to verify some of the packages on VIPM.io and if they want to explicitly say that they are for Linux, they seem to all only specify "Linux" as allowed target. Yet according to your results such packages couldn't install on LabVIEW 2017 and newer on Linux! Could you try for a quick laugh if you can install one of the following packages on your Linux system? - labview-zmq-3.6.2.112 - denso_robotics_lib_dpam_robot_library-2.1.0.75 - electric_power_research_institute_lib_opendss_library_x64-1.0.0.7 - national_synchrotron_radiation_laboratory_lib_nsrl_cas_interface_linux-1.0.0.5 - ogrsc_restart-1.3-1 - ovak_technologies_lib_labview_universal_xml_parser-1.0.0.13 - pantherlab_lib_panther_dashboard-x.x.x.x - sas_workshops_lib_clearlvcache_for_g_cli-1.0.x.x - sas_workshops_lib_clearlvcache_for_g_cli-1.0.x.x