Jump to content

drjdpowell

Members
  • Posts

    1,973
  • Joined

  • Last visited

  • Days Won

    178

Everything posted by drjdpowell

  1. Like most problems, once I had a workaround, I no longer spent any time thinking about it.
  2. I've encountered a black imaq image display in exes, solved by unchecking the box to allow running in a later runtime version. Don't know if that is related to your problem.
  3. There are quite a lot of other message-passing frameworks that you might want have a look at. DQMH, (my own) Messenger Library, Workers and Aloha are on the Tools Network, for example. AF and the QMH template are not the only things out there.
  4. https://bitbucket.org/drjdpowell/jsontext/issues/80/2d-array-of-variants-not-converting Will be fixed in 1.5.2
  5. Can you attach the vi you show? Nevermind, I've reproduced it.
  6. Your attribute Values need to be valid JSON. You are inputting just strings. Convert your strings to JSON first.
  7. Do you check for an error coming out of SQLite Close? SQLite will not close and throw an error if unfinalized Statements exist on that connection. The unclosed connection would then continue to exist till your app is closed.
  8. Example are in <LabVIEW>\examples\JDP Science\JSONtext, accessible through VIPM: The JSONpath example might help.
  9. I've just implemented this and posted a beta: https://forums.ni.com/t5/JDP-Science-Tools/BETA-version-of-JSONtext-1-5-0/m-p/4136116 Handles comments like this: // Supports Comments { "a":1 // like this "b":2 /*or this style of multiline comment*/ "c": 3 /*oh, and notice I'm forgetting some commas A new line will serve as a comma, similar to HJSON*/ "d":4, // except I've foolishly left a trailing one at the end }
  10. I have been coming round to supporting comments in JSONtext, at least for ignoring comments on reading (which is quite simple to implement, I think). And possibly features to be more forgiving of common User error, such as missing commas.
  11. Can't tell if that is just NI being overcautious, or there is an actual reason for that. Python 2 was sunsetted at the start of this year, so no one should use that. I'm guessing the NI's testing was done against 3.6, as the latest available version when they originally developed the python node.
  12. Not sure it is sophisticated, but here is a simple implementation of an Example that increments a counter (state variable), with an error thrown if count exceeds a MaxCount (state variable). The py Module is called from a LVOOP Object that encapsulates the Python instance. The Class has methods that call the corresponding py-module functions. Python Incrementer.zip py module is this: # Demo of a Python Module, to be called by LabVIEW # Notes on Errors: # Return errors in a form matching the LabVIEW Error Cluster. Examples: # Error = (False,0,"") # No Error # Error = (True,1,"MySource<Err>MyDescription") # 1==Error in input import time # used for sleep() # Example of having global data (global just to this module): Count = 0 MaxCount = 10 def Initialize(): Error = (False,0,"") # No Error (change to indicate an error) return(Error,) def GetCount(): global Count return (Count); def Increment(): Error = (False,0,"") # No Error (change to indicate an error) global Count global MaxCount if Count >= MaxCount: Error=(True,1,"Increment<Err>Can't Increment as at MaxCount") else: Count += 1 time.sleep(.3) # Wait, to count slow enought to see return (Error,Count); def SetMaxCount(NewMaxCount): Error = (False,0,"") # No Error (change to indicate an error) global MaxCount MaxCount = NewMaxCount return(Error,)
  13. Side note: I am definitely going with the native node, in LabVIEW 2020. I think NI is underselling it by providing examples that are far too simple (including no examples of cluster-to-tuple or how to hold state data in your py module). I prototyped my analysis template py module yesterday and it went easy. No head banging frustrations at all.
  14. Hey, I haven't got even one project using python yet. And my Dev PC uses virtual machines, which I already use for issues like developing with or without Vision installed.
  15. Though I see the value in that, I don't think that is a significant advantage in my case. Actually a disadvantage, as my client is already overburdened with "too many things" complexity and would benefit from a standardized python environment. I also want to minimize the complexity of install on a fresh computer, and I think the native node only requires python itself.
  16. Can you say more about that? What do you mean by a "virtual environment"? I experimented with the native node in LabVIEW 2020 and I'm liking it so far.
  17. For example, my Interface in JSONtext (if JSONtext were based in 2020 rather than 2017) would just implement "To JSON" and "From JSON" methods, whose default implementations would just use the standard flattening of the class in a JSON string. I've have been holding off implementing this as a parent class because I was waiting for interfaces. Should I just go ahead and make this a Class? Note that a User could not use your Lineator to actually do the conversion to JSON, as they cannot inherit off your Lineator if they are already inherited off my Class. If Interfaces were used, they could use your Lineator to produce JSON inside my JSONtext subVIs.
  18. Just top-level parent classes that inherit from LVObject, then? If LVObject gets private data, even an inheritance-based serializer will fail. I haven't looked at your "lineator" in a long time, but I feel there must have been some architectural choices made that other developers may have reasons for making other choices. Thus, there is a need to be able to support more than one type of serializer in the same class hierarchy. Thus interfaces, maybe?
  19. I am just starting on trying to be able to use Python code from a LabVIEW application (mostly for some image analysis stuff). This is for a large project where some programmers are more comfortable developing in Python than LabVIEW. I have not done any Python before, and their seem to be a bewildering array of options; many IDE's, Libraries, and Python-LabVIEW connectors. So I was wondering if people who have been using Python with LabVIEW can give their experiences and describe what set of technologies they use.
  20. You can add them to classes whose ancestors have no data (such as LVObject). You might have a "Flatten to JSON" interface and a "Flatten to XML" interface and a "Store in My Special Format" interface, and can decide which formats to implement. Inheritance only works once.
  21. Code for this posted at NI: https://forums.ni.com/t5/JDP-Science-Tools/IMAQ-Images-Monitor/m-p/4131248#M31
  22. Update: I used the dll call from the link @dadreamer provided, and made a Messenger-Library "actor" that I can use for debugging. Already found a couple of bugs with it.
  23. I assume you've seen my conversation: https://lavag.org/topic/21651-git-cant-be-this-terrible-what-am-i-doing-wrong/
×
×
  • Create New...

Important Information

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