取消
显示结果 
搜索替代 
您的意思是: 

Build a Json with labview

已解决!
转到解答

Hello

I need to create a json in the following structure:

 

{
    "Value1": {
        "Build": {
            "1": {
                "t_inst": {
                    "Type": "Gold",
                    "Key": "15",
                    "size": "big"
                },
                "1_avg": {
                    "Type": "Green",
                    "Key": "11",
                    "size": "big"
                },
                "2_avg": {
                    "Type": "Blue",
                    "Key": "21",
                    "size": "big"
                }
            }
        }
    },
    "Value2": {
        "Build": {
            "1": {
                "t_inst": {
                    "Type": "Grey",
                    "Key": "22",
                    "size": "small"
                },
                "1_avg": {
                    "Type": "Yellow",
                    "Key": "8",
                    "size": "big"
                },
                "2_avg": {
                    "Type": "Blue",
                    "Key": "21",
                    "size": "big"
                }
            }
        }
    }
}

How can i build it?

I've searched several forums, but none I've seen have as many layers as I need.

Could someone help me?

0 项奖励
1 条消息(共 17 条)
1,949 次查看

Hello

I need to create a json in the following structure:

leandrofeder_0-1734539454560.png

 

I tried to put the json here, but it blocked my post

How can i build it?

I've searched several forums, but none I've seen have as many layers as I need.

Could someone help me?

0 项奖励
2 条消息(共 17 条)
1,970 次查看

Hello

I need to create a json in the following structure:

 

leandrofeder_0-1734539564690.png

I tried to put the json here, but it blocked my post

I've searched several forums, but none I've seen have as many layers as I need.

Could someone help me?

0 项奖励
3 条消息(共 17 条)
1,967 次查看

1. Install the JSONtext library. This is an amazing tool for creating and reading JSON files in LabVIEW.

2. Build up a cluster with the structure you want and then use the To JSON Text VI to create the text. You can then save that text string to a file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 项奖励
4 条消息(共 17 条)
1,938 次查看

Duplicated with Build json with this structure

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 项奖励
5 条消息(共 17 条)
1,895 次查看

JSON Text is a toolkit I use for JSON work in LabVIEW

 

https://www.vipm.io/package/jdp_science_jsontext/

 

You start with modeling a cluster equivalent of JSON; then you can convert between cluster and JSON.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 项奖励
6 条消息(共 17 条)
1,891 次查看

Guys, do you know how remove the duplicates of my JSON?

I have 2 equipments and my code create 6 items on JSON

Please, help me

 

{
  "EQ1":{
    "TCP":{
      "1":{
        "test_t_inst":{
          "Type":"ABC",
          "IP":"192.168.0.0",
          "Port":111,
          "Still":1,
          "Register":"Register",
          "Address":12345,
          "SizeLength":1,
          "FET":2,
          "Size":"big",
          "Conversion":"small"
        }
      }
    }
  },
  "EQ1":{
    "TCP":{
      "2":{
        "test_1_avg":{
          "Type":"ABC",
          "IP":"192.168.0.0",
          "Port":111,
          "Still":2,
          "Register":"Register",
          "Address":36871,
          "SizeLength":1,
          "FET":0,
          "Size":"big",
          "Conversion":"small"
        }
      }
    }
  },
  "EQ1":{
    "TCP":{
      "3":{
        "test_2_avg":{
          "Type":"ABC",
          "IP":"192.168.0.0",
          "Port":111,
          "Still":1,
          "Register":"Register",
          "Address":24572,
          "SizeLength":1,
          "FET":0,
          "Size":"big",
          "Conversion":"small"
        }
      }
    }
  },
  "EQ2":{
    "TCP":{
      "1":{
        "test_t_inst":{
          "Type":"ABC",
          "IP":"192.168.0.0",
          "Port":111,
          "Still":2,
          "Register":"Register",
          "Address":32451,
          "SizeLength":1,
          "FET":0,
          "Size":"big",
          "Conversion":"small"
        }
      }
    }
  },
  "EQ2":{
    "TCP":{
      "2":{
        "test_1_avg":{
          "Type":"ABC",
          "IP":"192.168.0.0",
          "Port":111,
          "Still":1,
          "Register":"Register",
          "Address":27789,
          "SizeLength":1,
          "FET":1,
          "Size":"big",
          "Conversion":"small"
        }
      }
    }
  },
  "EQ2":{
    "TCP":{
      "3":{
        "test_2_avg":{
          "Type":"ABC",
          "IP":"192.168.0.0",
          "Port":111,
          "Still":2,
          "Register":"Register",
          "Address":11234,
          "SizeLength":1,
          "FET":1,
          "Size":"big",
          "Conversion":"small"
        }
      }
    }
  },
  "user":"johnCena",
  "token":"327AD8E61A4F6EB329CE5190E",
  "password":"TheLastOfUS"
}

 

 

0 项奖励
7 条消息(共 17 条)
1,841 次查看

Your 2D array constant on the BD has 6 rows.

I think you need to connect 'Array In' to the code instead of the constant.

0 项奖励
8 条消息(共 17 条)
1,833 次查看

Yeap, but the constant it's only for test
The data entry it's coming on this format

0 项奖励
9 条消息(共 17 条)
1,828 次查看

Sorry, I don't see your problem.

The constant has 6 rows resulting in 6 EQ entries in the JSON string.

If I cut the constant to 2 rows the resulting JSON string has 2 EQ entries.

0 项奖励
10 条消息(共 17 条)
1,821 次查看