Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 09/18/2018 in all areas

  1. 20 points
    After I made this post I decided to bring the LabVIEW Wiki back online. It was not easy and took several days of server upgrades and hacking. The good news is I was able to bring up all the original pages.. The even better news is I talked with @The Q and @hooovahh and we are all on the same page as to how to move forward. @The Q did a great job of stepping forward and trying to fill the void that the LabVIEW Wiki's absence had left. He's agreed to migrate all the new content he created over to the LabVIEW Wiki, from Fandom and continue to develop new articles and content moving forward on the new site. He will also help in moderating the Wiki and will be promoted to Admin rights on the Wiki. His help is much appreciated. The LabVIEW landing page created here on LAVA is awesome but the forums don't lend themselves to static content creation. Instead @hooovahh has agreed to move the old landing page to here. That will be the new home for the landing page. This will become a valuable resource for the community and I hope all of you start pointing new people in that direction. With many editors, it can only get better and better over time. Where do we go from here: Logging in. - The old accounts are still there. If you're a LAVA old-timer, then you can try to login using your LAVA username. If the password doesn't work then reset it. You can also create a new account here. I'm going to announce a day when new accounts can be created. I'm limiting it for now because of all the spam accounts that can be potentially created. There's an issue with the current Captcha system. if you are super-eager to start creating content now and want to help, send me a direct message on LAVA and I can manually create an account right away. - New account creation is now open. Permitted content: - I'm not going to put restrictions on content at the moment. Obvious vandalism or offensive\illegal content will not be tolerated of course. However, the guidelines will be adjusted as time goes on and new content is created. There's just not enough content right now to be overly concerned about this. We need content. Discussions about the Wiki. - Each article page has an associated discussions page where you can discuss issues related to that article. Please use that mechanism (same etiquette as wikipedia). General Wiki issues\questions and high level discussions can be done here. So now, if you need to add content, you can do it yourself. Feedback as always is welcome.
  2. 9 points
    Tecnova has created a new LabVIEW Video site to replace the previous ftp server for downloading NIWeek and CLA Summit videos. Location: https://labviewvideo.tecnova.com Login: LabVIEW_Videos (Not case sensitive) Pw: LabVIEW (case sensitive) Check out the LabVIEW Videos Tecnova site Demo to see all the features of the new site. For comment or feedback please email LabVIEWVideo@tecnova.com Thanks to Tecnova Management for supporting the LabVIEW Community. Note: Testing has shown successful downloads using Chrome, IE and Edge for Windows and Safari for Macs. FireFox however tries to auto play the video and may not work like the other browsers. LabVIEW Video Demo.mp4
  3. 6 points
    I just started down the rabbit hole of making a new XControl recently. Oh man such a pain. Here is a little graph I made complaining about the XControl creation process, and the time needed to make something useful. Any alternative is appreciated.
  4. 3 points
    I agree with James. That could be achieved through composition and adding an abstraction layer. (Sink and Source in the diagram below)
  5. 3 points
    Where to start. A wiki here a wiki there, everywhere a wiki. We used to have a section on LAVA which was like a Wiki many many years ago. However, I shut it down. Reasons: Users didn't know it was a Wiki and instead of posting questions to the forum, would create new Wiki pages with their questions. This was a nightmare to moderate. It was setup so that when you created a Wiki page, the discussions for that page, would be linked to dedicated forum threads. Again, more confusion, since it was not a model commonly used elsewhere on the web. The forum\wiki blend was not very intuitive and it made the site hard to "figure out". Nobody cared or understood the wiki. A handful of people used it and never really caught any steam. After that experiment was shut down, I decided to create a separate domain dedicated to the LabVIEW Wiki. It was labviewwiki.org. I still own this domain. I think this was 2009, I don't recall. But anyway, I used the same open-source software that powered wikipedia, mediawiki. Here's the wiki-index page: https://wikiindex.org/LabVIEW_Wiki. Seems like it had around 300 pages. MediaWiki is super powerful, but not intuitive for new editors. I spent most of the time creating templates and documentation describing how to edit pages. I created a lot of the content but there were some others who added unique content like all the LabVIEW ini keys. All the keyboard shortcuts. All the hidden scripting features (before it was mainstream), etc. It was pretty cool. And yes, we had awesome landing pages and getting started pages that I spend hours and hours crafting. I was young and motivated. The problem was that we got struck with a rash of spammers. More like bots. They would go through and create hundreds of pages overnight. In that environment, you need moderators and editors to delete the pages and watch for edits. I was the only moderator and admin. So my plate was full. I ended up locking it down and forced it so that you had to have a login account to edit pages. On top of that, the login's had to be manually approved by me to prevent bot accounts. Of course, a wiki cannot be maintained or augmented by one person. The whole point is to have a community edit the pages. Not sure if Wikia (or MediaWiki) has solved the spamming issue. @The Q, I noticed a lot of the content is scraped from ni.com. Have to be careful about this and copyright claims. One thing I was very careful about with the LabVIEW Wiki I worked on was to create original content as much as possible. Also, what's the point of just duplicating ni.com. That's pointless in my opinion. Google does an excellent job of getting the info you need from multiple sources. But that's my opinion and the community edits should drive that of course. Sounds like the community wants to reboot the Wiki idea like Hollywood reboots comic book heroes. Sure, let's see where this goes. @The Q seems to be enthusiastic about it. Are there others here willing to put the time and effort into building the content? Any volunteers? If there is some real interest, then I can try to resurrect the old Wiki content and domain (not sure if the content it's salvageable, but I can try). Then we can go from there. I don't have time to admin the site but I can hand over the keys to someone that has more time.
  6. 2 points
    Here is a library I created to wrap the WinSCP .NET library. You can use it to connect to a remote server via SSH and transfer files, create remote directories,etc., with WinSCP from LabVIEW. I know there is a commercial library for I think $500 a pop, but this is something that is missing from LabVIEW that really ought to be included with native functions in the file I/O palette. The VI's in this packed library are built around the "WinSCPnet.dll" library that installs with WinSCP. You will have to download and install WinSCP to get the DLL, as I do not want to distribute it without their permission: Download WinSCP Here After downloading and installing WinSCP, you will have to connect the VI's in the packed library to WinSCPnet.dll. I make no warranties here, and no promises it will work, since I already have the stuff installed. The use WinSCP with an SSH Key, you will have to generate a key and copy the public key to your server. WinSCP uses the Putty format for SSH 2. You will also have to obtain an SSH fingerprint from your server for input to the session. Otherwise, you will have to provide user login credentials. You can use the "C:\Program Files (x86)\WinSCP\PuTTY\puttygen.exe" utility to generate a key. I use Git, so I used the SSH utilities included with that to generate and copy the key to my server. If you do that, you will have to use puttygen to import your OpenSSH key and convert it to putty format for use with the WinSCP/LabVIEW library. Sorry I don't have more time to do full docs and directions for use, but maybe someone else can comment with additional directions. I will monitor this topic and try to answer any questions. Good luck, and happy SFTPing! PS: No I will not save it to an earlier version. Maybe someone else can. WinSCPnet.lvlibp
  7. 2 points
    Screwdrivers are $29.99 though, that's how they get you.
  8. 2 points
    Maybe it's a new version of the Marshmallow test.
  9. 2 points
    Well after some research, this is what i came to. Sending the email in html format with the following VI to transform Unicode from LabVIEW to HTML character. I think it will work in most of the case. Benoit PS: Thanks for your help. Unicode to html.vi
  10. 2 points
    You might also try right-clicking the cluster, and looking at Advanced/Show Hidden Element to see whether there might be controls in the cluster that are hidden. But ensegre's suggestion of copying across to a new cluster is probably easiest.
  11. 2 points
    LV Champion Derek Trepanier has developed a Git solution and did 2 presentation at the CLA summit I am still working on getting all the CLA videos edited and uploaded. The new Tecnova video sharing site is a week away from going live. So to keep the momentum going I have posted Derek's presentation on the link below so others can see his perspective. https://drive.google.com/open?id=17mjooun62caeL6EcsCG2g1arpg-OoRhk
  12. 1 point
    I noticed on sourceforge that there is a version 4.2 of OpenG Zip. Will it be released as a package anytime soon?
  13. 1 point
    I suspect UTF uses "Set Scope", which is a separate method that doesn't do the propagation. The UTF authors may have written their own propagation loop. You could use the same workaround (I acknowledge how annoying that would be to write, but at least the option exists). BTW, looking at code, turns out that the "And Propagate" version was written to always prompt. That's how the Library Properties dialog works. On my machine as of this morning, there's a new Boolean parameter to "skip prompt" on that method.
  14. 1 point
    View File Plasmionique Modbus Master This package contains the Plasmionique Modbus Master library for LabVIEW. It supports RTU, ASCII and TCP modes with the following function codes: 0x01 - Read Coils 0x02 - Read Discrete Inputs 0x03 - Read Holding Registers 0x04 - Read Input Registers 0x05 - Write Single Coil 0x06 - Write Single Register 0x07 - Read Exception Status 0x0F - Write Multiple Coils 0x10 - Write Multiple Registers 0x16 - Mask Write Register 0x17 - Read/Write Multiple Registers 0x2B/0x0E - Read Device Identification Other features include: - Sharing a COM port across multiple Modbus sessions using VISA locks (10 second timeout). - Sharing a Modbus session across multiple communication loops. - TCP transaction ID handling to ensure that requests and responses are matched up correctly in case responses are received out of order. - Modbus Comm Tester, available through the "Tools->Plasmionique" menu, for testing communication with a slave device without writing any code. - Detailed help document available through the "Help->Plasmionique" menu. Examples are included in "<LabVIEW>\examples\Plasmionique\MB Master\": MB_Master Comm Tester.vi: Demonstrates usage of API to open/close connection and communicate with a Modbus slave device. MB_Master Multiple Sessions.vi: Demonstrates usage of API to open concurrent Modbus sessions. MB_Master Simple Serial.vi: Demonstrates polling of a single input register over serial line. Download a copy of the user guide here: MB_Master - User Guide.pdf Note that Version 1.3.4 of this library has been certified compatible with LabVIEW and has been released on the LabVIEW Tools Network: http://sine.ni.com/nips/cds/view/p/lang/en/nid/214230 The most recent version of this library will always be released on LAVA first before going through NI's certification process. ***This project is now available on GitHub: https://github.com/rfporter/Modbus-Master Submitter Porter Submitted 04/01/2016 Category LabVIEW Tools Network Certified LabVIEW Version 2012 License Type BSD (Most common)  
  15. 1 point
    You may want to consider using a Data Agnostic Smart Probe instead of a subVI. From that probe, you can get a reference to the calling VI. And I think there are ways to figure out which probes are on which wires, etc. Here's my nugget post on Data Agnostic Smart Probes: https://forums.ni.com/t5/LabVIEW/Darren-s-Occasional-Nugget-02-23-2018/m-p/3759109
  16. 1 point
    The "Individual Offline Installers" link below the download button points to the offline installer.
  17. 1 point
    Thanks. Issue 34 created.
  18. 1 point
    The link at the bottom will bring you to this page http://www.ni.com/en-us/support/downloads/software-products/download.labview.html#305508 You just have to select 2018 SP1 Patch and click download. This will download the f4 (latest) patch. The en-us version is pretty stable in my experience (except for a few dead links here and there). Can't say much about the others. I'm still surprised they bother to check the associated SSP. Considering that the License Manager checks it anyway.
  19. 1 point
    I would create a Clone method in the class. If you inherit any classes you need to also use the: "Call Parent Method", so the parent classes attribute will be clones as well.
  20. 1 point
    Here is a quick and dirty edit. It allows for column separators to be moved, but I noticed that on resize it will set the column widths. So this means if you manually move the columns, and then resize the control it may change the columns in an unexpected way. But at that point you can manually move the separators again. I only have 2017 and 2018 so this is for 2017 and newer now. Variant_Probe-2.4.3-0.ogp
  21. 1 point
    Thanks Antoine for your workaround to fix the Labview crash after installation of the 1.4.0.15 version on also LV2018 SP1. Your tip just helped me, too. I had Labview crashing also with the previous 1.3.0.12 version installation on LV2015 SP1, there for some reasons it helped to install all required packages package by package with the JKI VIPM. Apart from that recent installation issue the Control class UI Tools addon is a fantastic tool, and we use it frequently. Thanks François!
  22. 1 point
    A Radio-button has a natural interlock mechanism. You can customise the booleans to be regular buttons and also change their positions to get a 2D grid type feel if that is what you want.
  23. 1 point
    That may be a while - but the package file itself in the top of the thread.... Edit: Thinking about, because I'm dependent on the ZMQ bindings which are not available on the NI Tools network, I'm not sure I can put this package (and the SHA-256) library on the NI Tools network either - so it will always need to be installed from manually downloaded vipm files.
  24. 1 point
    Hmm, there was a problem I had there but I thought the version I packaged had fixed it. My current development version should find that path - but it depends quite a lot if you have multiple Pythons installed on your machine. BAsically there doesn't seem to be a bullet proof way of getting the correct path in Windows.... That's a sensible idea - it's going into the development code. That's largely a result of the test client being mainly aimed at debugging the protocol and for testing message handling rather before moving on to code to more tightly integrate LabVIEW programs with the remote kernel. That said, I'm in the process of adapting the client to allow different methods of locating and connection to the kernel and that will include suppressing the kernel shutdown message on exit. I'm also (very slowly) working on an implentation of a LabVIEW universal-binary-json serialiser/deserialiser with a view to creating some custom ipython messages for transferring binary data efficiently between LabVIEW and Python. The idea is that the LabVIEW client would create message handlers at the Python end that would allow LabVIEW data to be pushed directly into the Python namespace or to request python data to be sent back to LabVIEW. Don't hold your breath though, the day job comes first...
  25. 1 point
    I mostly post these over on Twitter, but here's some LabVIEW memes I've made: LabVIEW Style Checklist: "Size the block diagram window no larger than the screen size." Me: ✅
  26. 1 point
    Are there plans to fix all the bugs? I've just spent a month writing two xcontrols and all that was mainly finding workarounds to the bugs (and I still don't know why some of the work-arounds actually work)
  27. 1 point
    See the posts starting here. You have to use opkg to install sqlite on a Linux RT system.
  28. 1 point
    The root loop is definitely per process. It’s simply the primary thread started up by Windows for a process in which the GetMessage(), TranslateMessage(), DispatchMessage() Windows API calls are made over and over again, with minor LabVIEW specific adaptions. This thread is associated with a hidden window whose window procedure then translates everything into a Platform independant message infrastructure that very much resembles the Mac classic message loop. This is basically the famous root loop with the message procedure in the hidden window being a sort of platform wrapper around it. Under Windows there comes in a potential extra complication as the OLE marshalling hooks into the process GetMessage() API, completely outside the control of LabVIEW. So if you interface with OLE/COM/ActiveX and to some extend even .Net compenents things can get interesting,
  29. 1 point
    For fun I thought I'd make a list of the reasons I can remember why people choose sometimes choose UDP over TCP. Connection overhead of TCP (initiating a connection) Mainly a big deal with web browsers (each page has to connect to several domains, and each takes a few (usually 2 I believe) TCP connections, which introduces latency) This is part of why HTTP/3 exists Not a big deal for a 2 hour test where you open one connection Don't need packet de-duplication or re-transmits video streaming or there is an application-specific usage pattern that makes application-layer handling of faults the better route (HTTP/3) This application needs reliable transmission as it does not implement reliability at a higher level Want to avoid ordered transmission/head-of-line blocking This really means you are implementing multiplexing at the application level rather than at the TCP level -- its a hell of a lot easier to open 10 TCP connections, especially in applications on closed networks which are not "web scale" This is the reason HTTP/2 exists. HTTP/2 has connection multiplexing on TCP, HTTP/3 has connection multiplexing over UDP. Given the reliable transmission and rate requirement, I'm assuming ordered transmission is desired Want to avoid congestion control Bad actor attempting to cause network failures or: self-limited bandwidth use This application falls under this category or: Implement congestion control at the application layer (HTTP/3) Memory/CPU usage of tcp implementation Erm...labview Network engineers want to heavily fiddle with parameters and algorithms without waiting for the OS kernel to update HTTP/3 is supposed to be faster because of this -- TCP is tuned for 20 years ago or so its been said, and HTTP/3 can be tuned for modern networks I'm assuming this is not Michael On a closed network, for this application, its hard to see a benefit to UDP. (It occurs to me Michael never said it was a closed network, but if he put a pharlap system on the internet...😵)
  30. 1 point
    This is a very good question, and while I will try to answer, at the moment I have mostly a hazy vision that I have not fully worked out the details of. My priority is and has been to elaborate a good design for the core of Rebar, then create enough of an implementation of it that you can do some useful things in it and can see a path towards other useful things. How much the design and implementation of Rebar/VI interop gets worked out will depend very much on how much demand there is for it. A VI calling a Rebar function should look about the same as calling a subVI. A Rebar function's signature will contain information equivalent to the inplaceness information computed by the VI compiler for a VI, so the VI compiler will know when it need to copy the data that it sends to Rebar. Similarly, a Rebar function should be able to call a VI; the Rebar compiler may need to dig out inplaceness information for the VI that is normally invisible to the user. One difference in this direction would be that Rebar should be explicit that it is obtaining a specific clone of the VI and calling that, which it might wrap up into a closure-like object. So then the question is what kind of data you can pass back and forth between Rebar and VI. The rules here are that Rebar cannot pass any raw values to VI that VI will not guarantee the invariants of. Specifically: Rebar can't pass its own references, or anything containing its references to VI, since VI won't do lifetime checking. Rebar can't pass values that have destructors, because VI isn't guaranteed to call them when appropriate. For any types that Rebar cannot pass raw to VI, it must wrap them in refnums. This amounts to having a reference-counted shared object between Rebar and VI, so there are still some Rebar types that wouldn't qualify, but it should be enough to allow the most interesting Rebar-created values to VI and have the runtime maintain their invariants. In this way, you could define a TCP connection type, a file handle type, an IMAQ image type, or whatever you want in Rebar, and provide an API for it back to VI with refnums. This would have the nice result of allowing you to re-implement many parts of the LabVIEW runtime in Rebar. That's about as far as I've got on interoperability. Obviously the devil is very much in the details here, and often creating an interop system between two different languages is way harder than designing each one in isolation. Like I said above, though, none of this matters much unless Rebar is interesting enough that people want to use the two side-by-side.
  31. 1 point
    I use the dll wizard often and it has saved me a lot of time. It took awhile to understand how to massage the .h files into something digestible but once I got the hang of it, it was worth the effort. The error handling is pretty good at pointing you to the offending spot in the .h file. I think that the wizard has improved over time so if your last exposure was years ago I would give it another try.
  32. 1 point
    It is a matter of finding the right API calls in the LibreOffice API and using them. For charts, I think the easiest method would be to add a chart sheet and playing with its parameters.
  33. 1 point
    I think the biggest mistake from NI was to not add 20 years experienced user into their development team. I believe they only put marketing people and some developer... but no real user. Benoit
  34. 1 point
    Killer feature: new hardware only supported on NXG 🤦‍♂️
  35. 1 point
    I wasn't aware of the power of all those design patterns. This makes a great toolkit even greater. This discussion made me realize I have to take a closer look at all those different design patterns. I tried to add the new method as a property node instead of a normal method. That's why I couldn't find it. Having these templates for every design pattern makes them very easy to use. I downloaded the new version and it looks perfect to me. Thanks for updating the templates so quickly.
  36. 1 point

    Version 1.0.0

    34 downloads

    One of the difficulties with editing XNodes without the license is that invoke nodes for the XNode class don't show any methods. This XNode acts pretty much like a real Invoke node, but it allows access to all possible methods. You can also right-click and replace it with a real Invoke node.
  37. 1 point
    Nice! I recently became addicted to podcasts and was wondering if/when there would be any LabVIEW based ones. VIShots made one many years ago, but it isn't updated anymore. Subscribed!
  38. 1 point
    Assuming your pulse is a pulse on the strain gauge itself and not the lightbar, the specifications of the hardware you selected should be capable of capturing a pulse in that range. I would recommend taking buffered measurements with a Windows system. If you need to react to this pulse as it occurs, you may need a real-time system instead. The NI 9237 can capture at 50 kS/s (or 20 us per sample) - http://www.ni.com/pdf/manuals/374186a_02.pdf. This is more than enough to detect your pulse without aliasing (>2 times the frequency) and to give a decently accurate representation of the signal (>10 times the frequency - http://www.ni.com/white-paper/13655/en/). The NI 9425 is less clear, but it appears to be able to measure down to 8 us per sample - http://www.ni.com/pdf/manuals/373782b_02.pdf. However it may not be capable of buffered measurement (https://forums.ni.com/t5/Digital-I-O/Can-NI-9425-DI-be-buffered/td-p/3368527).
  39. 1 point
    Possibly. This is why "Real men run as root" Anyhoo. I think any attempt to create a [universal] builder/installer would be best envisaged on Windows first to prove the concept, so these kinds of quirks could be ironed out later. The success of such an endeavour would (I think) be very dependant on symlinks as they are kind of like a silver bullet to allowing different library versions and LabVIEW versions of the libraries to exist side-by-side and swap between. The conclusion I came to with my investigation was that a separate repository (in "Program Data") of installed toolkits, under each LabVIEW and toolkit version, enabled very quick and easy uninstall and version change by simply creating and deleting symlinks in the vi.lib directory pointing to them. Once that is achieved, then project based installs become a simple matter of choosing which links are present for each project whilst still maintaining menus in the palettes.
  40. 1 point
    I have thought about this before (project based, sandboxed). I work on projects on a different drive to LabVIEW which isn't a problem when working on individual toolkits; as they are self contained. But it got much harder once I started needing the Encryption Compendium in everything I always needed to have it installed in the LabVIEW vi.lib directory and any time I updated it had to reinstall for the other toolkits to amke sure they still worked as expected. So I played around with symlinks placed in the vi.lib directory which worked pretty well and could keep the menus in the IDE. Just replacing the symlink to different versions was also OK and worked but I couldn't figure out a way to stop some VIs recompiling (so just lived with it). Thinking off-the-cuff. We could probably have an IDE helper to select different VI.lib toolkit versions on-the-fly.
  41. 1 point
    A new video resource is the gdevcon1 videos.
  42. 1 point
    @David_L I get your point. If someone wants to migrate this all to the Wiki that's fine. I've been keeping the pruning to a minimum, so anyone updating a wiki can incorporate the suggestions from this thread.
  43. 1 point
    I would vote for a community based Wiki. Checking around one has been started. http://labview.wikidot.com/ Exists but has no content. Does anyone know who is the admin?
  44. 1 point
    Personally, I think that VIPM would cover most of the needs of code sharing if it wasn't for one HUGE limitation which is a public, free, open repository. The LabVIEW Tools Network repository is great for sharing code that has been vetted and approved by NI's engineers and processes. However there's obviously a huge need for a public repository that has little or no barrier to entry. And even if somebody created a repository like this somewhere (LAVA maybe?) nobody could access the repo unless they pay for a Pro license of VIPM per-user. Now what Derek/MGI have started with GPM is an awesome first step in solving this, but I think there's one big disadvantage: there is now one additional tool for installing G Code (reminiscent of https://xkcd.com/927/). If I have a project that uses some NI toolkits, some LVTN toolkits and some Open Source GPackage toolkits, I have 3 different tools needed for getting a system set up. I also have three different places (not counting the numerous GitHub repos, LAVACR pages, internal code repos, etc) to go looking for the code I need. What we need is a single tool that will install everything from all sources in the same standard. I would also want some way to differentiate what's an official NI product, whats a validated LabVIEW Tools Network product, and what is a use-at-your-own-risk open source ...thing... It would also be great if users could rate and review all these things so you could have more information on which of the 7 JSON toolkits is the best for your needs. I also realize the fallacy of pointing out problems without solutions, but as I'm not in the business of making package management tools, it's hard for me to prescribe others what to do with their time and money. Hopefully this discussion bubbles up to the right people who ARE in this business so we can get the solution the community needs. [Edit: Darn, in the time that I was typing this, it looks ShaunR posted almost the same ideas, just more succinct... Glad we're on the same page]
  45. 1 point
    Here is a ZIP file if you want to change the code. Please don't take this and try to sell it. WinSCP.zip
  46. 1 point
    Two ways to do what the OP is asking. 1. VI Server world: Children have a static link to their parents and Parents have a dynamic link to their children. This means that once a class is loaded into memory, the parent knows about the child. According to the documentation this will NOT work in the runtime environment, but i've used this several times when making IDE Tools. 2. Runtime Reflection: The following code will also give you an array of all of the children loaded in memory, but this time it uses less VI Server so it will work in the runtime environment. I use this when using a plugin architecture. I've not done a lot of performance testing with it, but on a medium-ish size project (one with ~150 classes) it only takes about 50 ms to run, so it's worked well for me so far. Having given you those solutions, I still think your best bet is to use a statically defined array. This will ensure things are loaded into memory when their needed and such. My solutions really only become worth it once you're dynamically loading classes.
  47. 1 point
    Norm - this is really cool. I think this part of the last video really hits home and defines the benefits of this design pattern, highlighting why using strings would cause an epic fail. I agree with Shaun in that strings are generally easier to read than integers in a Case Select, but in this case it doesn't really matter - the benefits are huge (you get some readability from the casted type anyways). I can see the benefit of this straight away esp for scripting, and will be adding this to my templates folder. Thanks for posting!
  48. 1 point
    I tried it through .net and it works. I had to browse for the mscorlib.dll file for LabVIEW to find the SHA256Managed-class. Cheers, Mikael
  49. 1 point
    I struggled with this question for a while too, though not specifically with regards to XControls. If I'm understanding your question, first you have to ask yourself, "should I use an observer pattern or a publish-subscribe pattern?" Often these two terms are used interchangably but I think there are important differences. In an observer pattern, the code being observed has no knowledge of any observers. It might have 20 observers; it might have 0. It doesn't care and just continues doing what it's doing. If you think of observing something through a telescope, the thing you're looking at generally doesn't know you exist, much less that you are interested in it. In a publish-subscribe pattern the subscriber has to register with the publisher and the publisher generally keeps track of who the subscribers are and how many subscribers there are. Consider subscribing to a newspaper; you call up the publisher, they record your name and address, and then they deliver the paper to your roof until you tell them to stop. Which pattern you choose depends on how you want to manage the lifetime of the publisher/observable code module. If you want the module to self-manage it's lifetime and stop only when nothing depends on the events it generates, use the publish-subscribe pattern. If you're willing to manage the module's lifetime yourself or if you don't care if the module stops while other code is waiting on its events, use the observer pattern. User events work pretty well for the observer pattern. However, if you expose the User Event Refnum, be aware that observing code can destroy the refnum and generate an error in the observable code. I prefer to expose the Event Registration Refnum and keep the User Event Refnums private. That protects the observable code from malicious code and inexperienced developers. The downside is that it's harder for the observing code to dynamically register/unregister for a subset of the events the observable code produces. I've experimented with using an event manager class as mediator between the observable code and the observing code. The event manager registers for all the events the observable modules expose. The observing code then tells the event manager which events it is specifically interested in. I think there must be a better way but I haven't figured it out yet. I don't have a very good feel for implementing a robust publish-subscribe pattern. My sense is injecting user events into the publisher isn't the best way to do it. Callback VIs? Separate subscribe/unsubscribe methods for bookkeeping? I don't know; I haven't explored it enough. For the observer pattern, I prefer option A. I have an example on my other computer. I'll try to post it later today. I agree with everything you said except this. I believe the user event queue exists at the event structure, not the the user event refnum or event registration refnum. If there are no registered event structures, there is no queue to fill up. Is the resource overhead of generating a user event on a user event refnum or event registration refnum that is not wired into an event structure high enough that this is something we need to worry about? Or is this just an easier way to manage the bookkeeping of which events the listener is interested in? Since the user event refnums and event registration refnums are strongly typed, you can only put them in an array if they have the same data type. What's the recommended technique for dynamically registering/unregistering for events that have different data types?
  50. 0 points
    I'm an avid GoT fan, but I'm waiting for Season 8 to arrive..... 🤣


×
×
  • Create New...

Important Information

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