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.
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.
05-16-2019 02:39 AM
Hello,
I have a command queue over which runs the commands and data to a function block. This I impement using clusters.
What I am trying to figure out is that whether replacing clusters with JSON give any specific advantage to the project in a long run.
Clusters can be made quasi-dynamic by making them generic and using array elements.(that's my argument about cluster.)
And data needs to be packed in JSON and unpacked at other end.
Has anyone used JSON extensively in LabVIEW Project to povide better flexibility & data handling in communication within the project.
Can you share your experience.
regards,
Akshay
05-16-2019 03:25 AM - edited 05-16-2019 03:26 AM
I want to highlight your question in a more generic way:
"What is a recommendation regarding data transfer within a single application?"
There is no easy answer to this. Your question essentially breaks down to:
"Do you recommend using language proprietary data structures above generic serialized data structures?"
You already point out one important point when using serialized data: you have to serialize for transfer and unserialize the data upon receiving. This can be resource consuming (time, computing power).
So to answer with my personal view:
I recommend to stick to proprietary data structures in case you look for speed, resource optimization and if transferring data within a single application.
I recommend to use serialized data in case that standardization is more important than performance, you want to have the option to pass data between multiple applications (or components in different programming languages) or you want to look into more human-readable data structures.
EDIT: Consider LVOOP instead of clusters if you require more data structure flexibility
05-16-2019 03:56 AM
I use JSON a lot (and wrote the JSONtext library to use it even more). However, I generally use variants to pass data within an application, when both sides need to know the structure of the data. When one side handles data without needing to know what it is (such as configuration settings, or meta data) then I use JSON.