03-25-2013 06:18 AM
Hi,
while playing around with the JSON toolkit I've run into an issue using strict typedefs.
The problem can be bypassed in two ways:
1. Right click the indicator > remove the association with the strict typedef (on german Labview it's: Von Typdefinition trennen)
2. Or the better way: Change the strict typedef to a typedef (if possible)
Than a valid JSON string is generated.
Attached is a zip file containing 2 VIs and the strict typedef.
- In the test_encode_decode.vi no typedef is used => works
- In the test_encode_decode_ERROR.vi the included strict typedef is used => Error
Regards,
Bastian
03-25-2013 02:25 PM
Hi Bastian,
Unfortunately, the reason for this is that the method used in the LabVIEW Type to JSON Tree VI for scanning LabVIEW Arrays of Clusters relies on the IndexVIs Property node and the IndexVals Property Node. The IndexVIs property node is needed to make sure the index is visible (thereby usable) and the IndexVals property node is needed to cycle through the indices. This is definitely not ideal or fast but the only solution I could find at the time.
As a consequence of those property node behaviors, strict type definitions cannot be used.
However the two solutions you gave work! Either disconnect the type def or use a non-strict type definition and everything should work okay