This library has been developed and is compiled for all versions of .NET :

- .NET Framework : 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
- .NET Standard : 2.0, 2.1
- .NET Core : 2.0, 2.1, 2.2, 3.0
- .NET 5.0, 6.0, 8.0, 9.0

For use with [Mono](https://www.mono-project.com) or [Universal Windows Plateform](https://en.wikipedia.org/wiki/Universal_Windows_Platform) (UWP), use .NET Standard 2.1.

For use with the 3D [Unity](https://unity.com) engine, you can use any .NET Framework or Standard version.

For each of these .NET versions, the assembly file `UnderAutomation.Fanuc.dll` is provided compiled in `AnyCPU`.

Recent .NET implementations (Core, 5.0, ...) allow cross-platform development on Windows, Linux and MacOS in various processor architectures (x64, x86, ARM, ARM64)

## Download from Nuget

We recommend that you use the Nuget package manager to use this library. The appropriate version of .NET will be automatically chosen and you can easily update the library in the future.

In Visual Studio, right click on the `References` node of your project and select `Manage NuGet Packages...`.

Search for `UnderAutomation` and install the latest version of the package. After accepting the terms of use, the package will be downloaded and added as a reference to your project. You can then start developing!

See on NuGet.org : [https://www.nuget.org/packages/UnderAutomation.Fanuc](https://www.nuget.org/packages/UnderAutomation.Fanuc)

[![Nuget](https://img.shields.io/nuget/dt/UnderAutomation.Fanuc?style=for-the-badge) ![Nuget](https://img.shields.io/nuget/v/UnderAutomation.Fanuc?style=for-the-badge&label=Latest%20version)](https://www.nuget.org/packages/UnderAutomation.Fanuc)

## Direct download

You can also directly download the file `UnderAutomation.Fanuc.dll`, you can then reference this assembly in your project.

Go to the [download page](/fanuc/download) to get these files and the compiled examples.

You can also checkout the sources of these examples [on GitHub](https://github.com/underautomation/Fanuc.NET).

[![Github](https://img.shields.io/github/downloads/UnderAutomation/Fanuc/total?style=for-the-badge) ![Github](https://img.shields.io/github/v/release/UnderAutomation/Fanuc?style=for-the-badge)](https://github.com/underautomation/Fanuc/releases)

## Start developing

You can now start writing your application in C#, F# or VB.NET.

Take a look at the following chapters to learn about the various features.

You just have to import the namespace `UnderAutomation.Fanuc`

**C# : GetStartedNetConnect**
```csharp
using UnderAutomation.Fanuc;

public class GetStartedNetConnect
{
    /**/
    static void Main(string[] args)
    {
        var robot = new FanucRobot();
        robot.Connect("192.168.0.1");

        /// ... It's your turn to play :)
    }
    /**/
}
```

## Ping before connecting

**C# : GetStartedNetPing**
```csharp
using UnderAutomation.Fanuc;

public class GetStartedNetPing
{
    static void Main()
    {
        /**/
        var robot = new FanucRobot();

        var parameters = new ConnectionParameters("192.168.0.1");
        parameters.PingBeforeConnect = true;

        robot.Connect(parameters);
        /**/
    }
}
```

This will ping the robot before trying to connect. If the robot does not respond to the ping, the connection attempt will be aborted immediately with an exception.

## Robot Language

**C# : GetStartedNetLanguage**
```csharp
using UnderAutomation.Fanuc;
using UnderAutomation.Fanuc.Common;

public class GetStartedNetLanguage
{
    static void Main()
    {
        /**/
        var robot = new FanucRobot();

        var parameters = new ConnectionParameters("192.168.0.1");
        parameters.Language = Languages.English; // or Languages.Japanese, or Languages.Chinese

        robot.Connect(parameters);
        /**/
    }
}
```

If unspecified, the default language is English.
You have to set this parameter according to the current language of you controller so that strings (SNPX, FTP, TELNET) are correctly decoded.

Used encodings are :

- English : ASCII
- Japanese : Shift-JIS
- Chinese : GB2312