09-09-2022 10:18 AM
Hello,
I'm coming to you because I'm a bit stuck.
I want to read a json file and configure it.
I have 4 controls (passenger 1 to 4). The controls are true or false when doing the import picture to clipboard.
So I have my controls configured if the value is 0 (in the config file) the control (passenger) appears and if it's 1 the control is not possible.
I did it with an .ini file but I am asked to do it with a .json file.
I don't know json at all, I tried this but it doesn't work.
I don't know how to do the property node (visible, value) in this case with the keys and values.
Can you help me please?
Or give me some hints?
The json file does not supported here, so i enclose its screen capture
Thank you very much
Solved! Go to Solution.
09-09-2022 10:45 AM
It's good that you already have the JSONtext library. Just wire all controls to a cluster and input it into the 'To JSON text.vim". You'll get the correct JSON string.
09-12-2022 03:06 AM
Hello Basjong53,
09-12-2022 05:04 AM
@Ngouda wrote:
Hello Basjong53,
Thank you for your reply.Can you save your example under the precious version please? I have Labview 2021 and where to send me the vi directly if you don't mind.Thanks
That image is a snippet, so after saving it you can drop it in your diagram.
09-12-2022 12:23 PM
Hi ngouda,
please don't send PMs when you already received good answers!
@Ngouda wrote:
I did it with an .ini file but I am asked to do it with a .json file.
I don't know json at all, I tried this but it doesn't work.
What's wrong with the example snippet you got?
@Ngouda wrote:
I don't know how to do the property node (visible, value) in this case with the keys and values.
Use the label of those controls as key, then you can easily look up the corresponding control reference based on the keys loaded from JSON. Then just use a "visible" property node with the reference found for each key…