cancelar
Mostrando resultados para 
Pesquisar então 
Você quer dizer: 

Build a Json with labview

Resolvido!
Ir para a solução

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 Kudos
Mensagem 1 de 17
2.583Exibições

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 Kudos
Mensagem 2 de 17
2.604Exibições

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 Kudos
Mensagem 3 de 17
2.601Exibições

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.



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 Kudos
Mensagem 4 de 17
2.572Exibições

Duplicated with Build json with this structure

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Mensagem 5 de 17
2.529Exibições

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
0 Kudos
Mensagem 6 de 17
2.525Exibições

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 Kudos
Mensagem 7 de 17
2.475Exibições

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 Kudos
Mensagem 8 de 17
2.467Exibições

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

0 Kudos
Mensagem 9 de 17
2.462Exibições

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 Kudos
Mensagem 10 de 17
2.455Exibições