Jump to content

smithd

Members
  • Content Count

    739
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by smithd

  1. Yeah, this is what I would do too. I'm assuming the goal is to make sure that if the program aborts the file isn't corrupt, but you can do that with flush file. If you're taking data every second the continuous open/seek/write/close/open... is going to take a toll. Whats the exact error you get? The modal out of memory error popup dialog, or a code? How big is the file at the time of the crash? Bigger than 2 GB? Are you using 32-bit labview on a 32-bit machine? Bigger than 4 GB? Are you using 32-bit labview on a 64-bit machine? Etc, etc. In theory file open shouldn't need to read the whole file into memory, but 🤷‍♂️ Easiest way to isolate this, though is to generate some representative chunk of fake data and write to a file in a loop relatively quickly (think every 150 ms rather than every second). If its the file code thats the problem, you should see the error within an hour. I would just say its kind of bad form to sequence things like that, as its much harder to read ( as this thread shows) and much easier to make a mistake (for example if you didn't have that clear error in there, or if you added another case but didn't wire the path through [and on that topic, linked tunnels are your friend]). Since we're talking about style, I'd personally do this: Take most of the bulk of case i=1 and make a subVI called "create file name" and a subVI called "create log header" I definitely would not build the path manually as you are doing with the concatenate string function -- I'd use the build path VI I'd wrap the folder check and the create file function into a reusable subVI -- I've never personally found a use for the default behavior where I ask the OS "make me a/file/in/a/folder.txt" and it responds "sorry bro that folder doesn't exist", so I always bundle the two together. The timestamp formatting section can be improved in one of two ways: Format date/time string using these format codes instead of manually bundling things (eg "Date_%Y_%m_%d_Time_%H_%M_%S_%3u") Use format into string with the same timestamp formatting code, except you have to put it inside of %<>T , ie "%<%Y_%m_%d_%H_%M_%S_%3u>T". The advantage to this is you can use the exact same format string to scan it back out again. If you do these three things, your create file case becomes just a few nodes and only takes up a small amount of space on the diagram...plus, you now have a "create file" function which you can reuse on future projects, and with some tweaking you have a "create standard file name" function you can use in the future as well. Excel may be smart enough to handle this, but you should probably set the extension so CSV, TSV, or TXT -- xlsx is in fact a zip file with a specific format, so writing regular ascii text to it will should not work. If you want to make a proper xlsx file (eg an excel file) you can use either the report generation toolkit (kind of slow, uses activex to connect to an excel instance so excel has to be installed on your daq computer) or an addon toolkit like xlr8: http://sine.ni.com/nips/cds/view/p/lang/en/nid/212056 If you have lv2018 and are at least familiar with python, you can use the python node + a small helper method to write to an excel file using xlsxwriter or openpyxl .
  2. I was under the impression that the .net interfaces just wrapped the old activex interfaces. Is that wrong? to actually answer your question I've never used it, but it seems like these might work: text ("TextType" section halfway down): https://docs.microsoft.com/en-us/visualstudio/vsto/how-to-programmatically-insert-text-into-word-documents?view=vs-2017 table: https://docs.microsoft.com/en-us/visualstudio/vsto/how-to-programmatically-create-word-tables?view=vs-2017 If I'm reading the samples right it looks like you can get the current cursor from "Application.Selection" and then insert a table using a method on that object.
  3. as I recall Martijn had some issues with the combo of VIPM mass compiling + *s in the CLFN path. I filed a CAR for him at the time but I doubt its resolved, and his workaround was (again, as far as I remember) that when you install the package it runs a script which adjusts the path based on the platform. The middle ground is what I think most people end up doing, which is to create a VI with some conditional disable code to determine the path. As I was reading this I remembered something else..far, far too late ...NI provides a zeromq build as part of the core package list. Package: zeromq Version: 4.1.6-r0.16 Depends: libc6 (>= 2.24), libgcc1 (>= 6.3.0), libsodium18 (>= 1.0.11), libstdc++6 (>= 6.3.0) Section: base Architecture: cortexa9-vfpv3 Maintainer: NI Linux Real-Time Maintainers <nilrt@ni.com> MD5Sum: ea3774e76c28b7c5b07318b4502fec9e Size: 147468 Filename: zeromq_4.1.6-r0.16_cortexa9-vfpv3.ipk Source: zeromq_4.1.6.bb Description: zeromq version 4.1.6-r0 ZeroMQ looks like an embeddable networking library but acts like a concurrency framework OE: zeromq HomePage: http://www.zeromq.org License: LGPLv3+ Priority: optional Package: zeromq-staticdev Version: 4.1.6-r0.16 Depends: zeromq-dev (= 4.1.6-r0.16) Section: devel Architecture: cortexa9-vfpv3 Maintainer: NI Linux Real-Time Maintainers <nilrt@ni.com> MD5Sum: 686b2b13e3908313aa35da8b46955ddc Size: 3765648 Filename: zeromq-staticdev_4.1.6-r0.16_cortexa9-vfpv3.ipk Source: zeromq_4.1.6.bb Description: zeromq version 4.1.6-r0 - Development files (Static Libraries) ZeroMQ looks like an embeddable networking library but acts like a concurrency framework This package contains static libraries for software development. OE: zeromq HomePage: http://www.zeromq.org License: LGPLv3+ Priority: optional All you should have to do is opkg update, opkg install zeromq, and opkg install zeromq-staticdev. Its available at least as far back as 2017. Note: you will still need to compile the wrapper library
  4. Thats kind of a circular question -- if the manufacturer doesn't want people to use their driver standalone, then they will not provide a header. If they want people to be able to use their driver standalone, they must provide a header. As I recall, lib files are only for statically linking within your application, which means you'd have to be writing in c or c++. LabVIEW and most everything else can only call dlls. If you only have a lib and not a dll, you'd have to write a little wrapper library and use a C compiler to build the wrapper+lib into a dll.
  5. The docs are a bit old, but it would be worth reading these: https://forums.ni.com/t5/Developer-Center-Resources/Tutorial-Configuring-the-Call-Library-Function-Node-to-call-a/ta-p/3522246 https://forums.ni.com/t5/Developer-Center-Resources/Calling-C-C-DLLs-from-LabVIEW/ta-p/3522488 Just skimming your PDF, a lot of this this looks like a reasonably straightforward dll to call from LabVIEW, but you have to get conceptually used to the interface. For example many of the functions have an opaque pointer like "CIFXHANDLE" which is represented in labview as a U64, but in order to get that pointer in the first place (xDriverOpen) you have to pass in a "0" value by reference, and the dll will overwrite that and provide you with the actual pointer on the output side of the CLFN. There are also a good number of things that are impossible in LabVIEW, namely callbacks: int32_t xSysdeviceDownload( CIFXHANDLE hSysdevice, uint32_t ulChannel uint32_t ulMode, char* pszFileName, uint8_t* pabFileData, uint32_t ulFileSize, PFN_PROGRESS_CALLBACK pfnCallback, PFN_RECV_PKT_CALLBACK pfnRecvPktCallback, void* pvUser) If you need those callbacks (they are optional), you can't create them natively from LabVIEW. You will have to make your own simple wrapper library which implements the callback functions. Given that there are about 80 pages of function descriptions, you might want to take the time to copy out all the calls you think you are going to need to use, and then review those calls for callbacks or other potential issues (the other big one that comes to mind is if functions lack a clear termination mechanism -- ie a "read" function that has no timeout or other way to cancel the read)
  6. Yeah its not super high in the grand scheme, but $2k for an addon to a product thats already $3k or $5k (not clear if you need the app builder license for building web apps?) seems pretty steep. Probably more to the point, it doesn't seem to be bundled with anything (not even software platform bundle). They seem to be deliberately targeting only people who really for sure want that functionality, which is kind of interesting within the context of NXG as a whole which they are literally giving away to try to get people interested in using it.
  7. 😢 Sometimes I just remove an entire splitter section and start over Theres a checkbox One of the first things I do on a new labview install, along with disabling the tiling shortcut, setting terminals to required, and removing that stupid number from new VI icons Ughhh. I hate the silver controls. Too much chrome. I generally use a combination of drjdp's flatline along with system and a collection of internal controls which includes a giant amount of scripted booleans using feather and iconic. To your second point -- I knew it was old based on the version number but I couldn't find a standalone screenshot of similar quality anywhere so I decided to punish them. Presumably thats why wikipedia still uses such an old screenshot. For what its worth I also include your example in this because the part thats attractive about it is really just PNGs. It doesn't demonstrate the core widget library that most people would use. And if you look at the designer, its seems like some stuff (type and ID in the middle of the right side for example) is just a hasty skin over top of an old library -- or at least thats how I interpret it because the weird left-side justification is the sort of artifact you get when you try to fiddle with labview controls in a similar way. On the theme of punishing them, I like this one, technically part of the help for the current major version (qt5).
  8. what you said worked The probe window is indeed annoying, I just have never thought about making indicators since then you have to restart the application and that can get quite annoying esp on rt. Its kind of funny I never thought about it because thats the workflow you have to use on fpga, but 🤷‍♂️ I think people conflate style and functionality on this topic. The style of labview controls is kind of old, but not any worse than wxwidgets or gtk+ or qt or windows forms. The stuff that makes labview stand out to me is resizing failures (lol @ trying to get splitters positioned nicely), composability failures (lol...xctrls), and the inability to instantiate new controls at runtime (now resolved in nxg). For contrast, its not like these (wx or gtk or this stark example of modernity) are all that more attractive, they just have features that allow for their developers to create better functionality. My favorite example is I think audacity which looks like complete garbage, but would be very difficult to develop in labview for..well look at it.
  9. Nope: And I can confirm both windows update correctly -- when I made the control it popped up in the panel side immediately. The reason I say its clunky is that you have to open the VI, pop it out of the main window, open the VI again, pop it out, and then switch. They need to streamline this, but the functionality is definitely there.
  10. Really? I've always hated the multiple windows. The MDI is one of my favorite things. The inconsistency makes me laugh, though, like making context help floating (there is only one -- I'd really rather it be docked and always on) and making palettes docked (I want several instances, so floating makes sense or at least allocating space on each side of the diagram so you can have one thats pinned and one thats not). I'm genuinely curious about this one...why both? My only experience with having FP and BD side by side is when I accidentally hit the stupid tiling hotkey on a new install, just before I go into the settings and permanently remap it to something out of the way like ctrl+alt+shift+\. I honestly can't think of a time I've ever done this. NXG has this too. Admittedly last I checked it was slow and clunky, but...
  11. The page you linked to is only for c dlls. If its a .net assembly dll, you can use the labview .net interface. https://forums.ni.com/t5/Developer-Center-Resources/Calling-NET-Assemblies-from-LabVIEW/ta-p/3523180 to test this, drop down a constructor node and from the dialog, select browse and locate your dll. If it loads, you're in the right spot.
  12. Dunno if this is the same time frame, but I vaguely remember that early on they seemed to be saying "our users complain about absurd right click menus, therefore -- no more right click menus!". That seems...better in 3.0, although I honestly still can't remember which icon is which. I actually like that the terminals don't show up by default. After all, 99% of your code doesn't need a UI. Also, I dunno about you but I'm going to accidentally close so many windows. I'm used to ctrl+w'ing twice as many times. Yeah, I've always been under the impression was that NXG was for NI's efficiency, not users (directly). They wanted to try to provide tools that make the debugging and documenting and editing easier, but the 20 year old codebase was hindering them in doing so. The reason is likely along the lines of what you said, although its probably a bit simpler: reading code is hard. Poor microsoft, they can never forget 👻
  13. Yeah they are still available, but I'm saying I've seen the NI guys on the linuxrt forum suggest target compilation. Can't find it now of course. In actuality the compilation part isn't much different -- running vim over ssh on an arm crio is approximately as painful as using eclipse. The part that is more difficult is the configure step. ZeroMQ has a ton of optional settings (which event mode to use? select, poll, epoll, kqueue... security? they have an NaCl based encryption scheme...etc.). You can technically figure out each one, but copying to the target and running configure is a looooot easier.
  14. Woops, I decided to kill off my rant but I guess you were already responding. I guess you're right, but I'd like to revise my comment -- I don't want to have to flip back and forth between byte arrays and strings. I want to be able to index characters out of strings, and I want to be able to search for a subset within a byte array, etc. The shift towards saying all strings are unicode without enhancing the features associated with binary byte array seems like a mistake.
  15. I'm fairly curious about these statements -- is the issue a lot of small incompatibilities like the ones I mentioned, or something more major? Lol -- python
  16. I'd rather they do tls You don't normally need ssh to be fast, so using something like this https://github.com/sshnet/SSH.NET/ or calling putty using system exec isn't a huge deal.
  17. Depends on how they are trying to compile it. Back in the 2013 time frame I got it working the way that was being recommended at the time, which was through the eclipse cross-compile tools. Unfortunately, when NI moved to the new community system all that got deleted (as far as I can tell). The more recent recommendation I've seen is to just compile it on the target. I can confirm that works, at least a year or so ago. You just copy the whole source directory onto the cRIO and run the commands specified in the source (configure, make, make install probably). Before you can run those commands you need to have the build tools installed, which you can get by 'opkg install packagegroup-core-buildessential' (https://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/Building-software-for-NI-Linux-RT/td-p/3372279/page/3). You may find that it says a library is missing, in which case you'll usually need to look in opkg for the -dev version of the library in question. For example, I compiled drivers for a USB device so I needed to find libusb-dev and then some libusb compatibility layer as well. I doubt you'll find using the 9038 any easier, as its still the ni flavor of linux.
  18. Probably more like 2025 or 2030 I thought, unless you mean 'when they stop caring about current lv at all'
  19. I have it installed, last time I tried to migrate even a small part of a shared library everything broke. I need RT support, subpanel support, I'm not looking forward to figuring out dll calls, and I rely on drjdp's json stuff which last I heard, I thought didn't work in Nxg due to how variant parsing functions changed. Now that the strings are all supposed to be unicode, it scares me a bit to upgrade any binary-based parsing so we'd need to spend time validating that. They changed VI server open VI from having an input specifying normal/call and forget/call and collect so now its hardcoded per node, which may cause failures. Last time I tried to use it for a small, new project I gave up because it was too slow and I couldn't handle it.
  20. I've used that in the past too, but i was creeped out today when I looked at it and saw that the downloads were http instead of https. The reason I noticed was that windows claimed the 32-bit version had a trojan. I'm assuming it was a false detection, but even if thats the case you shouldn't be serving up installers over an unsecure connection.
  21. DB browser seems to only support png/bmp. I found a video suggesting jpeg support too, but the link said only via nightly builds
  22. This is a pretty important piece of information. I took a quick look at their page (unfortunately their support forums are down, and there is no way I'm installing that software on my computer, so this is all I can go on) and it seems to say it supports bmp and jpg images. from your posts, you have so far provided it with: The pixel values of an image, type cast directly into a string with no metadata The NI vision software flattened representation of an image. I'd suggest the following: If you have a bmp or jpg image, use the read from binary file function with a elements to read set to -1 (to read the whole file as one big string) and pass that directly to sqlite. You may need to make sure that sqlite administrator knows the type, but i think bmp and jpg both use linux-style 'lets hide the extension inside the file' encoding, so its probably not necessary. If you have an imaqdx image in memory, use writestring (https://zone.ni.com/reference/en-XX/help/370281AD-01/imaqvision/imaq_write_string/) to generate a bmp or jpg string, and pass that directly to sqlite. To give a slightly more complete explanation, if you read the first few posts on this page we discuss the sqlite type system, which is very flexible -- in this case, everything is a string. You told everyone you wanted to store images in the database, which you were successfully doing in the formats described above. You did not explain that you had a very specific tool in mind for reading those images back out, and that is where the problem lies. It was expecting the string to be a specific format, and you were storing it not as that format.
  23. Shouldn't such absurd rules come with a budget? Like, no you can't take the machine out of the secure area but here why don't you just buy another instead?
  24. Lol sounds like intended behavior to punish those who ignore errors I think the missing part is that Tanner also added an incrementing counter on the send side, so you should see errors on every subsequent read because the counter will never catch up.
  25. Ah yes thats much nicer. I didn't know it could be broken up like that
×
×
  • Create New...

Important Information

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