LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting data in standard format (e.g. JSON)

Solved!
Go to solution

I was surprised to see that "JSON" turned up zero search results in this board.

 

Over the years we have added the ability to export the contents of our reports to Word, Excel, text, XML, HTML, etc. This leads to a lot of similar code that is cumbersome to maintain. Additionally some of the underpinning technologies may be coming close to the end of their supported lifetimes. (e.g. DDE, ActiveX, ..). I have done some XML exporting, but it has proven to be (a) verbose and (b) cumbersome to code. I have not spent the time to abstract away the tedium of generating XML, and in the mean time JSON seems to have won out over XML.

 

So, I'd like to move to a model where there is ONE consistent way to export the data from our app, and further details of presentation can be handled separately.  The data is very tabular, and what I'd love to be able to do is throw a 2-d array with a list of column and row labels to a tool that will serialize the data in JSON to a specified precision.

 

Does such a tool exist?

 

Comments/suggestions welcome!

 

Thanks,

Ian

0 Kudos
Message 1 of 7
(9,693 Views)

Hi Ian,

 

I wasn't able to find anything myself, but to clarify, are you looking for a C programming equivalent of the Flatten to JSON function in LabVIEW?

http://zone.ni.com/reference/en-XX/help/371361K-01/glang/flatten_to_json/

Michael Keane
National Instruments
0 Kudos
Message 2 of 7
(9,648 Views)

Thanks, Michael.  That looks like the right kind of thing. I have seen some general purpose tools like Jansson (GitHub and info links) and on CCAN (here and here), but that LabView tool is the kind of thing I was hoping for, with much of the lower level taken care of. 

 

I need some time to delve into those two C options to give them a fair assessment.

 

But it would be great if CVI had some sort of JSON tools on the roadmap. 🙂

 

--Ian

0 Kudos
Message 3 of 7
(9,614 Views)

I see!  If nothing exists currently, this might be worth a post to the CVI Idea Exchange so that the devlopers could consider it for future versions:

http://forums.ni.com/t5/ideas/v2/ideaexchangepage/blog-id/cviideas

Michael Keane
National Instruments
0 Kudos
Message 4 of 7
(9,580 Views)
Solution
Accepted by Ian.W

I added this idea to the idea exchange forum.

Feel free to support it, if you think this can be useful.

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
Message 5 of 7
(8,277 Views)

Old thread, i've succesfully used cJSON in my project, just imported the .c and .h file, it's compile correctly, no need to import any .dll or .lib

Davide Vittorio G. - TLGB S.R.L.
Italian SW Developer
0 Kudos
Message 6 of 7
(3,958 Views)

Personally I've used json-c

0 Kudos
Message 7 of 7
(3,954 Views)