You are here: Technical References > Remote Access to PLC Variables > HTTP Interface for Writing PLC Variables > Request and Response Body - JSON

Request and Response Body - JSON

Request Body

{
“<var1>” : { “value” : “<value1>”},
“<var2>” : { “value” : “<value2>”},
“<var3>” : { “value” : “<value3>”},
[…]
}

JSON parameter values:

Error Status Description
<var1>, <var2>,< var3>,… The PLC"Programmable Logic Controller" A Programmable Logic Controller, PLC, or Programmable Controller is a digital computer used for automation of industrial processes, such as control of machinery on factory assembly lines. Used to synchronize the flow of inputs from (physical) sensors and events with the flow of outputs to actuators and events variable names
<value1>,<value2>,<value3>,... The values of the corresponding variables above

Response Body

{
“<var1>” : { “errorstatus” : “<error1>”},
“<var2>” : { “errorstatus” : “<error2>”},
“<var3>” : { “errorstatus” : “<error3>”},
[…]
}

JSON parameter values:

Error Status Description
<var1>, <var2>,< var3>,… The PLC variable names
<error1>,<error2>,<error3>,... The errors occurred during the write. (The possible errors are described below.)

Error Strings: 

Error Status Description
ok No error occurred in reading
not found The requested variable is not found in the application.
locked The requested variable is locked.

Example:

Request:

PUT kas/plcvariables?format=json
{
"MachineSpeed" : {"value" : "100.000000"},
" IntegerVar " : {"value" : "20"},
“UntitledST.LocalVariable” : {"value" : "’SampleString’”}
}

Response:

{
"MachineSpeed": {"errorstatus" : "ok”},
"IntegerVar " : {" errorstatus " : "not found"},
“UntitledST.LocalVariable” : {" errorstatus " : "locked”}
}

 


Stay Connected with Kollmorgen

Copyright © 2015 Kollmorgen™