Jump to content

bjustice

Members
  • Posts

    159
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by bjustice

  1. Yep!  TOML is like INI file syntax learning how to do everything that JSON can do... with comments.  I'm a fan.

    I've also been using the Erdosmiller library.  I've found a few bugs, it's not full-feature, and it's not TOML 1.0 compliant. (TOML just 1.0'd recently).  It's the best I've found thus far though, and it's been working well enough for me.

  2. I've been a big advocate for the Enthought Python integration toolkit in the past.  Unfortunately, the product was discontinued when LabVIEW introduced the native python node.
    I'm still scraping by on this product as I've not found a good alternative, and the built-in LabVIEW python node doesn't meet my needs.
    Under the hood, the Enthought product was just a TCP link to Enthought's flavor of python called Canopy... which has also been discontinued.  :(
    This product was fantastic for a few reasons:

    • Canopy environment could be packaged into a lightweight Python runtime engine, which can be zipped up and passed around with LabVIEW executables.  Made it easy to deploy the code to many machines.
    • 32/64 bit LabVIEW compatible
    • fast read/write of large data to/from Python

    Relevant link:
    https://support.enthought.com/hc/en-us/articles/360035630192-Toolkit-End-of-Life-Porting-to-LabVIEW-s-native-Python-support

    I recognize that this probably isn't helpful... but a datapoint

     

    • Thanks 1
  3. Thanks, great thread!

    Does anyone know how I might be able to get ahold of, or export all of these cool symbols as BMP files?
    It looks like all of the extended symbols in the special MCL are stored as "built-in symbols" for the MCL.  As such, I can't seem to export them using the method:
    Custom Item Symbols:Get Symbol.  (This method returns an empty data array.)

    image.png.c52e62210699d88c89fa607b932c4815.png

  4. 2 minutes ago, LogMAN said:

    This was meant as a proof of concept to see if it can be done and if it's something worth investigating. I should probably mention that this branch has a few bugs that I haven't fixed yet.

    Certainly not something I would use in production right now but still, I believe there is some value in this - especially for general-purpose libraries like JSONtext. Anyway, I'll back save and upload when I have access to LV. By the way, the details are explained on the Wiki: LabVIEW Object - LabVIEW Wiki

    I haven't found a better way to do this without adding (or scripting) methods to every class. The only function that currently breaks encapsulation natively is Flatten To XML, which has its own limitations.

    Ha!  I now feel silly for responding to your first post with a link back to your own JSONtext branch.

    Did you encapsulate your object (de)composition into a reuse library of sorts?  Or is it pretty entangled in your JSONtext branch?
    I read through your code and did indeed find that wiki page.  Very cool stuff.
    There are certainly large benefits to doing it the way that you did things in your JSONtext branch.  You don't have to inherit from a base class, so all classes become inherently serializable.  And there is no need for scripting or creation of data member accessors to allow for the library to do its job.

    Yeah, we noticed some pretty big limitations to the "Flatten to XML" primitive as well.  This tends to leave out fields in the output XML if they are default value in the object.

  5. Our code supports nested and arrays of classes that inherit from the base "Serializable.lvclass" gracefully.

    Classes are represented as a nested cluster in the serializable string (JSON, XML, TOML)

    Objects that don't inherit from the base "Serializable.lvclass" are treated in the same manner as JSONtext handles objects... flatten/unflatten from string.  If error on unflatten, then return default object

  6. We adopted the notion that classes must inherit from a base "serializable.lvclass".  This activates the Project Provider plugin (project tree scripting methods).  We didn't see a convenient way around this, and we didn't see this as too much of an inconvenience.

    Where we noticeably diverged from AQ Char Lineator is that we (through scripting) create a "SerializableData" cluster typedef that gets dropped into the class private data.  Only data within this cluster is consumed by the serialization framework.  all other data is ignored.  This simplified things in that we only need a single future-proof data read/write accessor for this cluster.  A user can update serializable data by only editing this typedef... they don't have to touch any VI source code.

    Pros and cons to this solution.

    • Like 1
  7. While researching this, I discovered 2 other projects that solved serialization of objects using (de-)composition of private data using the flatten to string and TypeDescriptors:

    JSONtext branch with object support:
    https://bitbucket.org/logmanoriginal/jsontext/src/lvobjectserialization/

    paid 3rd party library "JSON Object Serialization by GCraftsman":
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/215788

    • Like 1
  8. I would certainly be interested in taking a look.

    Internally, we made the early decision that we didn't want to directly access class private data through string flattening or by inspecting the class' *.ctl file.  We felt that this violated the covenant that class data should only be accessed through data accessors.  As such, we moved towards a Project Provider plugin framework that scripts accessing of class private to work with our serialization engine.

    • Like 1
  9. Per: https://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/type_descriptors/

    Quote

    The first word (16 bits) in any type descriptor is the length, in bytes, of that type descriptor, including the length word. The second word (16 bits) is the type code. LabVIEW reserves the high-order byte of the type code (the xx in the following tables) for internal use. When comparing two type descriptors for equality, you should ignore this byte.

    I wonder if the fixed point was in some sort of weird BETA state in LV 2009

  10. Ok, so, now knowing this information, it seems like the following needs to happen:

    • Add the following to: "Type Descriptor Enumeration__ogtk.ctl"
      • "Fixed Point"
      • "Map Collection"
      • "Set Collection"
    • Add the following to: "Refnum Subtype Enum__ogtk.ctl"
      • "LabVIEW Class Instance"
    • Update the holy LabVIEW wiki

    It's interesting to learn here that we can't 1:1 match "Type Descriptor Enumeration__ogtk.ctl" to "NI_Data Type.lvlib:Data Type.ctl" since these are inherently different

  11. At an absolute minimum, would there be any interest here in releasing a new update for the OpenG LabVIEW Data VIPM package to include the following datatypes in the OpenG TD?:

    • LabVIEW Class instance
    • Map
    • Set

    It seems like this would be an easy and backwards compatible update.
    I make this request because legacy code such as EasyXML heavily leverage the OpenG TD.  It would be minor hassle to replace this with the native LV TD.

×
×
  • Create New...

Important Information

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