Jump to content

drjdpowell

Members
  • Posts

    1,973
  • Joined

  • Last visited

  • Days Won

    178

Everything posted by drjdpowell

  1. Did you add "file:" to the front to make a URI path. And what do you mean by "does not work"? What are you expecting shared-cache mode to do exactly? Shared Cache has nothing to do with multiple computers accessing a db (and yes, that is something you would be better off using Postgres).
  2. I have never tried shard cache mode. Are you sure you actually need it? If so, try using a URI path to set it following this: https://www.sqlite.org/c3ref/open.html#urifilenameexamples
  3. On the off chance anyone does use this, I have a beta with improvements: https://forums.ni.com/t5/JDP-Science-Tools/Beta-of-Cyth-SQLite-Logger-1-7-2/m-p/4208206 Biggest improvement might be a highlighting mode, as an alternative to the usual filtering, so entries matching the pattern show up in blue:
  4. My point about Network Streams is not that they aren't a useful set of features for some uses cases, but that building something different, with contrary features, on top of them usually makes no sense. For example, the package hooovahh has posted does (if I read it right) use pinging to check messages are being received, and will close the Network Streams if it doesn't receive a response in about 1 second. This destroys the buffers of any waiting messages and means there is no QoS delivery at all, making all that stuff useless overhead. Not that it matters, because it is also a Request-Reply system where there can only be one active Request, and thus there is nothing to buffer. This makes the "explicit buffer sizing" and "flush method" features entirely meaningless. Network Streams are bringing nothing to teh party here but overhead.
  5. LabVIEW.exe has a public moveblock method that you can call. I find it is better to call it directly than inside those subvis enserge shows.
  6. I have my own package called Messenger Library, which is an alternative to those other frameworks. Within that, my template of a message/event handler is called the DEV Template. There is a video on the DEV on the Wiki.
  7. I have just posted a Beta version of Messenger Library 2.0: https://forums.ni.com/t5/JDP-Science-Tools/Messenger-Library-2-0-Beta-LabVIEW-2019/m-p/4199634#M49 This is in LabVIEW 2019
  8. There are a lot of possible options for encoding Variants, all with a different set of advantages and disadvantages. Without a clear use case, it is difficult to see what the best choice would be.
  9. The Type input just sees "array of clusters". Normally one just inputs an empty array; there is no code to look at individual elements of the array. Theoretically, this could be done, but that seems a very low-value use case so chances of me doing that are zero. Actually, it was a mistake of mine to implement the first part of your code; doing it again I would convert Variants in Clusters to 'null' and throw a "Variants not supported" error. This would keep my options open to introduce, without breaking changes, a better Variant support that includes encoding teh data type (along the lines of what Shaun describes). There is a number of possibilities, for example: { "config file:["c:\temp\config.ini",{"LVtype":"Path"}], "Room Temp":["21.4",{"LVtype":"DBL"}] } I am held back from that, partly because it would now be a breaking change, and partly because I have yet seen an example of someone using Variants and JSON that would not be far better implemented in just JSON.
  10. I believe JKI JSON converts to Variants containing the basic JSON-matching types: String, Boolean, Number (DBL, I'm guessing). Then it also provides, if I remember, a special VI to convert that Variant into your cluster of actual specific data types. One of the reasons I don't like that is that it ties things to a monolithic LabVIEW type, the Cluster, that is not as flexible as JSON Object/Arrays. You show the same "LabVIEW tunnel vision" in your design of an array of "Group", "Name", "Value" clusters. That's a common way to handle the limits of LabVIEW. In JSON, the natural structure is this: { "Basic": { "config file":"c:\\test\\config.ini", "Operator:"Muller" }, "Extended": { "Room Temp":21.4, "Test No":0, "ping":null } } That isn't really doable with your LabVIEW Arrays and Clusters, even if I give you some extra Variant support. But you have tools to do stuff like this in JSONtext.
  11. I would encourage you to try the "subJSON" described in the conversation LogMAN linked to. Basically, replace your "Value" variant with a string labelled "<JSON>Value", and convert your values to JSON (at all the places where you now have "Set Data Name__ogtk.vi"). Then, wherever you are converting your variants to strict type, instead convert the subJSON to that type. The problem with using Variants and JSONtext is that the JSON doesn't contain the specific type information needed to recover the data in the Variant.
  12. I don't have the filtering syntax of JSONpath yet implemented in JSONtext. In fact, you surprised me by seeming to indicate that $..[?(@.folder=="User/Admin/UserA")] actually works, when it doesn't. At some point I may have teh time to implement that, but in the meantime consider filtering code in LabVIEW like this
  13. That's right. And make sure you test your code as it changes to/from Summer Time, as that is where once a year bugs can happen.
  14. I used to use Scan From String function, with %T codes: But I wouldn't say this was any stronger than your method. Now I use a reusable library for RFC3339 (subset of ISO-8601). This uses Scan From String mostly, but is robust against a variety of edge cases. Also handles things like the Local Time plus Offset format, which is nice in that it stores both Local Time and UTC time:
  15. There I was thinking about a simple fix to your immediate problem, rather than the much bigger change of switching to UTC. Using DST=-1 is to use true Local Time, which is what your Users will find most intuitive. But one time a year your times will jump back one hour, which is a rather problematic behaviour. You could use Local Time never corrected for Summer Time; easier for you but confusing to Users. Aside: I suffer the programmer disadvantage of living in the Western European Timezone, which is the same as UTC for half the year, making it hard to notice errors in my UTC-Local conversion. I often have my computer set to a far away Timezone when I'm debugging time-related things.
  16. But to answer you question, I would go with DST=-1. There will be one hour per year (Fall Back) where LabVIEW won't be able to know what the UTC time actually is (as there are two possibilities), but otherwise it would work. Note, though, that i never use that function that you are using.
  17. I also strongly recommend using UTC usually (with conversion to Local Time for display). And using an existing, hopefully well tested, library to convert to/from ISO-8601 (my own functions are in https://www.vipm.io/package/jdp_science_lib_common_utilities/, though they are intended just for the RFC3339 internet standard and may not be as complete as Francois').
  18. I remember CognoscentUI being quite impressive: https://forums.ni.com/t5/Example-Code/CognoscentUI-XControl-LVOOP-Animation-Unicode-and-Image/ta-p/3495160
  19. JKSH has explained as well as I could the expected use. "Missing from Object" is determined when operating on the Object. I had a look, and it should be reasonably easy to give a different error for a string with only whitespace, but I'll need to understand use case for it better. I, personally, never find the need to write custom error-handling code. By the way, if one's use case is "set from this JSON as much as possible, or use supplied default for items where this is not possible", then one can just not use the error wires at all.
  20. I am actual about to commit to making the next release in LaVIEW 2019, rather than 2017, as VIMs were very new in 2017 and both buggy and of limited capability.
  21. Use case? Why do you need different custom error than the 402841: "Invalid JSON formatting" that you have now?
  22. Since Latin for six is "sex", we could have gone for "sexidecimal".
  23. So? Main.vi knows it might need disposing, as it did the creating, so do the cast.
  24. Note that System could have a method to remove the Transport ("uninject"?). Main.vi can remove the TCP and dispose of it, just before it disposes of System.
  25. The problem I have with the Network Streams QoS arguement is that TCP already does this, using ACKs and retries to ensure an ordered stream. And if I really needed to be sure a message is handled, I need to verify it all the way through the application to the final result, not just through the Network Stream message delivery. For example, if I need to send something to be saved to disk, I need QoS all the way to disk, and would have to implement a custom buffer on the send side, layered on top of Network Streams.
×
×
  • Create New...

Important Information

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