Smartphones, Tablets, and Mobile Devices Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Regarding Operating NI Dashboard With Android Phone Using Web Service

Regarding Operating NI Dashboard With Android Phone Using Web Service

Hi,

Can anybody help me with the using the Dashboard with android phone with LABVIEW 2013 on my Windows PC. The tutorials on the NI site for getting stated with the dashboard are for 2012 LABVIEW versions in which you had to go to Bulid Specification to create a RESTful Web service. But that doesnot apply to LABVIEW 2013. In 2013, you can directly create a web service and make a VI with web services palette in the Web resources Tab, but now ,how do I make it work with Dashboard app. And one more problem is that there is no option for polling on the android phone in case of web service.

Right now what I am just trying to do is display a random number on my android phone when a web service on my Pc's ip at port 8080 is running.

Please share if there is a diffrent tutorial or video to do this.

Please Help and ask questions If you were not able to understand the problem.

Thanks.

0 Kudos
Message 1 of 12
(4,496 Views)

Re: Regarding Operating NI Dashboard With Android Phone Using Web Service

You should be able to browse for the available web services on your server by entering the server's name or IP address and the port number (default is 8080). From there you can see the list of web services. When you choose a web service it shows you a list of methods, and when you choose a method it shows a list of compatible terminals. Only numeric and boolean terminal types are support in Data Dashboard Mobile, and only XML output is supported.

Data Dashboard Mobile always polls web services once a second.

Message 2 of 12
(2,226 Views)

Re: Regarding Operating NI Dashboard With Android Phone Using Web Service

Hi Speshin,

It looks like the link in the tutorial pushed to instructions from LabVIEW 2011 instead of LabVIEW 2013.

Please try using this help information about how to create a Web Service in LabVIEW 2013:

http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/build_web_service/

Does this help?

Joey S.
Senior Product Manager, Software
National Instruments
Message 3 of 12
(2,226 Views)

Re: Regarding Operating NI Dashboard With Android Phone Using Web Service

Hi Adam,

Thanks for the prompt reply. I have kept the method as GET and the output as XML. But whenever I select the ip and the port in the app it says Connecction error unable to connect. And Also I am attaching the demo project if you may have a look at it. And see where am I going Wrong.

Thanks.

0 Kudos
Message 4 of 12
(2,226 Views)

Re: Regarding Operating NI Dashboard With Android Phone Using Web Service

Hi Joey,

I have done that, but using web service with dashboard is the problem and not creating the web service. I went through that tutorial already.

Thanks.

0 Kudos
Message 5 of 12
(2,226 Views)

Re: Regarding Operating NI Dashboard With Android Phone Using Web Service

Most connection problems are actually due to network configuration issues. You phone needs to be able to connect to the machine and the port needs to be accessible through any firewall that is enabled. Is your phone connected to the same network as the computer running LabVIEW?

Message 6 of 12
(2,226 Views)

Re: Regarding Operating NI Dashboard With Android Phone Using Web Service

Hi Adam,

Yes it is connected in the same network and there is no problem with the firewall as I am able to connect to shared variables with my phone.

One more thing Do I need to have my phone and PC in the same network while using web services . I thought that the whole point of it was to be able to access it through internet not depending on which network your phone is on.

0 Kudos
Message 7 of 12
(2,226 Views)

Re: Regarding Operating NI Dashboard With Android Phone Using Web Service

I just checked your example code, and I see the problem. Your web service method doesn't have any outputs. You need to wire the shared variable to an indicator and then connect that indicator to the connector pane.

Web Services still require access to the server and access through to the web server port. One of the advantages is that there is only one port, and it's a port that IT people are more likely to allow you to open up. Shared Variables have a whole range of ports to open, and usually IT people don't want to open those ports. Still, web services aren't magic. You have to host them on a server that can be accessed by your client (the phone in this case). That means if you want to access it from anywhere on the internet then the server needs a public IP (possibly using port forwarding), and it needs to allow the web server port through the firewall.

0 Kudos
Message 8 of 12
(2,226 Views)

Re: Regarding Operating NI Dashboard With Android Phone Using Web Service

Hi Adam,

1)Thanks for the reply. So, I have connected the shared variable to an indicator  but I dont understand what you mean by "connect that indicator to the connector pane" ??. As, shown in the snapshot.

2)When I use the below port then it shows connection error.

8080TCP
HTTP alternate (http_alt)—commonly used for Web proxy and caching server, or for running a Web server as a non-root user

But when I use some other port say 8000. It does not give any error just says no supported variables. And, I was able to communicate remotely with my PC using my android phone.

Please help will be appreciated.snapshot.PNG

0 Kudos
Message 9 of 12
(2,226 Views)
Highlighted

Re: Regarding Operating NI Dashboard With Android Phone Using Web Service

It sounds like you may be very new to LabVIEW in general. I suggest you look through some of the resources available here to learn about LabVIEW programming. For setting up a connector pane you can look specifically at this document (ignore the part where you right-click to show the connector pane; it is already showing to the left of the icon in the top right of the front panel window).

Once you have set up the connector pane corerctly then you should be able to refresh your variable list to see it in the list. Regarding port numbers for web services, you can have different servers running on different ports. There is typically one main LabVIEW server running on 8080. That is the server that is used when you "Publish" the web service. However, when you right click the service and choose "Start" it is actually published to a "Local Debugging" server, which will be on a different port. Right click on your web method (called "Web Request Service.vi (GET)") in the project and choose "Show Method URL...". That will bring up a dialog with a dropdown to see the ports for each running server. On my machine the debugging server is on port 8001.

0 Kudos
Message 10 of 12
(2,226 Views)