Then add in the same manner the yapi.dll DLL, located in the Sources/dll directory4. Then,from the Solution Explorer window, right click on the DLL, select Properties and in the Propertiespanel, set the Copy to output folder to always. You are now ready to use your Yoctopuce modulesfrom Visual Studio.In order to keep them simple, all the examples provided in this documentation are consoleapplications. Naturally, the libraries function in a strictly identical manner if you integrate them in anapplication with a graphical interface.12.3. Control of the Latitude functionA few lines of code are enough to use a Yocto-GPS. Here is the skeleton of a C# code snipplet touse the Latitude function.[...]string errmsg ="";YLatitude latitude;// Get access to your device, connected locally on USB for instanceYAPI.RegisterHub("usb", errmsg);latitude = YLatitude.FindLatitude("YGNSSMK1-123456.latitude");// Hot-plug is easy: just check that the device is onlineif (latitude.isOnline()){ // Use latitude.get_currentValue(); ...}Let's look at these lines in more details.YAPI.RegisterHubThe YAPI.RegisterHub function initializes the Yoctopuce API and indicates where the modulesshould be looked for. When used with the parameter "usb", it will use the modules locallyconnected to the computer running the library. If the initialization does not succeed, this functionreturns a value different from YAPI.SUCCESS and errmsg contains the error message.YLatitude.FindLatitudeThe YLatitude.FindLatitude function allows you to find a latitude sensor from the serialnumber of the module on which it resides and from its function name. You can use logical names aswell, as long as you have initialized them. Let us imagine a Yocto-GPS module with serial numberYGNSSMK1-123456 which you have named "MyModule", and for which you have given the latitudefunction the name "MyFunction". The following five calls are strictly equivalent, as long as"MyFunction" is defined only once.latitude = YLatitude.FindLatitude("YGNSSMK1-123456.latitude");latitude = YLatitude.FindLatitude("YGNSSMK1-123456.MyFunction");latitude = YLatitude.FindLatitude("MyModule.latitude");latitude = YLatitude.FindLatitude("MyModule.MyFunction");latitude = YLatitude.FindLatitude("MyFunction");YLatitude.FindLatitude returns an object which you can then use at will to control thelatitude sensor.isOnlineThe isOnline() method of the object returned by YLatitude.FindLatitude allows you toknow if the corresponding module is present and in working order.4 Remember to change the filter of the selection window, otherwise the DLL will not show.12. Using Yocto-GPS with C#80 www.yoctopuce.com