Mitsubishi Electric MELSEC iQ-F Series Manual page 14

Hide thumbs Also See for MELSEC iQ-F Series:
Table of Contents

Advertisement

Usage procedure
The following shows the procedure to acquire the Value string from the JSON string.
1.
Regarding the JSON string for acquisition, set uType (type of Value), s32Key (Key string), and uDepth (depth of
hierarchy) for items to acquire the Value string in pb_st30Member (member list).
• Configure settings other than s64Value (Value string) in pb_st30Member (member list).
• If the number of members is less than 30, set "0" to uType (type of Value) in pb_st30Member (member list) that is acquired
last.
Ex.
JSON string for acquisition
{
"id":
1,
"name":
"userA",
"attribute":
{
"gender":
"nationality": "japan"
},
"phonenumber": 8022224568
}
Searching Key
2.
After i_bEN (execution command) is turned on, the Value string whose uType (type of Value), s32Key (Key string), and
uDepth (depth of hierarchy) completely match those specified in pb_st30Member (member list) is acquired.
Ex.
pb_st30Member (member list)
Array
element No.
0
4 (numerical value)
1
3 (string)
2
1 (object)
3 (string)
3
4
3 (string)
5
0 (member structure array end)
3 DETAILS OF FB LIBRARIES
12
3.1 M+StrProcessing_JSONDeserialize_F (Acquisition of JSON String)
pb_st30Member (member list)
Array
element No.
0
1
2
3
"male",
4
5
Searching value
uType
s32Key
id
name
attribute
gender
nationality
Not specified Not specified
The searched values are stored in s64Value.
uType
4 (numerical value)
3 (string)
1 (object)
3 (string)
3 (string)
0 (member structure array end)
s64Value
uDepth
1
1
userA
1
NULL
1
male
2
japan
2
Not specified
s32Key
s64Value
id
1
name
1
1
attribute
gender
2
nationality
2
Not specified Not specified Not specified
Do not specify the values
of s64Value.
uDepth

Advertisement

Table of Contents
loading

Table of Contents