G Web Development Software

cancel
Showing results for 
Search instead for 
Did you mean: 

More new user questions

Solved!
Go to solution

Sorry for the simple questions, but I'm not familiar with NXG and its way of doing things, and I'm not familiar with LabVIEW's Unflatten from JSON.  (I always use Dr. James Powell's JSON library for LabVIEW.)

 

1) Easy question: How do I resize the array of strings (going into the top of the Unflatten from JSON) so that it shows two elements?  If I try to resize it, it just resizes the string.

 

2) Why isn't the "type/defaults" on Unflatten from JSON adapting to my input cluster?  I also tried not wiring in the "path", but that didn't help.

 

Screen Shot 2021-09-13 at 4.59.37 PM.png

 

3. I also tried just wiring in the path to one of my items, which is the "array of readings" in my example above.  It will let me wire in an array of cluster of string and reading, but when I run, I get the undocumented -375006 error.  Any idea what's wrong?

 

Thanks.

Brian Powell
Stravaro, LLC


Learn more about the DSH Pragmatic Software Development Workshops.
0 Kudos
Message 1 of 6
(2,407 Views)

Regarding the resizing behaviour, the resize tool seems to be a bit finicky. I could resize it more easily by first selecting the control and then using the array resize tool to show more array elements. See attached gif.

Sujay Narayana
Principal Software Engineer
0 Kudos
Message 2 of 6
(2,361 Views)

I had ported a JSON example from NXG to G Web Development Software. Attaching that here, hopefully it helps. (I'm yet to look into the specific issue that you reported)

Sujay Narayana
Principal Software Engineer
0 Kudos
Message 3 of 6
(2,357 Views)

For resizing the array to show more elements, I was doing it right, but didn't realize it.  The separator between elements is very subtle... off-white on off-white.  Since I was expecting it to look more like traditional LabVIEW, with a clearer visual differentiation, I just thought I was resizing the string.

For those who don't have the software, here's an example of an array showing two strings.

 

Screen Shot 2021-09-16 at 2.21.24 PM.png

 

Brian Powell
Stravaro, LLC


Learn more about the DSH Pragmatic Software Development Workshops.
0 Kudos
Message 4 of 6
(2,334 Views)
Solution
Accepted by bhpowell

 

2) Why isn't the "type/defaults" on Unflatten from JSON adapting to my input cluster?  I also tried not wiring in the "path", but that didn't help.

 

Screen Shot 2021-09-13 at 4.59.37 PM.png

 

 


The Unflatten from JSON / Flatten to JSON primitives do not support the Timestamp data types. This is because the JSON format itself does not support date/time formats. The recommendation would be to instead use a cluster that directly maps to the JSON object format (so that value is likely one of string or number, etc) and then after parsing the JSON data you can post process it to do the appropriate parsing of how the JSON originator chose to format dates into strings, numbers, etc.


Milan
Message 5 of 6
(2,332 Views)

It should go without saying--but I'll say it anyway--a clearer error message would be so much more helpful here.

Brian Powell
Stravaro, LLC


Learn more about the DSH Pragmatic Software Development Workshops.
Message 6 of 6
(2,328 Views)