Document to share XML-RPC client VIs for LabVIEW and provide feedback, suggestions, request, etc.
The first VI is a very simple XML-RPC client that sends a method call with numeric parameters to a server and receives the response.
[1/17/2010] Added a LV 8.0 version of the code. This VI includes a custom version of the HTTP Post VI as HTTP Post didn't exist in LabVIEW 8.0.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
This looks really useful. My interest is that I would really like to see a Robotic Operating System (ROS) interface in LabVIEW and this is certainly the first step.
Please save in LabVIEW 9.0 because it was saved in LabVIEW 10. Thanks
Yahooooooooooooooooooooo!!! Except for one EEEEENY beeny thing...
Can you save in LV 8.0? Or, put the names of the sub VI's so I can build it myself??
Label these..
http://screencast.com/t/sxlt6HtfQKkb
I am doing this for this project..
Christian:
Still trying to get the SYNAPSE system to work with LabVIEW... I know it HAS to be simple....
First, have a script running called SNAP Connect that "listens" for commands issued from LabVIEW...
Then, hook up to the serial USB... as shown below....
CONN_TYPE_USB = 2 # From the manual your LabVIEW code calls for another localhost.. I want to be able to put this on my own URL and just call something like www.example.com/labview.html Not sure how to do that....
srv = ServerProxy("http://localhost:8080", allow_none=True) # The Python XMLRPCLib way to connect to the server
srv.connectSerial(CONN_TYPE_USB,1) # USB0 is in fact the 1st
SNAP connect takes care of connecting to the device on USB0
You do not need any additional software on the USB stick as it can route/forward rpcs without needing a script. The remote device (ie the one taking the measurements) simply requires you to define the function you want to call over the air.
Here is an example (merely an example since I do not know how you will ultimately have your HW setup). Here the raw ADC value is reported back to the client for conversion. You can add a lot to this if necessary, like reporting a node type/version, converting the data on the node, etc…
Def getTemp():
returnAddr = rpcSourceAddr() # or can be defined or discovered – up to you
TEMP_ADC = 1
tempData = readAdc(TEMP_ADC)
rpc(returnAddr, “reportTempData”, nodeName, tempData)
Or
rpc(returnAddr, “reportTempData”, loadNvParam(NV_DEVICE_NAME_ID), covnertData(tempData))
or
“Your choice”
At issue is just getting the thing signed up...
Still workin'..
Can not get the USB to sign up..
I am told this..
Trying to do this using Christian's XML-RPC HTTP Post.vi and trying to
I need to split up the commands into two, CHR and int.. but do not have the info on the format of the protocol...
I just want to put the necessary characters in the three input locations so I can get this silly thing to work.
Aaaaaaargh!
Anyone know?
ANYONE:
How do you know what to put in the header?
In Christian's example our header looks like this...
POST / HTTP/1.0
User-Agent: National Instruments LabVIEW
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 196
Specifically how do you know these two:
POST / HTTP/1.0 and and
User-Agent: National Instruments LabVIEW
I am told to make the SYNAPSE system to work I must put in this header..
POST /RPC2 HTTP/1.0
User-Agent: Frontier/5.1.2 (WinNT)
Host: localhost Content-Type: text/xml
Content-Length: 179
Can you tell me why they use POST /RPC2 part in there?
Does this mean we need to have some files on the patc C;/RPC2? If so what files are required in there?
Where does the RPC2 part come from?
And the user-Agent..
Where do we learn about that?
See SYNAPSE forum..
http://forums.synapse-wireless.com/showthread.php?p=6626#post6626
How does a provate message get below? How do I post a VI to share?
Why is the format of answers all messed up?
I always get this message: An unexpected error has occurred. Please make sure that your session did not expire while viewing this page.Christian:
See the attached file that has all the elements they tell me I need but they
do not fully understand XML-RPC...
Thanks,
Dave
Dave Korpi Engineer
Website: www.MassFlowMetersAndControllers.Com
A Division of Take 5 Inc.
405 Monterey Avenue
Pacific Grove, CA 93950
dave.korpi@gmail.com
tel: 831-455-0418
<><><><><><><><><><><>
Cheapest VOIP, get rid of your expensive Land Line and keep the number!
http://www.dpbolvw.net/click-3314891-10588036?sid=phon
There seem to be some serious issues in the comment editing fields of NI Community right now, which is causing the messed up formatting and error messages.
If you get the error message 'An unexpected error has occurred. Please make sure that your session did not expire while viewing this page.' ignore it and assume your message has been posted correctly. Refresh the page.
Hi,
I need to communicate to RPC server running on port 7700 with a username and password. How do I this in labview? Does anyone have any examples?
As the example below?