LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

instrument comuication using SOAP protocol

Hello,

My issue is the following: I have to control 2 GC Agilent 7890A using LabView 2010 and ethernet cables.
So far, I still dont have any comunication, even if the 2 devices are well seen  by MAX. I created 2 network devices, that work properly on MAX.

TCPIPO::10.1.1.101::9110:: SOCKET

TCPIPO::10.1.1.102::9110:: SOCKET

By using a software that allows me to check all the transfered datas on the ethernet connexion, I saw that the Agilent software uses a SOAP protocol.
The communication between the computer and each GC is done with the following text commande:

POST / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.3053)
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:#GetConnectionContext"
Host: 10.1.1.101:9110
Content-Length: 236
Expect: 100-continue
Connection: Keep-Alive

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body /></soap:Envelope>


Then, the GC answered:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-length: 407      

<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:xs='http://www.w3.org/2001/XMLSchema'  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'  xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'><soap:Body><GetConnectionContextResponse  xmlns='http://www.agilent.com/schemas/Analytical/Instrument/GC7890/2006/' >2J22J-3PT5C-MFN9B-UYA7V</GetConnectionContextResponse></soap:Body></soap:Envelope>


When I use this text commande with a VISA write VI and then a VISA read VI (with the VISA resource names created with MAX), nothing happen, no answer, and time out error message.

I dont know if the mistake comes only from the text I send, or if it's more complicated. I dont understand very much this SOAP protocol and how to use it with LabView.
Anyway, can anyone help me on this comunication issue?
Thank you very much for your help, this is a deep issue for me.

best regards,
remi.

0 Kudos
Message 1 of 14
(4,210 Views)

Picking this up again after 8 months?

 

What do you mean when you say "When I use this text commande with a VISA write VI". What text commands? There are no text commands. What's being sent is an HTTP POST transmission. That's not a VISA command. 

 

SOAP is just a specification on how to package up information to be sent over an HTTP connection. It basically provides an XML schema for the information. The stuff between the <soap:Envelope> and </soap:Envelope> is the SOAP message.

0 Kudos
Message 2 of 14
(4,199 Views)

According to your answer, i shouln't try to use VISA write/read VIs to send what a called text command (basicaly this SOAP code).

In this case, wich VI should I use to send a command and then to get the answer? And should I send this kind of "text command"?

The "text command" I'm talking about is this:
 
POST / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.3053)
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:#GetConnectionContext"
Host: 10.1.1.101:9110
Content-Length: 236
Expect: 100-continue
Connection: Keep-Alive

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body /></soap:Envelope>

All I want is finding the way to control these 2 GCs you know... and I think that the solution is in this kind of message.


Thank you for your help.
remi.

0 Kudos
Message 3 of 14
(4,184 Views)

As I pointed out, that "text command" is an HTTP POST. It's not a "command", but a request to an HTTP server. You'd use the TCP/IP functions to communicate. Examples have been posted on doing an HTTP POST request. I believe the Internet Toolkit has this capability as well..

0 Kudos
Message 4 of 14
(4,177 Views)

Hello,

 

I eventualy succeded to communicate with the GCs using the TCP/IP functions.

The problem i had was in the text i sent to the devices.. now it's solved. thank you.

But my issues with these GCs are not over.. the communication is good, i control them for many parameters.

However, to get datas i need to change the communication port on my computer. This is the process done by the company software that i have to reproduce.

And using the TCP/IP read/write functions, I didnt see a way to set the computer port.

 

So my question is how can i set the computer port (for example port 10000) for write/read functions?

 

Thank you very much for your answer.

 

remi.

0 Kudos
Message 5 of 14
(4,115 Views)

Your question is not clear. A TCP/IP listener is pre-configured to listen on a specific port. If you are connecting to a server you need to be told what this port is. You can't just guess. When you create a connection you specify an IP address and a port. The port is not specified in the write/read functions.

0 Kudos
Message 6 of 14
(4,106 Views)

Until now, i dont use the TCP listen function (or create a TCP listener).

I use the TCP Open Connection, and then TCP read / TCP write. in the end, TCP Close Connection.

With the Open Connection, I have to specify an IP adress and a remote port. Then i'm able to control the devices. so far so good, I have a communication between my computer (10.1.1.100:PC port that change at every new connection, and one GC 10.1.1.101:9110. this port is fixed.)

To get datas, the company software ask the GC to send datas one the PC port 10000. So to get datas, I need to set the PC port, and not a remote one anymore.

Should I use a TCP listen function? then I should connect a TCP read.vi to get my datas?

 

Thanks

remi.

 

0 Kudos
Message 7 of 14
(4,101 Views)

I think you've misunderstood the specifications. You can't set the local port on the client side when you open a connection. You can only set the port that you want to connect to on the server side (i.e., the device you're connecting to). Unless the server explicitly makes a reverse connection, there's no reason for you to be running a TCP listener on a specific local port.

 

Have you tried talking to Agilent about this SOAP protocol? They would be able to provide the documentation on it, if it's public.

0 Kudos
Message 8 of 14
(4,087 Views)

Hello,

I didn't reply before today cause I was on the field. Now I'm back to this project. Just before leaving, I succeded getting the datas using the TCP listen function to set my local port and then with a TCP read function I can get datas from my GCs. So that's very good! Unfortunately Agilent doesn't provide anything. I'm developping a Labview copy of their company software so.. I have to make their software talking.

So thank you for your advises.

 

But now my issues are not over.. the datas I got are coded.. in base64. Apparently, a package of 32 letters is send to my computer. These 32 letters coded in base64 correspond to 48 Hexadecimal caracters.

These 48 caracters should correspond to 3 datas. So each data is 16 hexadecimal caracters. And then I could eventualy see my decimal datas.

 

So basically do you have an idea on how to convert the 32 letters in base64 to 48 Hexadecimal caracters?

 

Thank you very much for the help

remi.

 

 

0 Kudos
Message 9 of 14
(4,062 Views)

It still makes no sense to me why you need to have a TCP Listener running on your computer, and your comments do not shed any light on this.

 

In terms of base64, see here: LabVIEW Utility VIs for Base64 Encoding . If you search this site you will find other examples and other discussions on handling base64.

0 Kudos
Message 10 of 14
(4,056 Views)