Home AMX User Forum AMX Technical Discussion
Options

Opc Server

I am trying to connect to a OPc server to collect the condition of the room temperature.

From the help file I got the following code, and I try to send in various combination But no luck , Can some one help me?

SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /amxopc/opcservice.asmx HTTP/1.1
Host: 192.168.100.95
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.pbswebserver.com/ReadFromOPC"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
<soap:Body>
<ReadFromOPC xmlns="http://www.pbswebserver.com/"&gt;
<pRoomID>string</pRoomID>
</ReadFromOPC>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
<soap:Body>
<ReadFromOPCResponse xmlns="http://www.pbswebserver.com/"&gt;
<ReadFromOPCResult>
<RoomID>string</RoomID>
<SpaceTemperature>string</SpaceTemperature>
<TempSetPoint>string</TempSetPoint>
<FanSpeedCtrl>string</FanSpeedCtrl>
<HvacAppliMode>string</HvacAppliMode>
</ReadFromOPCResult>
</ReadFromOPCResponse>
</soap:Body>
</soap:Envelope>


I tried like

data_event[OpcServer]
{
online :
{
send_string OpcServer,
//"'POST http://192.168.100.95/amxopc/opcservice.asmx?op=ReadFromOPC',13,10,'Connection: Close', 13, 10, 13, 10"

"'POST /amxopc/opcservice.asmx HTTP/1.1',13,10,
'Host: 192.168.100.95',13,10,
'Content-Type: text/xml; charset=utf-8',13,10,
'Content-Length: 300',13,10,
'SOAPAction: "http://www.pbswebserver.com/ReadFromOPC"',13,10,

'<?xml version="1.0" encoding="utf-8"?>',13,10,
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">',13,10,
'<soap:Body>',13,10,
'<ReadFromOPC xmlns="http://www.pbswebserver.com/">',13,10,
'<pRoomID>10</pRoomID>',13,10,
'</ReadFromOPC>',13,10,
'</soap:Body>',13,10,
'</soap:Envelope>',13,10"

}
}

Comments

  • Options
    yuriyuri Posts: 861
    didn't someone make a SOAP implementation for Duet?
    Can't recall who it was, but he will sure post in here :p
Sign In or Register to comment.