LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Geolocation via LabView

I have a project where as well as capturing data via an ADC to a Surface Pro, I also require the GPS coordinates. Whilst it would be easy to attach an external GPS senesor I remembered that the Surface Pro has built in Geolocation via this (in Visual Studio)

 

Windows.Devices.Geolocation namespace

 

http://code.msdn.microsoft.com/windowsapps/Geolocation-2483de66/view/Discussions

 

Now in c,VB.NET etc you can access this. Is there a way to access this in LabView direct without making a dll etc

 

I have tested LabView on a Surface Pro btw in it works fine.

0 Kudos
Message 1 of 9
(3,689 Views)

Hi tomnz

 

The best way to use this in LabVIEW is to call Windows.Devices.Geolocation.namespace using a constructor node, it is the only way LabVIEW can access this Windows assembly. 

 

Here is more information about constructor nodes.

 

Regards

 

Chris S.
0 Kudos
Message 2 of 9
(3,637 Views)

Hi,

 

you may need to configure LabVIEW to use .Net framework 4.0 (see LabVIEW.exe.config related pages)

 

then, you can use the GeoCoordinateWatcher() constructor node in System.Device(4.0.0.0)>System.Device.Location.

 

 

Message 3 of 9
(3,490 Views)

Hey,

when I try to read the gps data I always get NaN but there is no error displayed. Is there anyone who has an idea??

Thanks for your help.

0 Kudos
Message 4 of 9
(3,371 Views)

Hi Sebko,

 

Are you able to post your LabVIEW code as to how you're using the constructor node?

 

Is your setup the same as the original poster in this forum?

 

Andrew B.
Application Engineer
National Instruments.
http://www.ni.com/support
0 Kudos
Message 5 of 9
(3,345 Views)

Now it works. I attached an image of my code.

Thank you.

0 Kudos
Message 6 of 9
(3,330 Views)

Hello,

 

I'm attempting to accomplish a similar task, in accessing the geolocation from Windows.  This approach seems to work if I setup the code like the picture that was submitted by the user sebko.  The problem that I have is that I get only one geo position and then it no longer updates until I restart the VI.

 

Any ideas?

 

 

 

0 Kudos
Message 7 of 9
(1,152 Views)

From the GeoCoordinateWatcher Class documentation:

 


The Status property can be checked to determine if data is available. If data is available, you can get the location one time from the Position property, or receive continuous location updates by handling the PositionChanged event.

You have to create an event handler VI to get continuous position updates. Here is an example: Register Callback VIs for .NET Events in LabVIEW

Basically, you need the Register Event Callback node and create the callback VI.

0 Kudos
Message 8 of 9
(1,101 Views)

@sebko wrote:

Now it works. I attached an image of my code.

Thank you.


This code leaks the GeoPositionWatcher refnum, which is not bad. But it also leaks the Position refnum with every loop iteration, which is serious!

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 9
(1,077 Views)