LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

distant server

Solved!
Go to solution

I want to connect LabView to a distant server . Please can any one help me how to do that ?

0 Kudos
Message 1 of 8
(4,446 Views)
For what purpose? Database? File io? TCP/IP connection? Distance really doesn't have much to do with how a connection -- other than speed of course.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(4,432 Views)

I have my Raspberry pi configurated as a web server, now I need to connect my LabView application with that server to get data to and from my database in my raspberry pi. any idea please ? 

0 Kudos
Message 3 of 8
(4,403 Views)
Well, if everything is accessible through the web interface, LabVIEW's http client VIs should work.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 8
(4,393 Views)

I'm really blocked for communication labview and database in distant server. Please help !

0 Kudos
Message 5 of 8
(4,353 Views)
OK, well then you are going to have to go through the server on the other end. Does the Raspberry pi support php? In case you don't know, php is text based language that is primarily used to dynamically build webpages.

Now in order to complete that task, it has to be able to access the local database. Hence, another use of php is to create "web pages" that are never meant to be displayed in a browser, but simply return data from the database as a json or XML string.

What you can do is create a php page on the Raspberry that performs the query for you and returns the data.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 8
(4,341 Views)

Well I finally succeeded to make this connection : Labview --> php --> database, now I need to get data from database. Actualy, I have a boolean control (LED) which must chage color when it received "1" from database. I think that there is no big difference but I didn't understant how to connect wires.

Please anyone can help me ?

0 Kudos
Message 7 of 8
(4,299 Views)
Solution
Accepted by hibaguizani15

The HTTP Client VIs will return a string with the 'response' from the PHP script (e.g. if the script echoes 'hello' then that will be contained in the body string). Your PHP script will need to print/echo the data you want in some sensible format (suggestion: use JSON). You can then use the string to JSON function in LabVIEW to convert the string data into a LabVIEW cluster which you can then unbundle and wire to your boolean.

 

I suggest you take a look at some of the LabVIEW tutorials - your VI has some serious problems to do with having no execution timing (which means you will poll the raspberry PI as quickly as your computer can), your event structure will never fire (the value change event happens when you click on the 'Boolean' but it's not a button so you can't click on it) and because of that you won't be able to press the stop button.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 8 of 8
(4,278 Views)