From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

G Web Development Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Flatten to JSON Failing? Bug?

Solved!
Go to solution

I have a type definition consisting of a cluster which contains an enum.  If I wire an instance of the type definition to the "Flatten to JSON" VI it gives me the error, "Cluster elements conflict because the wire and the terminal are clusters of different sizes. Wire size: TEST.gtype, Terminal size: cluster with 0 elements.

 

If I remove the enum from the type def's cluster and replace it with a ring, then the "Flatten to JSON" VI has no problem.  Booleans, arrays, listboxes, numerics all have no problem - just the enum type.

 

Is this a G Web bug? If enums are not allowed in type definitions for some reason, then it should not be possible to place them in the type def. 

 

If a ring is accepted by the "Flatten to JSON" VI then why would not an enum also be accepted?

0 Kudos
Message 1 of 2
(897 Views)
Solution
Accepted by topic author jvon20

If enums are not allowed in type definitions for some reason, then it should not be possible to place them in the type def. 

If a ring is accepted by the "Flatten to JSON" VI then why would not an enum also be accepted?


The Flatten to JSON VI does not support enums in G Web or in LabVIEW (although the LabVIEW error message is definitely clearer):

 

MilanR_0-1653087295679.png MilanR_1-1653087374664.png

 

One option to consider would be creating a VI that can format the cluster into a format that is supported by the Flatten to JSON and Unflatten from JSON nodes. The JSON nodes try to only support values that are well represented in JSON which only supports a limited set of types in the specifications.


Milan
Message 2 of 2
(879 Views)