04-07-2017 10:06 AM
When I run the following piece of code, which simply passes a double float with a value of NaN through the "Disconnect Type Definitions" VI, the output is zero. I'm using LabVIEW 2016 64-bit.
I was wondering if this is the intended behavior of this VI or if this is a bug in LabVIEW? The description of the VI only mentions disconnecting the input data from any typedef associations. It does not mention coercing any values.
This is causing issues with data that I am exporting to a JSON file. I need to convert my cluster to a variant and pass it through this VI before I export the JSON files, and as a result a number of values that should be showing up as null (which is how the JSON library I'm using interprets NaNs) are showing up as zeros.
Solved! Go to Solution.
04-07-2017 10:36 AM
The Data Type VIs do not preserve value. They should only be used for manipulating types. Can you use the type coming out and do a Type Cast to preserve the value, like this?
04-07-2017 10:43 AM
Ah, I had not realized that those VIs were not supposed to preserve value. Thanks!
The type cast does not work with the actual cluster I am trying to manipulate, however I seem to have found a workaround for the issue I was encountering for now by flattening to a string then unflattening from a string.