Programming - Mitsubishi Electric MELSEC iQ-F Series Manual

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

Advertisement

Programming

This section describes programs used in the application example.
Program example
■Setting the member information
Set the member information in pb_st30Member (member list) of the FB public variable to acquire the Value string.
■Acquiring the Value string
Turning M0 (execution command) on acquires the Value string whose uType (type of Value), s32Key (Key string), and uDepth
(depth of hierarchy) are the same as those specified in pb_st30Member (member list) from the JSON string that is stored in
the file register having the address specified in i_udJsonAddr (JSON start address), and stores the Value string in s64Value
(Value string) of pb_st30Member (member list).
JSON start address: K0
The following table lists the values in pb_st30Member (member list) after the FB completed successfully.
Array element No.
1
2
3
4
5
6
uType
s32Key
4
id1
3
date
1
detail
2
size
3
color_No.
0
NULL
Set the JSON start address to K0.
[Element No.0 in member list]
· Set K4 (numerical value) in the type of Value.
· Set "id1" in the Key string.
· Set K1 in the depth of hierarchy.
[Element No.1 in member list]
· Set K3 (string) in the type of Value.
· Set "date" in the Key string.
· Set K1 in the depth of hierarchy.
[Element No.2 in member list]
· Set K1 (object) in the type of Value.
· Set "detail" in the Key string.
· Set K1 in the depth of hierarchy.
[Element No.3 in member list]
· Set K2 (array) in the type of Value.
· Set "size" in the Key string.
· Set K2 in the depth of hierarchy.
[Element No.4 in member list]
· Set K3 (string) in the type of Value.
· Set "color_No." in the Key string.
· Set K2 in the depth of hierarchy.
[Element No.5 in member list]
· Set K0 (member list array end) in the
type of Value.
s64Value
3544528813
2022/12/21
NULL
125, 128, 180, 179
E051
NULL
4 APPLICATION EXAMPLE
4.1 Acquiring Value String from JSON String
4
uDepth
1
1
1
2
2
0
25

Advertisement

Table of Contents
loading

Table of Contents