ADAM-6200 User Manual 186
C.2.4 Digital Output
C.2.4.1 GET /digitaloutput/(all|{id})/value
C.2.4.2 POST /digitaloutput/all/value
Request
Thecontent‐typewillbe‘application/x‐www‐form‐urlencoded’.
{id}:istheDOchannelIDstartingfrom0
Examples:
UsethefollowingURItogettheDO‐0value.
http://10.0.0.1/digitaloutput/0/value
UsethefollowingURItogettheallDOvalues.
http://10.0.0.1/digitaloutput/all/value
Response
The content-type will be ‘text/xml’
IfresultisOK,thecontentwilllooklikebelow
<?xml version="1.0" ?>
<ADAM-6250 status=”OK”>
<DO>
<ID>0</ID>
<VALUE>1</VALUE>
</DO>
</ADAM-6250>
Ifresultisfailed,thecontentwilllooklikebelow
<?xml version="1.0" ?>
<ADAM‐6250status=”{error}”>
</ADAM-6250>
{error}:Theerrormessage.
Remarks
Ifthe{id}isoutofrange,theresponsewillreturnHTTPstatuscode501(Not
implemented)
Request
Thecontent‐typewillbe‘application/x‐www‐form‐urlencoded’.
Examples:
UsethefollowingURItosettheDOvalue(s).
http://10.0.0.1/digitaloutput/all/value
Thecomingdatawiththerequestwillbe{name}={value}pair(s).
{name}:Thenameofthechannel,forexampleDO0.
{value}:Thevaluetobesettotheindicatedchannel.
Forexample,
iftherequestisgoingtosetchannel0,1,2tovalue1,
thenthename‐valuepairswilllooklikebelow:
DO0=1&DO1=1&DO2=1
Response
The content-type will be ‘text/xml’
Thecontentwilllooklikebelow
<?xml version="1.0" ?>
<ADAM‐6250status=”{status}”>
</ADAM-6250>
{status}:Theresult.Ifsucceed,theresultwillbe‘OK’;otherwise,the
resultwillbe
theerrormessage.
Remarks