IDEC MicroSmart Pentra User Manual

Page 156

Advertising
background image

A

PPENDIX

A-2

W

EB

S

ERVER

CPU M

ODULE

U

SER

S

M

ANUAL

FC9Y-B1278

Request Format (Writing Device Data)

Device data can be written to the Web server CPU module with the following format using the POST method.

/system/device_write.cgi?device=DEV&address=XXXX&length=XXXX&driver=XX&net_no=XX&data=XXXX

The CGI parameters are as follows:

When the length is bigger than or equal to 2, insert “_“ between the values to write to the data registers.

Example: When writing 49910 (C2F6h) to D2058 and 59768(E978h) to D2059, the format for CGI is as follows:
/system/device_write.cgi?device=D&address=080A&length=0002&driver=00&net_no=00&data=C2F6_E978

Reply Format (Writing Device Data)

The Web server CPU module returns the following reply after receiving above request.

Content-type: text/javascript+json; charset=utf-8
{
"STATUS":"0",
"DEVICE":"D",
"ADDRESS":"080A",
"LENGTH":"0002",
"DRIVER":"00",
"NET_NO":"00",
}

STATUS: 0 indicates normal reply. Any other values indicate an error.
DEVICE, ADDRESS, LENGTH, DRIVER, and NET_NO: The parameters in the request are stored.

/system/device_write.cgi

: CGI file name

device

: Specify the device type of the target device using a character. "D" (Data Register) is supported.

address

: Specify the device number of the target device in hexadecimal.

length

: Specify the number of data registers to write in hexadecimal. The valid range is 1 to 64 (0001h to

0040h).

driver

: Reserved for the system. Specify “00”.

net_no

: Reserved for the system. Specify “00”.

data

: Specify the values to write to the target data registers in hexadecimal.

Advertising