When you parse JSON text that contains an array, then you have to treat it as a JSON Array. You cannot use the 1D Array functions for parsed JSON text.
The following example shows how you can use the 1D Array functions to generate a JSON string but how you must use the JSON Array functions to access the array values:
I hace two questions:
1) to get an array datas, your way works, however should work directly also following the picture attached, but I have found parsing problems... why?
2) if I would like to write/read a 2D array, how would I have to do?
For question 1, unfortunately I cannot see the included image. It seems to not be attached correctly.
For question 2, the i3-json toolkit does not support 2D arrays directly. When parsing you have to use the API functions to read an Array of Arrays by index in nested for-loops. When generating 2D arrays you can improve performance a bit by creating Arrays of 1D Numeric Arrays. The following snippet shows both patterns.
thank you for your reply.
Your example works (and in some way it replies also to the question number 1!)... however I have two new questions.
1) how I can include also array with more than two dimensions? I tried in the same way, but it generates an error (also the json string is wrong... it seems a 2d array) (screenshot in attach and test_json_5.vi)
2) how can I pass the Tree ref in a subvi? I tried but it also generates an error (I send you a screenshoot file, where the ctrl ref is pane to "JSON Tree Out Passthrough" just after "Parse Json.vi")
Moreover, I'm trying to include on a more complex json based on clusters... and I have some problems. It is better to send also all the files
following your example I found a bug, but I cannot find the right solution.
In the attached example, I red the 2D array in an explicit way (following the JSON Tree) and implicit way (parsing the Json string)
However, in the second case all is ok, while in the first one I cannot read the array... where is my mistake?