SNPX supports 13 digital signal types and 5 numeric I/O types, all with single and range read/write operations.

## Digital signals

Digital signals are boolean values. The following types are available:

| Type | Description |
|------|-------------|
| `SDI` / `SDO` | Standard Digital Input / Output |
| `RDI` / `RDO` | Robot Digital Input / Output |
| `UI` / `UO` | User Input / Output |
| `SI` / `SO` | System Input / Output |
| `WI` / `WO` | Weld Input / Output |
| `WSI` | Wire Stick Input |
| `PMC_K` | PMC Keep Relays |
| `PMC_R` | PMC Internal Relays |

### Read and write digital signals

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

public class SnpxIoDigital
{
    static void Main()
    {
        FanucRobot robot = new FanucRobot();
        var parameters = new ConnectionParameters("192.168.0.1");
        parameters.Snpx.Enable = true;
        robot.Connect(parameters);

        /**/
        // Read SDI[10]
        bool sdi10 = robot.Snpx.SDI.Read(10);

        // Write RDO[1] = ON
        robot.Snpx.RDO.Write(1, true);

        // Read UI[5]
        bool ui5 = robot.Snpx.UI.Read(5);

        // Read 100 SDI signals starting at index 1
        bool[] values = robot.Snpx.SDI.Read(1, 100);

        // Write 3 SDO signals starting at index 1
        robot.Snpx.SDO.Write(1, new[] { true, false, true });
        /**/
    }
}
```

**Python : SnpxIoDigital**
```python
from underautomation.fanuc.fanuc_robot import FanucRobot
from underautomation.fanuc.connection_parameters import ConnectionParameters

robot = FanucRobot()
parameters = ConnectionParameters("192.168.0.1")
parameters.snpx.enable = True
robot.connect(parameters)

##
# Read SDI[10]
sdi10 = robot.snpx.sdi.read(10)

# Write RDO[1] = ON
robot.snpx.rdo.write(1, True)

# Read UI[5]
ui5 = robot.snpx.ui.read(5)

# Read 100 SDI signals starting at index 1
values = robot.snpx.sdi.read(1, 100)

# Write 3 SDO signals starting at index 1
robot.snpx.sdo.write(1, [True, False, True])
##
```

## Numeric I/O

Numeric I/O signals are 16-bit unsigned integers (ushort):

| Type | Description |
|------|-------------|
| `GI` / `GO` | Group Input / Output |
| `AI` / `AO` | Analog Input / Output |
| `PMC_D` | PMC Data |

### Read and write numeric I/O

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

public class SnpxIoNumeric
{
    static void Main()
    {
        FanucRobot robot = new FanucRobot();
        var parameters = new ConnectionParameters("192.168.0.1");
        parameters.Snpx.Enable = true;
        robot.Connect(parameters);

        /**/
        // Read GI[1]
        ushort gi1 = robot.Snpx.GI.Read(1);

        // Write GO[1] = 500
        robot.Snpx.GO.Write(1, 500);

        // Read AI[1]
        ushort ai1 = robot.Snpx.AI.Read(1);

        // Write AO[2] = 32767
        robot.Snpx.AO.Write(2, 32767);

        // Read a range of GI values
        ushort[] giValues = robot.Snpx.GI.Read(1, 100);
        /**/
    }
}
```

**Python : SnpxIoNumeric**
```python
from underautomation.fanuc.fanuc_robot import FanucRobot
from underautomation.fanuc.connection_parameters import ConnectionParameters

robot = FanucRobot()
parameters = ConnectionParameters("192.168.0.1")
parameters.snpx.enable = True
robot.connect(parameters)

##
# Read GI[1]
gi1 = robot.snpx.gi.read(1)

# Write GO[1] = 500
robot.snpx.go.write(1, 500)

# Read AI[1]
ai1 = robot.snpx.ai.read(1)

# Write AO[2] = 32767
robot.snpx.ao.write(2, 32767)

# Read a range of GI values
gi_values = robot.snpx.gi.read(1, 100)
##
```

## Complete example

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

