03-11-2024 04:40 PM - edited 03-11-2024 04:40 PM
Using the JSONtext add-on with the sample text provided, I have quick success looping through each "methods" object, and displaying key value of each one. I plan on passing these arrays into .NET Framework methods later on.
I have two options:
1. How can I pass in a datatype to a function in labview.
2. Or, How can I convert a string "[ 2, 4, ..., 6]" for example into a LabVIEW array
Solved! Go to Solution.
03-11-2024 06:44 PM
If you are not 100% sure how cluster or the read json looks like in advance, consider using something like here:https://pettaa123.github.io/labview-blog/2023/01/09/Set-Cluster-Elements-by-Ref-from-JSON.html
03-12-2024 09:12 AM
In JavaScript converting a JSON string to an actual array is extremely easy:
var stringArray = "[1,2,3]";
var actualArray = JSON.parse(stringArray);
console.log(actualArray); // Output: [1, 2, 3]
Is there way to do it quick and easy like this in labVIEW?
03-12-2024 09:44 AM
03-12-2024 11:10 AM
@raphschru wrote:
Use the malleable VI "Find Item (as LVtype).vim" to directly specify the data type:
Note: This VIM is part of the JSONtext Toolkit by JDP Science. I use this library in almost all of my applications anymore. It is an amazing toolkit.
03-12-2024 02:00 PM
That worked! thank you!