LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

best network communication protocole between master computer (labview code) and 5 computers (python, client)

Hi all,

 

I use Labview 2011 on windows 7.

In my project, I developed an application in Labview (running on windows computer, MASTER), called LB1, that has to communicate with up to 5 Raspberry Pi (running python code, SLAVES), called RP1, RP2, RP3, RP4 and RP5. They are all connected to the same network (cable or WiFi). From the Labview application, some information has to be retrieved from the Raspberry Pi RP1 GPIO. For example, the Labview application has to get the temperature measured by RP1. To do that, the Labview application has to ask the information and wait until the information is provided. Another example is when the RP2 is notifying the Labview application LB1 that something happened on the GPIO.

From internet, I found many protocols, such as WebSocket, RESTful, MQTT, etc. For MQTT, it is an asymchronous protocol so It seems it is not adapted for wait-response communication. Regarding WebSocket and RESTful, I am quite confused about the server and the clients and how to setup such protocol.

Any suggestions that will fit my project? thank you.

Cedric

0 Kudos
Message 1 of 6
(3,102 Views)

I recommend having a look at the STM library from NI.  It uses a simple bi-directional protocol that includes 4 bytes for message length, then a message ID, followed by the data.  I find this to be extremely simple to do in LabVIEW since you just need a simple loop that just keeps trying to read messages and you can just keep the reference around somewhere to send the messages.  Not sure how hard that is to do in the Raspberry Pi.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(3,073 Views)

Consider using a Modbus TCP/IP protocol if you are just looking at point values.  I would imagine some Modbus slave libraries exist for Raspberry PI.

0 Kudos
Message 3 of 6
(3,070 Views)

Hi,

 

Unfortunately, the information transmitted can be an array (2000 samples) which is not possible with Modbus protocol.

 

Cedric

0 Kudos
Message 4 of 6
(3,037 Views)

Is the STM library developed only for NI or this is a standard protocol? I didn't find any information about such protocol implemented with Python.

 

Cedric 

0 Kudos
Message 5 of 6
(3,036 Views)

@Cedric51 wrote:

Is the STM library developed only for NI or this is a standard protocol? I didn't find any information about such protocol implemented with Python.


It was developed at a LabVIEW library.  I want to say they eventually made a C++ version of it.  But you can easily create your own protocol based on it since the code is completely viewable.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(3,027 Views)