Category Archives: NAV2018

Drone Control from Dynamics NAV

This week at UGFocus I brought my Tello Drone to have some fun at the Hackathon.

The Tello drone can be controlled with a simple text based command mode through UDP communication.

First up, lets connect to the drone, this requires an UdpClient DotNet instance (Since NAV only support TCP not UDP)

After this we need to create a Send command:

UDP is just a byte stream across the net so our data needs to be converted into a byte[] array.

After this, we’re ready to receive data. UDP is a bit different, because send and receive are not linked in the same way as TCP, so we’ll just have to wait a bit to see if anything is received. Since some of the commands to the drone can take a while to complete (it’s a physical thing after all) I set the timeout to around 10 seconds:

Now we’re ready to send a real command to the done:

This simply sends the string “takeoff” to the drone. The IfNotOKTryToLand() method will check if we get an OK return:

On top of this, I have created a series of navigational commands like this:

To complete the picture we added a small little UI where we could put together a series of commands that the drone could execute:

Down the objects from here Tello.zip but please remember, controlling a drone from Dynamics might not be the smartest or safest thing to do 🙂

This article also serves as an example of how to do UDP communication with Dynamics NAV.

Strange NAV2018 Extension publishing error

Today I took an (v1) extension, that had worked perfectly on NAV2017 and tried to publish it to a NAV2018 instance, resulting in a cascade of errors:

[23462397] You have specified an unknown variable.SDefine the variable under 'Global C/AL symbols'.

I have specified an unknown variable, then SDefine the variable? Strange?

It turned out, that the offending variable was called “S¢gning” (Old danish code, with messed up character conversion), so the character ¢ after the S messes up the error description. The object compiles and work fine in NAV2018 FINSQL, so it seems that Microsoft have changed the way a V1 Extension is compiled at publish time that has a stricter character requirements. Changing into the correct Danish ø does not help.

Update: This was an interesting experience in wrong combinations of regional settings on servers vs. the quirkiness of the .TXT format. After going through the entire workflow and fixing setting I’m back in business 🙂

(Article added here for helping people when googling errors like this).