LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

JSON in LabView

Solved!
Go to solution

Hello all I Have coplicaded Json i woudl like to get vaues from but i am geting error - 375005 

I have checked if JSON is vailid by https://jsonformatter.curiousconcept.com/

Please Have look 

0 Kudos
Message 1 of 11
(22,311 Views)

Hi plpablo,

 

The issue is that the JSON type has to match to a compatible LabVIEW type.

 

In the example provided the id portion looks like the following: 

 {"id":1, ...

In that JSON representation the JSON Object contains a field named id with a JSON Number value.

 

In the example, the cluster passed to Unflatten from JSON represented id as a string:

 

jsonasstring.PNG

If you change the id field of the cluster to a number it parses as expected:

 

jsonnumber.PNG

 


Milan
Message 2 of 11
(22,271 Views)

HI Milan,

 

Thank You for anwser. Unfortunately i am still getting -375003 Error.

0 Kudos
Message 3 of 11
(22,211 Views)

When I run the VI you just attached, I don't get any error.  Just a value of 1 for ID in that cluster.

0 Kudos
Message 4 of 11
(22,186 Views)

How is possibe?  

 

 

0 Kudos
Message 5 of 11
(22,179 Views)
0 Kudos
Message 6 of 11
(22,175 Views)

This is My first expirience witch Json so i Have no idea What can be wrong. 

My LabView version is is 2017 
Should I install any additional packages ? 

 

0 Kudos
Message 7 of 11
(22,170 Views)

I would suggest cutting down the JSON string to only the 2 first elements for now.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 11
(22,162 Views)

For two first rows works perfect i will add more and will se when in stop working. 

Ok it stopped working after I add Devices section(table). But Why? What Schuld I do? 

0 Kudos
Message 9 of 11
(22,156 Views)
Solution
Accepted by topic author plpablo

Your error message says that JSON must be UTF8, but you are using UTF8-to-text to deliberately convert it to a non-UTF8 encoding.  I suspect you might be using a different LabVIEW version that is more strict about this than the version used by the other people on this thread.  

Message 10 of 11
(22,137 Views)