07-21-2011 02:31 AM
Dear all,
Is it possible to build LabView application communicating with other application (not only written in LabView language) through XMPP protocol?
miro
07-21-2011 04:09 AM
Hi miro,
i am sure that it is possible. Do you have a specified need for it? Can you please explain?
Mike
07-21-2011 05:41 AM
Hello Mike,
Thnank you for your resposne.
I have to build two LabView applications exchanging data each other through XMPP protocol. XMPP based on XML format. Below I put example of message format which has to be used:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<communicationMessage type="DATA">
<header>
<flag>DAT</flag>
<messageID>DAT</messageID>
<source>127.0.1.1</source>
<taskID>1</taskID>
</header>
<data>
<comment></comment>
<parameter_data>
<parameters/>
</parameter_data>
<xmpp_data>data 1</xmpp_data>
<xmpp_data>data 2</xmpp_data>
<xmpp_data>data 3</xmpp_data>
[…]
<xmpp_data>data N-1 </xmpp_data>
<xmpp_data> data N </xmpp_data>
</data>
</communicationMessage>
where data# stands for real numbers to be sent.
For example. First LabView application generate sine signal by using XMPP, the second application must received it. They must to exchange data through network by usse XMPP protocol.
miro
07-21-2011 07:05 AM
Hi miro,
what do you know about the protocol? You can use the TCP/IP functions to implement this protocol.
Mike
07-21-2011 12:56 PM
Hello Mike,
But how? Do you know how I can implement XMPP using TCP functions? Where can I get some additional information?
mike
07-22-2011 06:43 AM - edited 07-22-2011 06:44 AM
Hello Miro,
unfortunately I wasn't able to find any code implementing XMPP for LabVIEW.
Nevertheless, as Mike mentioned, it should be possible to implement the basic protocol stack yourself.
I assume that you are going to use some XMPP server, therefore both of the clients would "log in" to the server and exchange messages through it? Or do you plan to have the clients communicate directly (peer-to-peer)?
Basically your options are:
- implementing the protocol yourself accoring to the specifications: RFC 6120, RFC 6121. You would need to open the socket via TCP functions and then send XML, wait for replies and parse the answers.
- implementing the protocol yourself without adhering to the specification, just to "make it work". As XMPP evolved from Jabber IM protocol, much software is quite tolerant in what it receives.
- using some library in C or another language via LabVIEW library calls, console calls or ActiveX etc. You can find libraries here: http://xmpp.org/xmpp-software/libraries/
BTW, the XML snippet you sent doesn't look like a real XMPP data. Are you sure you need to use XMPP or you just want to exchange some general XML?
XMPP basically supports three types of "stanzas" - presence, message and IQ. You are able to encapsulate your XML in any of them. The difference between them is defined in the specifications and it's useful to choose it right if you plan to integrate your programs with existing XMPP-compliant software, especially the servers.
If you don't have a server yet, you can choose one from this list of XMPP servers - ejabberd and Openfire are quite popular.
Also, are you sure you want to stream data using XMPP? You mentioned you want to stream sine wave. The overhead of having the XML around it could be quite large if there's a lot of data. I think that using technology like Network Streams (introduced in LabVIEW 2010), you can get much higher performance.
As a matter of fact there are also specifications for p2p streaming using XMPP, but they are quite complex (Jingle)
Please let me know if you have any questions.
Have a great day!
Zenon
07-23-2011 11:30 AM
Hello Zenon,
Thank you for your response. It is impressive. I realized that it is quite complex problem and it will take time to figure it out.
I will start with calling C library via LabView.
I will inform you and others intrested in this topic.
miro
07-24-2011 01:46 AM
07-26-2011 03:50 PM
Hello Mike,
I want to use OpenFire server.
miro