02-03-2019 07:46 PM
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
02-03-2019 09:12 PM
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.
02-03-2019 09:18 PM
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.
02-04-2019 09:42 AM
Hi,
Unfortunately, the information transmitted can be an array (2000 samples) which is not possible with Modbus protocol.
Cedric
02-04-2019 09:45 AM
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
02-04-2019 11:53 AM
@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.