ADAM-6200 User Manual 182
C.2.2 Analog Output
C.2.2.1 GET /analogoutput/(all|{id})/value
C.2.2.2 POST /analogoutput/all/value
Request
The๎contentโtype๎will๎be๎โapplication/xโwwwโformโurlencodedโ.
{id}๎:๎is๎the๎AO๎channel๎ID๎starting๎from๎0
Examples:
Use๎the๎following๎URI๎to๎get๎the๎AOโ0๎value.
http://10.0.0.1/analogoutput/0/value
Use๎the๎following๎URI๎to๎get๎the๎all๎AO๎values.
http://10.0.0.1/analogoutput/all/value
Response
The content-type will be โtext/xmlโ
If๎result๎is๎OK,๎the๎content๎will๎look๎like๎below
<?xml version="1.0" ?>
<ADAM-6224 status=โOKโ>
<AO>
<ID>0</ID>
<VALUE>0FFF</VALUE>
</AO>
</ADAM-6224>
If๎result๎is๎failed๎,๎the๎content๎will๎look๎like๎below
<?xml version="1.0" ?>
<ADAMโ6224๎status=โ{error}โ>
</ADAM-6224>
{error}๎:๎The๎error๎message.
Remarks
If๎the๎{id}๎is๎out๎of๎range,๎the๎response๎will๎return๎HTTP๎status๎code๎501๎
(Not๎implemented)
Request
The๎contentโtype๎will๎be๎โapplication/xโwwwโformโurlencodedโ.
Examples:
Use๎the๎following๎URI๎to๎set๎the๎AO๎value(s).
http://10.0.0.1/analogoutput/all/value
The๎coming๎data๎with๎the๎request๎will๎be๎{name}={value}๎pair(s).
{name}๎:๎The๎name๎of๎the๎channel,๎for๎example๎AO0.
{value}๎:๎The๎value๎to๎be๎set๎to๎the๎indicated๎channel.
For๎example,
๎if๎the๎request๎is๎going๎to๎set๎channel๎0,๎1,๎2๎at๎+โ๎5V๎output๎
range๎to๎0V,๎โ2V๎and ๎5V๎respectively,๎then๎the๎nameโvalue๎pairs๎wi ll๎
look๎like๎below:
AO0=0800&AO1=04CC&AO2=0FFF
Response
The content-type will be โtext/xmlโ
The๎content๎will๎look๎like๎below
<?xml version="1.0" ?>
<ADAMโ6224๎status=โ{status} โ>
</ADAM-6224>
{status}๎:๎The๎result.๎If๎succeed,๎the๎result
๎will๎be๎โOKโ;๎otherwise,๎the๎
result๎will ๎be๎the๎error๎message.
Remarks