1 / 28

LabVIEW Data Tools

LabVIEW Data Tools. As presented by Jean-Pierre Drolet May 6, 2003. What is a variant?. It is a polymorphic type that bundles data value and data type. Coercion. Dynamic building of datatypes. Header with type code. Data name. Subtype(s) if any (with fully qualified type descriptors).

iolana
Download Presentation

LabVIEW Data Tools

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LabVIEW Data Tools As presented by Jean-Pierre Drolet May 6, 2003

  2. What is a variant? • It is a polymorphic type that bundles data value and data type. Coercion Dynamic building of datatypes

  3. Header with type code Data name Subtype(s) if any (with fully qualified type descriptors) What is a type descriptor? • Exactly what its name says... • Overview of its structure:

  4. LabVIEW Data Tools • Set of tools to manipulate: • Variant data (polymorphism) • Flattened data • Type descriptors

  5. Palettes

  6. Manipulating Variant • For a close set of datatypes • Trials and errors: no knowledge of low level type/data formats is required

  7. Manipulating Variant • For an open set of datatypes • Analyze the data type

  8. Manipulating Variant • Basic Tool to Analyze types: • Type Descriptor Header Typecast the header into an easily workable structure

  9. Manipulating Variant • Example • Get the size of an array

  10. Clusters as Array of Variants • A Cluster is a list of mixed data • It can be converted to an array of variant elements • elements keep their name • elements can be replaced, added or removed allowing dynamic building of clusters

  11. Clusters as Array of Variants • Cluster to Array of Vdata

  12. Clusters as Array of Variants • Setting Elements by name The name of the data is included in the datatype (wire). It is used to locate the element.

  13. Converting LabVIEW Data • Variant Data contains: • Data name • Data type • Data value • All that is needed to convert LabVIEW data into other formats

  14. Variant Config File • Convert a Variant to an ini line • Name = Value • The data name avoids redundancy

  15. Variant Config File • Convert a simple element Convert to type and write to ini file

  16. Variant Config File • How to convert clusters, or array, or array of clusters, cluster of arrays and so on...? • Convert the variant to an array of variants and use recursion.

  17. Variant Config File • For Clusters Clustername.elementname1 = value1 Clustername.elementname2 = value2

  18. Variant Config File • For Clusters as Section [Clustername] elementname1 = value1 elementname2 = value2

  19. Variant Config File • For Clusters as INI File [TopCluster] elementname1 = value1 elementname2 = value2 [SubCluster1] ... [SubCluster2] ...

  20. Other data Formats • Conversion to other data formats • Variant Config file Vis can be used as templates to quickly design VIs to convert LabVIEW data to/from other formats such as: • Python • XML (Flatten to XML, Unflatten from XML) • SQL command

  21. Format Conversion - Python Data • Python represents ordered sequences (of mixed types) as Lists. • We will represent LabVIEW Clusters and Arrays as Python Lists • We will map other scalar types appropriately

  22. Format Conversion - Python Data • An example – Convert a cluster to Python Data and back again

  23. Format Conversion - Python Data We can convert well formed Python data strings to Python data programmatically

  24. Flatten to XML – pure G version • Why? Error I/O, modifiable (# of float digits), custom schemas

  25. Flatten to XML – pure G version • Most Data Type Are easily handled • Clusters are handled recursively Simple Types:I8..I32, U8..U32, String, Paths Cluster (Arrays of Clusters)

  26. Unflatten XML – pure G version • It’s a lot harder to unflatten XML (or any format). • Is error handling for not well-formed XML strings required? • Why not just use an XML parser?

  27. Formatting SQL commands

  28. Recap • Variant offers polymorphic inputs and outputs for generic VIs • Parsing of type descriptors allows to manage any type of data • LabVIEW Data Tools are a complete set of low level VIs to manipulate Type Descriptors and Variant Data • It is possible to recurse into structures • Conversion of LabVIEW data to other formats is made more easy

More Related