Jump to content

JKSH

Members
  • Posts

    494
  • Joined

  • Last visited

  • Days Won

    36

Posts posted by JKSH

    • Reentrant: Roughly also "Reentrant", although...
      • LabVIEW VIs are non-reentrant by default, C/C++ functions are reentrant by default.
      • Unlike LabVIEW, there is no setting to force C/C++ functions to become non-reentrant -- you simply code them in a way that makes them reentrant.
      • In LabVIEW, non-reentrant VIs are impossible to run multiple instances simultaneously. In C/C++, non-reentrant functions are unsafe to run multiple instances simultaneously (it's possible; you'll just break things).
         
    • Single element queue: Depends on how you use it. I often use it as a nicer form of Data Value Reference (see below).
       
    • Data value reference: "Pointer" (as per the Wiki) or "Reference"
       
    • Functional global: Doesn't really exist in textual languages. They were invented to fill the role of Global Variables, back in LabVIEW 2 when Global Variables didn't exist.

     

    10 hours ago, infinitenothing said:

    I think there are some concepts I'm OK on:

    • We call them clusters, they call them structs right?
    • We have reasonable agreement on concepts like enums and global variables

    Sounds good to me. However, note that a LabVIEW "variable" is quite different from a textual "variable". A textual variable is more like a LabVIEW wire.

    • Like 1
  1. On 5/6/2021 at 7:33 PM, PeterB said:

    WHY does this happen ?

    One cause is file metadata. For example, VIs store a "Revision Number" which can be different even if the block diagram, front panel, and icon are unchanged.

    There are probably other causes too, but I don't know what those bytes represent.

     

    2 hours ago, PeterB said:

    For those of you who use source code control and perform comparisons between different commits, how often would LabVIEW falsely report differences exist ?

    Pretty often, unfortunately. This is one thing that makes it hard to use source control with LabVIEW. I try to minimize these occurrences by making sure that I don't save a VI unless I've actually modified its contents.

    P.S. Minor nitpick: It's not that "LabVIEW falsely report differences exist". Rather, LabVIEW causes differences to exist (in the byte sequences of a VI) even when the code is the same.

  2. 7 hours ago, hooovahh said:

    Years ago I was in a hands on session with some PXI card NI was selling that allowed for taking many temperature readings, by using fiber optics.  Something like the fiber optic had microscopic cuts in it that allowed for taking many channels of temperature reading, like on the order of 100s.  I looked up the card and I can't remember the price but I thought it was like $20k or something.  I figured no one would use this but looking online it seems people did, but it has now since been obsolete. 

    That was the PXIe-4844, an optical sensor interrogator. It wasn't just for temperature -- the gratings (microscopic cuts) can measure strain too. It's useful for taking lots of measurements across a long distance with just a single cable (although it was more like ~15 sensors per fiber, not 100), in an intrinsically safe environment, and/or an electrically noisy environment (since the fiber is not affected by noise).

    $20k was the price of a typical interrogator ~10 years ago. PXIe-4844 was obsoleted because NI exited the market. Other manufacturers are still in it; performance has gone up and price has gone down since then.

    • Thanks 1
  3. 10 hours ago, Someguy said:

    Can it be done without breaking community licence?

    The license does not specify that you must use a particular installation method.

     

    10 hours ago, Someguy said:

    What about installing it on debian or gentoo?

    I don't have experience with Gentoo, but I managed to install and run LabVIEW on Ubuntu (Debian-based) by using Alien: https://help.ubuntu.com/community/RPM/AlienHowto

    I had some issues, however: I couldn't get the Example Finder to work.

  4. I've used the NI forum to report bugs, and  got a few CARs out of that channel. Does that still work?

      

    7 hours ago, Antoine Chalons said:

    it expects you LabVIEW License number.

    So what happens with customers who have a Development Suite, where a single serial number is used to activate a variety of different products?

  5. The .rtexe is actually not an executable file. Rather, it is a "bundle" that contains your compiled VIs.

    The real executable is /usr/local/natinst/labview/lvrt -- This executable loads your .rtexe bundle and runs the top-level VI(s) from the bundle. The lvrt program checks a config file -- /etc/natinst/share/lvrt.conf -- to find out which .rtexe it should load.

    So, in theory, you could edit this file and then shut down the VIs that are currently running. This causes lvrt to re-launch, and it will read your updated config file and load your new .rtexe.

    Notes:

    • Like 2
  6. 47 minutes ago, Jordan Kuehn said:

    Following. Mostly because it's very common that I'll kick off an RT build and want to move on to working on the Host application. Or the other way around. IMO the different projects shouldn't block each other during a build, but I'm sure there's some linking thing that they didn't want to solve so instead they lock the entire IDE. 

    Related idea: https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Allow-users-to-continue-working-when-a-build-is-in-progress/idi-p/2638771?profile.language=en

  7. Not that I know of, but you could use a pre-allocated array of bytes (U8) and replace individual characters with their ordinal values (see https://www.asciitable.com/ -- '1' == 49, '3' == 51)

    Byte Array to String is a type-cast that doesn't allocate new memory. Of course, if you branch the wire (or keep a copy of the string) and then modify the original byte array, then you'd obviously still need to allocate new memory.

    May I ask why you need to micro-manage memory usage to this level?

  8. 4 hours ago, Neil Pate said:

    I still don't really get this. I want to see the branches when I look in the past. If the branch on the remote is deleted then I lose a bit of the story of how the code got to that state don't I?

    As @pawhan11 said, no story is lost when deleting a branch because only the pointer/reference to a commit is deleted, not the data itself.

    See here for a visual example: https://github.com/ni/niveristand-fpga-addon-custom-device/network

    • The horizontal lines show the histories of parallel branches.
    • The dots on the horizontal lines represent individual commits.
    • The black-background labels are the "pointers" that represent active branches.
      • "Deleting a branch" means removing a black label.
      • "Creating a branch" means attaching a black label to a commit of your choice.
      • When you are "on a branch" and you make a commit, you add a dot to the commit history chain and move the relevant black label to your new dot.
    • Diagonal arrows show where a branch is merged into another.
      • If you don't delete the branch after merging, then the black label remains on the commit before the merge point. If you delete the branch, the black label disappears. Either way, the branch's commit history is preserved; no story is lost.
      • Mouse over one of the merge commits: You'll see that it's called "Merge branch 'X' into Y", so you can see what the branch was named even if the black label is gone.

    Note: "master"/"main" is just another branch; there is no separate "trunk"

  9. 50 minutes ago, rharmon@sandia.gov said:

    The only way I figured out how to accomplish this was to read the entire file, add my new entry at the beginning and then re-write the entire file. Seems like a lot of overhead just for a style preference.

    That is the only way to add data to the start of a file. This is due to the way filesystems are designed: A file can be easily extended beyond its current end point, but its start point can't be moved.

     

    50 minutes ago, rharmon@sandia.gov said:

    Is there a better way to accomplish writing new entries at the beginning?

    Not to the file itself.

    However, rather than adding to the start of your file, you could write a simple log viewer app that reads the file and displays the entries on screen in reverse order.

     

     

    50 minutes ago, rharmon@sandia.gov said:

    My question is this, when you read a log file, do you expect the newest information at the beginning of the file or the end.

    I think I prefer it at the beginning of the file...

    Personally, I'm so used to logs having newer entries at the end that I don't expect it the other way. I guess I prefer this out of habit and due to the efficiency of appending data to the end.

    Having said that, I understand the convenience of having the latest data being visible as soon as the file is opened.

  10. 10 hours ago, Antoine Chalons said:

    - I have no idea if what I'm going to say makes sense or not - on Windows the CLFN were all "any thread" and it worked fine.

    Hmm, we don't know which thread(s) are chosen by the CLFN. If it happens to pick the same thread every call, then there will be no ill effects.

  11. 4 hours ago, Antoine Chalons said:

    Ok, it took me some time but in the end, all I had to do to make it work is to set all the CLFNs to run in the UI thread.

    I'm not a regular user of CLFNs so I'm not sure why and if it was the obvious thing to do but there we are.

    I'm guessing that the library's functions are not thread-safe. Without forcing the CLFN to use the UI thread, it could use different threads to call the library functions... thus causing a crash.

  12. 19 hours ago, Aristos Queue said:

    And if we had something like "Split English CamelCase.vi"

    I do have an implementation of "Split English CamelCase" that handles acronyms: https://github.com/JKSH/LQ-CodeGen/blob/labview-api/src/LabVIEW/Icons and Wires/Name to Icon Lines.vi -- It's based on a shorter regex and currently doesn't handle digits, underscores, or plurals-of-acronyms.

    I won't be trying to update the icon generator or VI Analyzer within the next 2 months, but someone who wants to try is welcome to use my VI as a starting point.

  13. 4 hours ago, Jordan Kuehn said:

    It appears that the JSON parser built into NXG WebVIs is incapable of reading enums or timestamps. I am not certain if that is a limitation of the parser or the encoder.

    The "Flatten to JSON" and "Unflatten from JSON" nodes in NXG WebVIs are essentially the same as the ones built into classic LabVIEW. Both are incapable of processing enums or timestamps.

    As a workaround, you can create a "bridging" typedef (GType) which replaces enums and timestamps with strings. Use that with the NXG JSON parser, and then convert it to your "real" GType.

  14. 2 hours ago, Yaw Mensah said:

    My Problem is that after creating a project at "Build Specification"-> "rigth click" i am only able to select "Source Distribution". Application does not show up as an option.

    Which edition of LabVIEW did you install?

    The Application Builder comes with LabVIEW Professional. It is not included with LabVIEW Base or LabVIEW Full.

  15. 1 hour ago, flarn2006 said:

    It seems to think that LabVIEW 2020 isn't the latest version, saying an SSP subscription is required to download it. My guess is there's a bug where it thinks "2020 Patch" is the latest, even though it requires "2020" in order to install.

    It's not related to latest vs. older. The patches don't require a login to download (even 2009 SP1 Patch). The full versions require logging in with an account with an active SSP.

     

    1 hour ago, flarn2006 said:

    That's how I see it anyway.

    How does NI, the software's author, see it? Talk to them. If they give you the go-ahead, then go for it.

×
×
  • Create New...

Important Information

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