With GET requests, memory areas to be read or written can be specified in the URL string.
GET requests begin with the IP address, port number, and plcget?
command and include all required parameters in the URL string.
To read data from the PLC, specify the memory area to read, e.g. DT100. To write data, specify the memory area and the value to write, e.g. DT100=122.
To send the request to the service control interface set in the FP-I4C Web interface, simply use this command: http://IP_OF_DEVICE:API_PORT/plcget?DATA
To send the request to another interface, you must specify the COM interface of the PLC and the station number: http://IP_OF_DEVICE:API_PORT/plcget?DATA&I=INTERFACE&A=STATION NUMBER
Read DT100 via the service control interface:
http://192.168.100.155:2000/plcget?dt100
Read DT100 via COM2 of station number 2:
http://192.168.100.155:2000/plcget?dt100&I=1&A=3
Read LD100 and set R1F to TRUE via COM3 of station number 0:
http://192.168.100.155:2000/plcget?I=2&A=0&ld100&R1F=1
IP address of the FP-I4C unit
The server port set on the REST API/HTTP Server page
The data specified in the read or write request, e.g. DT100 or R1F=1.
Valid areas: DT, DDT, FL (for FP2SH only), DFL (for FP2SH only), LD, DLD, WR, WX, WY, WL, R, X, Y, L
COM interface of the PLC
Make sure the specified interface has been enabled on the COM Interface page and a port has been opened for this interface on the Port page.
If the parameter is omitted, the interface set under INTERFACE and the STATION NUMBER parameter because one alone will be ignored.
will be used. Always include both theStation number: 0 to 99 (use 0 for 1:1 connections via COM1 or COM3)
If the parameter is omitted, the station number set under INTERFACE and the STATION NUMBER parameter because one alone will be ignored.
will be used. Always include both theTo read data from the PLC, use the basic syntax for GET requests together with the memory area to read (e.g. DT100, R1A, Y10).
To read multiple memory areas in one request, join the memory areas with "&".
http://IP_OF_DEVICE:API_PORT/plcget?MEMORY AREA(&MEMORY AREA...&MEMORY AREA)
Read DT100:
http://192.168.100.155:2000/plcget?dt100
Read DDT100, R10, and Y1B:
http://192.168.100.155:2000/plcget?ddt100&R10&Y1B
IP address of the FP-I4C unit
The API port set on the REST API/HTTP Server page
Memory area of the PLC
The response to a GET read request is a JSON string that contains error information and the data of the request.
Each response contains the err, err_msg, and data property. The err property is TRUE if an error occurred and FALSE if no error occurred. The err_msg property contains the error message if the err property is TRUE or it is empty if the err property is FALSE. The data property is an array that contains the data in the same order as in the request.
Response to read request for DT100:
{"err":false,"err_msg":"","data":[{"err":false,"err_code":0,"int":[100],"uint":[100],"udint":[],"dint":[],"hex":["0064"],"real":[],"string":"d\u0000","request":"DT100"}]}
Response to read request for DDT100, R10, and Y1B:
{"err":false,"err_msg":"","data":[{"err":false,"err_code":0,"int":[100,23],"uint":[100,23],"udint":[1507428],"dint":[1507428],"hex":["0064","0017"],"real":[6.933650024851553e-39],"string":"d\u0000\u0017\u0000","request":"DDT100"},{"err":false,"err_code":0,"state":0,"request":"R10"},{"err":false,"err_code":0,"state":0,"request":"Y1B"}]}
The data array of the response contains the following properties.
To write data to the PLC, use the basic syntax for GET requests together with the memory area to write (e.g. DT100, R1A, Y10).
Introduce each set value with "=". To write multiple memory areas in one request, join the memory areas with "&".
The set value must be a decimal number. Make sure it is within the permissible range. Otherwise the value is cut and a wrong value is set.
http://IP_OF_DEVICE:API_PORT/plcget?MEMORY AREA=VALUE(&MEMORY AREA=VALUE...&MEMORY AREA=VALUE)
Write 122 to DT100:
http://192.168.100.155:2000/plcget?dt100=122
Write 19202 to DDT100, TRUE to R10, and FALSE to Y1B:
http://192.168.100.155:2000/plcget?ddt100=19202&R10=1&Y1B=0
You can also combine read and write requests:
Read DT200 and write TRUE to Y10:
http://192.168.100.155:2000/plcget?dt200&Y10=1
IP address of the FP-I4C unit
The API port set on the REST API/HTTP Server page
Memory area of the PLC
Set value
The response to a GET write request is a JSON string that contains error information and the data of the request.
Each response contains the err, err_msg, and data property. The err property is TRUE if an error occurred and FALSE if no error occurred. The err_msg property contains the error message if the err property is TRUE or it is empty if the err property is FALSE. The data property is an array that contains the data in the same order as in the request.
Response to write request for DT100:
{"err":false,"err_msg":"","data":[{"err":false,"err_code":0,"request":"DT100"}]}
Response to write request for DDT100, R10, and Y1B:
{"err":false,"err_msg":"","data":[{"err":false,"err_code":0,"request":"DDT100"},{"err":false,"err_code":0,"request":"R10"},{"err":false,"err_code":0,"request":"Y1B"}]}
Response to read request for DT200 and write request for Y10:
{"err":false,"err_msg":"","data":[{"err":false,"err_code":0,"int":[0],"uint":[0],"udint":[],"dint":[],"hex":["0000"],"string":"\u0000\u0000","request":"DT200"},{"err":false,"err_code":0,"request":"Y10"}]}
The data array of the response contains the following properties.