05-02-2025 02:10 PM
Hello everyone! I'm tryng to get an especific element from this json file with some controler, but i don't know how to do it, somebody can help me?
05-02-2025 03:12 PM
The built-in JSON code with LabVIEW is... not great. You need to pre-define a cluster that EXACTLY matches the JSON, both names and data types, or it doesn't work and you get no values out.
Instead, look into some of the free JSON libraries.
These are the two I have used:
https://www.vipm.io/package/i3_json/
https://www.vipm.io/package/jdp_science_jsontext/
I prefer the i3 one for when I want to manually manipulate JSON and the JDP one for when I want to convert JSON to and from LabVIEW data types (type defined clusters mostly) smoothly. While that 2nd one might sound similar to the built-in version, it actually runs much better mostly because it's forgiving on inexact matches when parsing.
05-02-2025 03:32 PM
Another vote for the JDP Science library, it's awesome. If you upload an example json file and what field you want to get out of it I can show you how easy it is in that library.
05-03-2025 03:54 PM
@oliver874 wrote:
Hello everyone! I'm tryng to get an especific element from this json file with some controler, but i don't know how to do it, somebody can help me?
Here is another opportunity for me to Learn!
AFAIK JSON, like XML, is often a serialized DOM file format.... Document Object Model, DOM.
There are a few presuppositions of files that suppose that the data must be a DOM.
DOMUserDefRef.dll is published by the W3C and has no threadsafe calls. Files that meet DOM criteria presume that a single data bus can read or write that data to storage media.