public class SnpxIo
{
  public static void Main()
  {
    FanucRobot robot = new FanucRobot();

    ConnectionParameters parameters = new ConnectionParameters("192.168.0.1");
    parameters.Snpx.Enable = true;

    robot.Connect(parameters);

    /**/
    // --- Digital signals (boolean) ---

    // Read a single digital input
    bool sdi10 = robot.Snpx.SDI.Read(10);

    // Write a single digital output
    robot.Snpx.RDO.Write(1, true);

    // Read a range of digital inputs (100 signals starting at index 1)
    bool[] sdiRange = robot.Snpx.SDI.Read(1, 100);

    // Write a range of digital outputs
    robot.Snpx.SDO.Write(1, new[] { true, false, true });

    // Other digital signal types: UI, UO, SI, SO, WI, WO, WSI, PMC_K, PMC_R
    bool ui5 = robot.Snpx.UI.Read(5);
    robot.Snpx.SO.Write(3, false);


    // --- Numeric I/O (ushort) ---

    // Read Group Input
    ushort gi1 = robot.Snpx.GI.Read(1);

    // Write Group Output
    robot.Snpx.GO.Write(1, 500);

    // Read Analog Input
    ushort ai1 = robot.Snpx.AI.Read(1);

    // Write Analog Output
    robot.Snpx.AO.Write(2, 32767);

    // Read a range of numeric I/O
    ushort[] giRange = robot.Snpx.GI.Read(1, 100);

    // Other numeric I/O types: PMC_D
    ushort pmcD = robot.Snpx.PMC_D.Read(1);
    /**/
  }
}
```

**Python : SnpxIo**
```python
from underautomation.fanuc.fanuc_robot import FanucRobot
from underautomation.fanuc.connection_parameters import ConnectionParameters

# Create a robot instance
robot = FanucRobot()

# Configure connection parameters
parameters = ConnectionParameters("192.168.0.1")
parameters.snpx.enable = True

# Connect to the robot
robot.connect(parameters)

##
# --- Digital signals (boolean) ---

# Read a single digital input
sdi10 = robot.snpx.sdi.read(10)

# Write a single digital output
robot.snpx.rdo.write(1, True)

# Read a range of digital inputs (100 signals starting at index 1)
sdi_range = robot.snpx.sdi.read(1, 100)

# Write a range of digital outputs
robot.snpx.sdo.write(1, [True, False, True])

# Other digital signal types: UI, UO, SI, SO, WI, WO, WSI, PMC_K, PMC_R
ui5 = robot.snpx.ui.read(5)
robot.snpx.so.write(3, False)


# --- Numeric I/O (ushort) ---

# Read Group Input
gi1 = robot.snpx.gi.read(1)

# Write Group Output
robot.snpx.go.write(1, 500)

# Read Analog Input
ai1 = robot.snpx.ai.read(1)

# Write Analog Output
robot.snpx.ao.write(2, 32767)

# Read a range of numeric I/O
gi_range = robot.snpx.gi.read(1, 100)

# Other numeric I/O types: PMC_D
pmc_d = robot.snpx.pmc_d.read(1)
##
```

## API reference

**Members of Snpx.Internal.DigitalSignals**
```csharp
public class DigitalSignals : SnpxElements<bool, int> {
    // Reads the digital signal at the specified index.
    public override bool Read(int index)

    // Reads a range of digital signals.
    public bool[] Read(int firstIndex, ushort count)

    // Gets the segment name identifying this signal group.
    public SegmentName SegmentName { get; }

    // Gets the segment offset for this signal group.
    public SegmentOffset SegmentOffset { get; }

    // Gets the segment selector for this signal group.
    public SegmentSelector SegmentSelector { get; }

    // Writes a value to the digital signal at the specified index.
    public void Write(int index, bool value)

    // Writes values to consecutive digital signals.
    public void Write(int firstIndex, bool[] values)
}
```

**Members of Snpx.Internal.NumericIO**
```csharp
public class NumericIO : SnpxElements<ushort, int> {
    // Reads the numeric I/O value at the specified index.
    public override ushort Read(int index)

    // Reads a range of numeric I/O values.
    public ushort[] Read(int firstIndex, ushort count)

    // Gets the segment name identifying this I/O group.
    public SegmentName SegmentName { get; }

    // Gets the segment offset for this I/O group.
    public SegmentOffset SegmentOffset { get; }

    // Gets the segment selector for this I/O group.
    public SegmentSelector SegmentSelector { get; }

    // Writes a value to the numeric I/O at the specified index.
    public void Write(int index, ushort value)

    // Writes values to consecutive numeric I/O.
    public void Write(int firstIndex, ushort[] values)
}
```