Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Darin

  1. The instructions in KERNEL_SOURCE.txt are pretty good and work well for me. I use a Ubuntu 18.04 VM for cross-compiling, I would suggest at least 70 GB hard drive space. More help can be found here: https://forums.ni.com/t5/NI-Linux-Real-Time/ct-p/7013 And you can watch this if you'd like:
  2. Good catch using Spy++ in the first place. Not sure I would check every control, but I have always found gauges and meters to be particularly troublesome, so I would check those. If you ever color a part transparent I would think about checking, but LV has gotten much better in the past decade. Once upon a time I actually used the fact that an overlapped, transparent picture control triggered excessive redraws to "fix" problems with controls which were glitchy from a lack of refreshing. Was this control born in LV14 or was it upgraded from an earlier version?
  3. Transparency + overlapping objects can lead to a situation with constant redrawing. In this case (LV14 SP1) I was able to tame it by coloring the housing a solid color and then recoloring it transparent.
  4. I should have seen from the original post that you are using the wrong function. The function you described takes an existing share (mapped network drive for example) and resolves the mapping (server name from mapped drive letter, for example). You are looking for the URI for a local file, there is a simple .NET function to do that.
  5. Well, there is a lot that could go wrong and not a lot of info to go on. If not working = crash, then I would check the calling convention. Windows API calls not-surprisingly use the WINAPI setting which is very easy to overlook. If not working = non-zero return value then you have to follow the links for system errors, mostly make sure that you are using a valid path from a mapped network drive. Other than that this function should work for you. It is similar to many other Windows API functions. The buffer upon return will have 1 or 3 pointers (these will be U32 or U64 depending on the dll bitness) after the pointers will come the 1 or 3 C strings. If you try to simply return a C string (with some min length of say 1024), you will either get a buffer with some random bytes (the addresses) followed by the string you want, or about 1% of the time, the buffer address you pass in will have a zero in it and you will get just a couple of bytes and no string. In this case you could simply retry and you'll get a different address that probably works. To be totally safe you can use the vi.lib functions to create a buffer with sufficient length (DSNewPtr), and then use GetValueByXNode to dereference a cluster with a single U32 or U64 (depends on dll bitness) and a string (for infoLevel=1) or 3 U32s/U64s and a string (for infoLevel=2). In this case the buffer parameter is simply passed as a pointer sized integer. About all the help I can offer at the moment with no idea what the real failure mode is, and no LV around to show you an example.
  6. Start with a control in your template. Get a reference to that control and cast it to VIRefNum. Then call the 'Make Strict Reference' method using a VI reference to the desired VI. Finally, get the Terminal reference of the VIRefNum and invoke the method 'Change to Constant'. The constant winds up in a different location, if you are OCD like I am then read the position of the control terminal before and write that position to the constant after. It is pretty common to have more scripting versatility with a control or indicator than the corresponding constant.
  7. Holy blast from the past, but back in the day I did create a pure G implementation of a limited subset of ZMTP. Basically I implemented what I needed for REQ/REP and PUB/SUB peers over TCP and some other low-hanging fruit. A few MUSTs and several SHALLs in the RFC were ignored along the way to suit my needs (mostly self-educational). It was strictly version 2.0, no dealing with v1.0 peers (plus it is now at least v4.0). Looking back I will just say that I was not lazy, I was guarding against downgrade attacks.... These days I use 0MQ a lot, but mostly over inter-process connections which requires platform-specific bits so pure-G is out, and at that point I strongly suggest just wrapping libzmq (actually if pressed I would suggest wrapping it in all cases). I do not say this about very many libraries, but this one has been a pleasure to work with across several platforms with many different language bindings. In my use cases I have not run into any problems with my wrappers
  8. If all you are doing is querying a DB you may not notice that you are implicitly inside a transaction. To make changes that are available outside the current session you need to explicitly commit.
  9. As the parent of an autistic child I would be delighted if you could find a different pejorative to use in these situations. Thanks.
  10. My idea is dead in the water because it requires real effort on the part of NI. The good news for your idea is that it probably would make a nice addition to the right-click menu in LV15+
  11. LV15 seems to behave itself. At any rate I would think it is a feature to be able to probe there.
  12. Darin

    VI macros?

    I have managed to do a few cool things with these, and I have also managed to crash LV twice. YMMV
  13. The start case needs the same check to add 1 when the for loop ends without finding whitespace.
  14. Here is an interaction I have had on more than a few occasions: A: I have a random TCP problem Me: Sounds like a Nagle's Algorithm issue. A: I'll try that....Nope disabling Nagle did not help. Me: Sounds like a Nagle's Algorithm issue. A: I tried again, does not look like a problem with Nagle Me: That's odd. Let me know what you find out.... <Time passes> A: Turns out I screwed up, it was actually a Nagle's Algorithm issue. What I am saying is that this sounds like a textbook case of Nagle's algorithm. Until I was really, really sure, I would not look for something besides Nagle to explain the issue, I would look for the reason why it is not being disabled everywhere like you think it should be. One time I even started appending random garbage to the end of every message that was not of a given length.
  15. I'll take the "rube" that properly handles 'NaN' six days a week and twice on Sunday...
  16. Typically I would use a regex to validate a number, for a decimal number you could use ^[+-]?[0-9]+$ with Match Pattern to perform validation. In this case you could also verify that the remaining string is empty when you use Scan from String.
  17. I may or may not have an opinion about 'pipes' being appropriately used in this case, but that is beside the point. If the object is a "pipe with one element" than it is a pipe and that is what it should be called. In the documentation you can create an acronym or initialization or abbreviation, but that is what I think it should be instead of a new name. You define it the first time you use it (or perhaps the first time in each section if you want) and then use the shorthand version. For example, a single element queue is a queue, it does not need a new name. If you get tired of writing it then simply write a single element queue (SEQ) and carry on. A single element pipe (SEP) is one option. I'd rather describe it as a blocking pipe or non-blocking pipe, or as the choice whether or not to enable spooling or buffering on the pipe.
  18. I am running LV12 at the moment so I can not see your VI, but you described it well enough I think. I would suggest a keyed sort of your ItemNames. Use a loop to bundle the item name and its current index into a cluster array (in that order). Sort this cluster array. Create a single cluster consisting of the new name and its old index (the listbox value I presume) and search for this element inside the sorted cluster array. Use the index of the match as the new value of your listbox and update the item names with the sorted strings. For the size of arrays likely to occur in a typical listbox I would sort the strings separately instead of trying to unbundle in a loop.
  19. I prefer the windows shell function to the command line call myself, but Windows is easy either way. Linux is simple, once you know the default file browser (Nautilus, Dolphin, ....). This is easily found by querying xdg-mime. Then it is a simple system exec call to launch the file browser. Mac requires Applescript. Simply use system exec and the osascript command to tell Finder to select the file. In LV14 you may even be able to skip system exec and use the call Applescript function.
  20. From squinting on my iPhone I can tell that your constant '2' should be sqrt(2). Looks good otherwise.
  21. I can make sense of most of the ads I am hit with around here (LV training, hardware and the like). This one has me a little puzzled: Based on my experience at many Chinese restaurants, I could save people $500 and tell them the outlook is not so good.... I am tempted to click, but a bit afraid of the resulting ads. Reminded me of this: http://www.wsj.com/articles/SB1038261936872356908?mobile=y Update: I clicked and now I have tears in my eyes from reading the reviews, you know something is up when there are 132 of them. I can not decide what is funnier though, the joke reviews or the reviewers who do not get the jokes. And my guess is that somehow the ad was chosen based on the name of the MSoft email program which must have cropped up somewhere..... And for more good Amazon reviews I suggest the RAND book of random digits. I am waiting for the audio book read by Betty White....
  22. I have been doing this as long as I can remember using a combination of SyncToy and DropBox. Works great once the tasks are configured in SyncToy. I have various tasks configured, settings, work in progress code, all reuse code. As an added bonus, it functions as a touch-free backup/SCC/package manager safety net which lets me work away worry free on code which is not suitable or ready for the SCC lockdown. And it is just as easy to sync to a USB stick as it is DropBox so I am never without an up-to-date configuration. A few bummers, certain absolute paths and screen coordinate settings can be irritating when copied from machine to machine. Less of an issue for the VM applications. Second, there is no "merge" operation here, so you have to be diligent about keeping things serialized. Again, for my workflow it is more about being able to go from machine to machine and keep working, and not about bouncing around between machines and trying to keep them in sync.
  23. Put an Equals? comparison and you will see that it is in fact a bit-for-bit replica of the input. Right-click your 50.01 constant, select Display Format and up the number of SigDigits to 17-18 and compare. 50.01 simply does not have an exact DBL representation.
  24. Right-click the Table Indicator and 'Create Constant'. What you will notice is that the data type of the Table is a 2-D array of strings and you are creating a 1-D array. Add one more build array and it will work (right-click the broken wire and it will even give you the option to insert Build Array). Transpose the array as desired.
  • Create New...

Important Information

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