LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XMPP and LabVIEW

Dear all,

Is it possible to build LabView application communicating with other application (not only written in LabView language) through XMPP protocol?


miro

0 Kudos
Message 1 of 9
(5,146 Views)

Hi miro,

i am sure that it is possible. Do you have a specified need for it? Can you please explain?

 

Mike

0 Kudos
Message 2 of 9
(5,136 Views)

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 

0 Kudos
Message 3 of 9
(5,131 Views)

Hi miro,

what do you know about the protocol? You can use the TCP/IP functions to implement this protocol.

 

Mike

0 Kudos
Message 4 of 9
(5,124 Views)

Hello Mike,

 

But how? Do you know how I can  implement XMPP using TCP functions? Where can I get some additional information?

 

 

mike 

0 Kudos
Message 5 of 9
(5,112 Views)

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 6120RFC 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

Zenon Kuder
Applications Engineering
National Instruments
Message 6 of 9
(5,084 Views)

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 

0 Kudos
Message 7 of 9
(5,069 Views)
Hi cabal, do you have a specific server to which or through which you want to connect? Mike
0 Kudos
Message 8 of 9
(5,055 Views)

Hello Mike,

 

I want to use OpenFire server. 

 

 

miro 

0 Kudos
Message 9 of 9
(5,032 Views)