4.2
Constructing the JSON String
This section describes the procedure to construct the JSON string.
In the following example, M+StrProcessing_JSONSerialize_F (Construction of JSON string) is used.
Overview
Construct the JSON string as follows.
Ex.
{
"id1": 3544528813,
"id2": 1000006554,
"date": "2022/12/21",
"detail": {
"size": [125, 128, 180, 179],
"weight": 256. 4,
"color_No.": "E051"
}
}
The JSON string constructed by executing the FB includes no line break or space.
Process flow
The following shows the procedure to construct the JSON string.
1.
FB library registration
Register the FB library.
For the operating procedure, refer to the following.
GX Works3 Operating Manual
2.
Programming
Create programs. (Page 27 Programming)
4 APPLICATION EXAMPLE
26
4.2 Constructing the JSON String