Jump to content

ShaunR

Members
  • Posts

    4,840
  • Joined

  • Days Won

    290

Posts posted by ShaunR

  1. 39 minutes ago, Rolf Kalbermatter said:

    Easy typecasting in C is the main reason for a lot of memory corruption problems, after buffer overflow errors, which can be also caused by typecasting. Yes I like the ability to typecast but it is the evil in the room that languages like Rust try to avoid in order to create more secure code.

    Typecasting and secure code are virtually exclusive things.

    Don't have that problem with dynamic typing.

    Typecasting is the "get out of jail" card for typed systems. This one seem familiar?

    linger Lngr={0,0};
    setsockopt(Socket, SOL_SOCKET, SO_LINGER, (char *)&Lngr, sizeof(Lngr));
    DWORD ReUseSocket=0;
    setsockopt(Socket, SOL_SOCKET, SO_REUSEADDR, (char*)&ReUseSocket, sizeof(ReUseSocket));
  2. 3 hours ago, Neil Pate said:

    Would you want to write a driver for your GPU with a language that does not offer strict typing?

    Oddly specific. I would want a method of being able to coerce to a type for a specific line of code where I thought it necessary (for things like precision) but generally...bring it on. After all. In C/C++ most of the time we are casting to other types just to get the compiler to shut up.

    They broke PHP with class scoping. They are now proposing breaking it more with strict typing. Typescript is another. It's the latest fad.

  3. 14 minutes ago, Neil Pate said:

    I am not against your idea of adding a bit of love to the events implementation.

    Actually. your particular problem is that the variant type is only a half-arsed variant type. It's easy to get something into a variant, but convoluted and unwieldy to get them out again. I think "Generics" were supposed to resolve this but they never materialised.

    I shake my head with the recent push in the software industries to strict type everywhere. Most of the programming I do is to get around strict typing.

  4. 16 hours ago, Neil Pate said:

    Not for me though, my low level messaging uses events and that is just waaaaay to much drama to have separate events for every message. I wrap it up a layer with typedefs though, just the data is transported in a variant.

    If only there were a way that one could use strings to define the event. We could call them, let me see, "Named Events"?.:shifty:

  5. 13 hours ago, smarlow said:

    This implementation would mean the data for the "callback" has the same type as the dynamic event.  But if you use a cluster or class, it would be easy enough to separate the calling data from the return using sub-clusters. Copies of the calling data would be in the return, but that would be relatively harmless.

    We have the Start Asynchronous Call for creating callbacks in LabVIEW. There are a couple of issues with what you are proposing in that callbacks tend not to have the same inputs and outputs. What we definitely don't have, at all, is a way for implementing callbacks for use in external code (in DLL's). While what I'm proposing *may* suffice for your use case, it's the external code use case where LabVIEW is lacking (which is why it makes Rolf nervous :D).

  6. 37 minutes ago, Rolf Kalbermatter said:

    That's because I don't have a solution that I would feel comfortable with to share. It's either ending into a not so complicated one off for a specific case solution or some very complicated more generic solution that nobody in his sane mind ever would consider to touch even with a 10 foot pole.

    It's only software ;) One isn't constrained by physics.

  7. 16 minutes ago, Rolf Kalbermatter said:

    Unfortunately one of the problems with letting an external application invoke LabVIEW code, is the fundamentally different context both operate in. LabVIEW is entirely stackless as far as the diagram execution goes, C is nothing but stack on the other hand. This makes passing between the two pretty hard, and the possibility of turnarounds where one environment calls into the other to then be called back again is a real nightmare to handle. In LabVIEW for Lua there is actually code in the interface layer that explicitly checks for this and disallows it, if it detects that the original call chain originates in the Lua interface, since there is no good way to yield across such boundaries more than once. It's not entirely impossible but starts to get so complex to manage that it simply is not worth it.

    It's also why .Net callbacks result in locked proxy callers in the background, once they were invoked. LabVIEW handles this by creating a proxy caller in memory that looks and smells like a hidden VI but is really a .Net function and in which it handles the management of the .Net event and then invokes the VI. This proxy needs to be protected from .Net garbage collection so LabVIEW reserves it, but that makes it stick in a locked state that also keeps the according callback VI locked. The VI also effectively runs out of the normal LabVIEW context. There probably would have been other ways to handle this, but none of them without one or more pretty invasive drawbacks.

    There are some undocumented LabVIEW manager functions that would allow to call a VI from C code, but they all have one or more difficulties that make it not a good choice to use for normal LabVIEW users, even if it is carefully hidden in a library.

    None of that is a solution though; just excuses of why NI might not do it.

  8. 56 minutes ago, Rolf Kalbermatter said:

    And that is almost certainly the main reason why it hasn't been done so far. Together with the extra complication that filter events, as LabVIEW calls them, are principally synchronous. A perfect way to make your application blocking and possibly even locking if you start to mix such filter events back and forth.

    Should LabVIEW try to prevent its users to shoot themselves in their own feet?

    No of course not, there are already enough cases where you can do that, so one more would be not a catastrophe. But that does not mean that is MUST be done, especially when the implementation for that is also complex and requires quite a bit of effort.

    We've had these arguments before. I always argue that It's not for me to define the implementation details, that's NI's problem.

    We already have blocking events (the Panel Close? greys out the "Lock Front Panel" checkbox because it's synchronous). The precedent is already there.

    What I think we can agree on is that the inability to interface to callback functions in DLL's is a weakness of the language. I am simply vocalising the syntactic sugar I would like to see to address it. Feel free to proffer other solutions if events is not to your liking but I don't really like the .NET callbacks solution (which doesn't work outside of .NET anyway).

  9. 14 hours ago, smarlow said:

    Do you mean like a return from a dynamic event?

    Not really, although I suppose it is in the same category as what I would propose. I mean more like the "Panel Close?" event.

    The callback would be called (and an event generated). You would then do your processing in the event frame and pass the result to the right hand side to pass back to the function (like the "Discard?" in the "Panel Close?" event).

    image.png.ef91ffa5c886c2c976ff7feeaccfddb4.png

    Of course. Currently we cannot define an equivalent to the "Discard?" output  terminal. They'd have to come up with a nice way to enable us to describe the callback return structure.

  10. 15 hours ago, Rolf Kalbermatter said:

    So LabVIEW falls through the cracks regularly.

    Indeed. However, NI *should* have been aggressive in correcting that.

    15 hours ago, Rolf Kalbermatter said:

    On the other hand is your statistic website also not quite consequent. I would consider Delphi also more the IDE than a programming language. The language would be really (Object) Pascal.

    I agree. Lazarus is the Open Source equivalent and I use a variation called CodeTyphon. But it highlights that even if LabVIEW is considered "vendor software" it should be on those lists as it is more of a programming language than HTML/CSS (as you point out). There could be no argument against inclusion, IMO.

     

  11. 16 minutes ago, Rolf Kalbermatter said:

    It's obvious that LabVIEW always has been a minor player in comparison to these programming languages.

    LabVIEW never seems to even be listed on programming statistic websites. I refuse to believe (also) that LabVIEW has less programmers than, say Raku. Hopefully Emerson will aggressively promote LabVIEW on these kind of sites to raise visibility. NI failed to do so consistently.

  12. 12 hours ago, smarlow said:

    All I know is that if they don't do something to make it a more powerful language, it will be difficult to keep it going in the long run.  It was, in the past always a powerful choice for cross-platform compatibility.  With the macOS deprecating (and eventually completely removing) support for OpenGL/OpenCL, we see the demise of the original LabVIEW platform.

    I for one would like to see a much heavier support for Linux and Linux RT.  Maybe provide an option to order PXI hardware with an Ubuntu OS, and make the installers easier to use (NI Package Manager for Linux, etc.).  They could make the Linux version of the Package Manager available from the Ubuntu app store.  I know they say the market for Linux isn't that big, but I believe it would be much bigger if they made it easier to use.  I know my IT department and test system hardware managers would love to get rid of Windows entirely.  Our mission control software all runs in Linux, but LabVIEW still has good value in rapid application development and instrument bus controls, etc.  So we end up running hybrid systems that run Linux in a VM to operate the test executive software, and LabVIEW in Windows to control all our instruments and data buses.

    Allowing users the option to port the RT Linux OS to lower-cost hardware, they way did for the Phar Lap OS would certainly help out, also.  BTW, is it too much to ask to make all the low-cost FPGA hardware from Digilent LabVIEW compatible?  I can see IOT boards like the Arduino Portenta, with its 16-bit analog I/O seriously eating their lunch in the near future.  ChatGPT is pretty good at churning out Arduino and RaspberryPi code that's not too bad.  All of our younger staff uses Digilent boards for embedded stuff, programming it in C and VHDL using Vivado.  The LabVIEW old-timers are losing work because the FPGA hardware is too expensive.  We used to get by in the old days buying myRIOs for simpler apps on the bench.  But that device has not been updated for a decade, and it's twice the price of the ZYBO.  Who has 10K to spend on an FPGA card anymore, not to mention the $20K PXI computer to run it.  Don't get me wrong, the PXI and CompactRIO (can we get a faster DIO module for the cRIO, please?), are still great choices for high performance and rugged environments.  But not every job needs all that. Sometimes you need something inexpensive to fill the gaps.  It seems as if NI has been willing to let all that go, and keep LabVIEW the role of selling their very expensive high-end hardware.   But as low-cost hardware gets more and more powerful (see the Digilent ECLYPSE Z7), and high-end LV-compatible hardware gets more and more expensive, LabVIEW fades more and more

    I used to teach LabVIEW in a classroom setting many years ago.  NI always had a few "propaganda" slides at the beginning of Basics I extolling the virtues of LabVIEW to the beginners.  One of these slides touted "LabVIEW Everywhere" as the roadmap for the language, complete with pictures of everything from iOT hardware to appliances.  The reality of that effort became the very expensive "LabVIEW Embedded" product that was vastly over-priced, bug-filled (never really worked), and only compatible with certain (Blackfin?) eval boards that were just plain terrible.  It came and went in a flash, and the whole idea of "LabVIEW Everywhere" went with it.  We had the sbRIOs, but their pricing and marketing (vastly over-priced, and targeted at the high-volume market) ensured they would not be widely adopted for one-off bench applications.  Lower-cost FPGA evaluation hardware and the free Vivado WebPack has nearly killed LabVIEW FPGA.  LabVIEW should be dominating.  Instead you get this: image.png.46ff7c8fd8e6f985bfb92195a556b56e.png

    I've always been suspicious of Google Trends because it doesn't give context. The following is C++ but I refuse to believe it's marching to oblivion.

    image.png.003477b4ce8a9fe7073c8128fe039f76.png

    But it's fun to play with :D

    image.png.77693f4165dce9f3188bdfe3c41580f5.png

    • Like 2
  13. 16 hours ago, Antoine Chalons said:

    a couple of times I was happy to find some unfinished project to use as a starting point (toml, zeromq, rabbitmq, redis)

    Happy? Or do you mean grateful for small mercies? You wouldn't have been happier with a documented and example laden product that you can ask questions about and actually works?

    No. There is too much of this thinking around nowadays and it annoys the hell out of me. We (programmers generally) used to be better than this. The rigor and community that made OpenG tools is definitely gone now. I'm not quite sure who is to blame for this mindset creeping in but it's just not good enough :angry: BTW. I also get just as annoyed with "Beta" releases or, as I call it, "Still Not Working".:ph34r:

    Oh well. Back in the private toolkit it goes. Maybe one day I'll get around to it but it's clear that even if I did release it to the community as-is, it'd just be the spawning point for variants which, quality wise, would be just as bad, if not worse.

  14. 52 minutes ago, hooovahh said:

    I disagree. Large amounts of my code online have never required my support.

    It's happened with me several times.  I don't like speaking in these absolutes.  These half finished projects have been extremely valuable to me over the years, way more valuable then having nothing.  Often times I will take the code, polish it, add features, then post it online.  Not as perfect but so someone else could add to it if they ever wanted.  A community that only shares perfect code shares nothing.

    Different philosophies that we probably will never agree on.

    But in this particular case; I have working code with no known bugs and the price for using it is for someone to take responsibility and ownership of it. 

  15. Support is always necessary.

    1 hour ago, hooovahh said:

    And if I'm unwilling to improve them someone else can make the changes.

    That never happens. It's why there are so many half-finished and buggy projects on github. If I'm not prepared to release and support it, I'll either find someone that can or not release at all. What you've never had, you don't miss-right? One day I might get the energy and time-window, but don't hold your breath.

    1 hour ago, hooovahh said:

    I have had a need for a dynamic or ribbon looking interface which is why I made one using the 2D picture control. 

    Both xControls use the 2d picture control for the button/tab bar. You can add buttons/pages either at design or run-time. Where things might be different of how one envisages these things working is that the buttons are, in essence, callbacks. Pressing a button invokes a VI (which is why it's called the Execution toolbar) but most of the features are around managing the buttons/panels. Both the toolbar and tab bar work very similarly that way (tab bar obviously shows the VI in a sub panel). 

    They are pretty feature complete. I suppose the tab bar could add an optional close icon but I never needed it. Hmmm. Maybe I'll add that now :yes:

     

    .... perhaps not :lol:

  16. 17 hours ago, Neon_Light said:

    Hey ShaunR, most of it did work, the only thing the install complained about was:

    "Install National Instruments Device Drivers Now?"

    Are these also on one of the files you linked to? Or do I need to download them seperately?

    Device drivers are on a separate installation DVD (it'll be 10's of GB). While they are probably on the FTP site somewhere, you can download it from the main NI website.

  17. A long, long time ago in a galaxy not so far away I developed two xControls in order to create a VI installer. The VI Installer hasn't really gone anywhere but the xControls that it used were for a Toolbar and a Tab Control. (The string indicator which supports colours on the tab page below was another but that is already available - Markup String).

    installer.png.5d38bf443dd156ba3ea1c277d0e22ded.png

    The two xControls are pretty well defined and feature complete but for them to be introduced into the wild, they need "productionising" (documenting and tidying up FP/diagrams and creating VIPM installers). I've sat on them for years so it's not going to be me that does the last few percent and I don't want to be the one that people go to for support (I have enough out there already that I have to support). So if someone wants to take up the mantle, give me a shout and I'll figure out how to release them.

    The XControls are self contained with their own examples:

    The "Execution Toolbar" xControl example.

    image.png.50675ed53538e37b58ab3290db357b8f.png

    image.png.b62ccbd85006e551dfee28da8f7b2586.png

    The Tab Control xControl example:

    image.png.0c33ba088df0bae2542c5870025f1706.png

    image.png.0febb59758e897bd3c8662b904dd73d5.png

    If no-one is interested then I'll keep them in my private box and sit on them for another decade. :D

  18. On 11/3/2023 at 8:49 PM, smarlow said:

    so that the GUI can be used with other programming languages in addition to G

     

    On 11/1/2023 at 9:41 AM, ShaunR said:

    What we don't need is imports from other languages making it just as bad as all the others.

    Not a huge leap but an improvement on events (IMO) would be Named events (ala named queues). Events that can be named but (perhaps more importantly) can work across applications in a similar way that Windows messages can be hooked from an application-all driven from the Event structure. I initially experimented with a similar technology when VIM's where first discovered (although it didn't work across applications). Unfortunately, they broke the downstream polymorphism and made it all very manual with the Type Specialization Structure - so I dropped it.

    Another is callbacks in the Event Structure. Similar to the Panel Close event, they would have an out that can be described. 

    But getting on to the LabVIEW GUI. That needs to go completely in its current form. It's inferior to all other WISIWIG languages because we cannot (reliably) create new controls or modify existing ones' behaviour. They gave us the 1/2 way house of XControls but that was awful, buggy and slow. What we need is to be able to describe controls in some form of mark-up so we can import to make native controls and indicators. Bonus points if we can start with an existing control and add or override functionality. All other WISIWIG languages allow the creation of controls/indicators. This would open up a whole new industry segment of control packs for LabVIEW like there is for the other languages and we wouldn't have to wait until NI decide to release a new widget set. At the very least allow us to leverage other GUI libraries (e.g. imgui or WXWidgets).

    • Like 2
×
×
  • Create New...

Important Information

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