jsonlv_0.9

所属分类:LabView编程
开发工具:LabView
文件大小:628KB
下载次数:11
上传日期:2017-10-23 14:17:46
上 传 者NileshV
说明:  Read JSON formatted string in Labview

文件列表:
jsonlv\.hg (0, 2012-09-22)
jsonlv\.hg\00changelog.i (57, 2012-09-22)
jsonlv\.hg\cache (0, 2012-09-22)
jsonlv\.hg\cache\tags (44, 2012-09-22)
jsonlv\.hg\dirstate (691, 2012-09-22)
jsonlv\.hg\last-message.txt (14, 2012-09-22)
jsonlv\.hg\requires (33, 2012-09-22)
jsonlv\.hg\store (0, 2012-09-22)
jsonlv\.hg\store\00changelog.i (303, 2012-09-22)
jsonlv\.hg\store\00manifest.i (750, 2012-09-22)
jsonlv\.hg\store\data (0, 2012-09-22)
jsonlv\.hg\store\data\json.aliases.i (105, 2012-09-22)
jsonlv\.hg\store\data\json.lvlps.i (148, 2012-09-22)
jsonlv\.hg\store\data\json.lvproj.i (754, 2012-09-22)
jsonlv\.hg\store\data\json__array.vi.i (29217, 2012-09-22)
jsonlv\.hg\store\data\json__build_cluster.vi.i (70535, 2012-09-22)
jsonlv\.hg\store\data\json__drop_cluster.vi.i (21135, 2012-09-22)
jsonlv\.hg\store\data\json__error.vi.i (7827, 2012-09-22)
jsonlv\.hg\store\data\json__example.vi.i (13748, 2012-09-22)
jsonlv\.hg\store\data\json__flatten.vi.i (15433, 2012-09-22)
jsonlv\.hg\store\data\json__make_control.vi.i (9457, 2012-09-22)
jsonlv\.hg\store\data\json__next.vi.i (11811, 2012-09-22)
jsonlv\.hg\store\data\json__number.vi.i (22278, 2012-09-22)
jsonlv\.hg\store\data\json__object.vi.i (19410, 2012-09-22)
jsonlv\.hg\store\data\json__parse.vi.i (10546, 2012-09-22)
jsonlv\.hg\store\data\json__script_cluster.vi.i (22606, 2012-09-22)
jsonlv\.hg\store\data\json__string.vi.i (14466, 2012-09-22)
jsonlv\.hg\store\data\json__value.vi.i (16278, 2012-09-22)
jsonlv\.hg\store\data\json__white.vi.i (11368, 2012-09-22)
jsonlv\.hg\store\data\json__word.vi.i (18043, 2012-09-22)
jsonlv\.hg\store\data\license.txt.i (899, 2012-09-22)
jsonlv\.hg\store\fncache (462, 2012-09-22)
jsonlv\.hg\store\undo (558, 2012-09-22)
jsonlv\.hg\undo.bookmarks (0, 2012-09-22)
jsonlv\.hg\undo.branch (7, 2012-09-22)
jsonlv\.hg\undo.desc (9, 2012-09-22)
jsonlv\.hg\undo.dirstate (691, 2012-09-22)
jsonlv\json.aliases (44, 2012-09-22)
jsonlv\json.lvlps (83, 2012-09-22)
... ...

Version 0.9 - Joe Zoller (joe@underflowsoftware.com) This is a library of VI's designed to transform any valid JSON to a generic format that LabVIEW can make use of, without resorting to extensive pattern matching or cluster manipulation. The json_parse.vi implementation is based heavily on Douglas Crockford's reference implementation of json_parse.js, currently found at https://github.com/douglascrockford/JSON-js. json_parse.vi: returns a variant. A string containing JSON is read character by character by the parser. As different boundary characters are encountered, different elements are parsed out of the stream. Each element is transformed to a key value pair variant attribute. A programmer can then use the Get Variant Attribute and Variant to Data primitives to grab the data as needed. Invalid JSON should be caught with an error that causes execution to stop as soon as the recursion is unwound. Because mixed type arrays and key-value pair arrays are not valid in LabVIEW, arrays are stored as attributes on a sub-variant. The first element in the array has an attribute name of "0", the second is "1", etc. When an array is found to have a single type, an additional key-value pair with the name "array" is generated. This additional single type array can be grabbed without having to traverse each attribute. json_flatten.vi: returns a variant. Since json_parse.vi returns a nested variant, it might be quicker to deal with a flattened version. This VI transforms the nested variant into a set of dot delimited key-value pairs. json_scriptCluster.vi: generates a .ctl. A programmer may wish to create a cluster that corresponds to the JSON structure. This VI takes the JSON variant, and uses scripting to produce the corresponding cluster. Sub-objects are turned into sub-clusters. For a variety of reasons, arrays appear a bit oddly in the cluster, and may need some manual tinkering after they're generated. KNOWN BUG: large JSON messages will cause LabVIEW to burp and die with a "domouse/dokey nested too deep" message. TODO: update with CAR#. TODO: add a scripting function to generate a variant-to-cluster VI.

近期下载者

相关文件


收藏者