SNPX lets you read and write system variables by name, including integer, real (float), position, and string types. You can also access Karel program variables using the `$[ProgramName]VariableName` syntax.

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

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

        /**/
        // Integer variables
        int rmtMaster = robot.Snpx.IntegerSystemVariables.Read("$RMT_MASTER");
        robot.Snpx.IntegerSystemVariables.Write("$RMT_MASTER", 1);

        // Real (float) variables
        float overr = robot.Snpx.RealSystemVariables.Read("$MCR.$GENOVERRIDE");
        robot.Snpx.RealSystemVariables.Write("$MCR.$GENOVERRIDE", 50.0f);

        // Position variables
        Position cellFloor = robot.Snpx.PositionSystemVariables.Read("$CELL_FLOOR");
        robot.Snpx.PositionSystemVariables.Write("$CELL_FLOOR", cellFloor);

        // String variables
        string lastAlm = robot.Snpx.StringSystemVariables.Read("$ALM_IF.$LAST_ALM");

        // Karel program variables
        int karelVar = robot.Snpx.IntegerSystemVariables.Read("$[MyKarelProg]my_variable");
        robot.Snpx.IntegerSystemVariables.Write("$[MyKarelProg]my_variable", 42);

        // Set variable by name (auto-typed)
        robot.Snpx.SetVariable("$RMT_MASTER", 1);
        /**/
    }
}
```

**Python : SnpxVariablesReadWrite**
```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)

##
# Integer variables
rmt_master = robot.snpx.integer_system_variables.read("$RMT_MASTER")
robot.snpx.integer_system_variables.write("$RMT_MASTER", 1)

# Real (float) variables
overr = robot.snpx.real_system_variables.read("$MCR.$GENOVERRIDE")
robot.snpx.real_system_variables.write("$MCR.$GENOVERRIDE", 50.0)

# Position variables
cell_floor = robot.snpx.position_system_variables.read("$CELL_FLOOR")
robot.snpx.position_system_variables.write("$CELL_FLOOR", cell_floor)

# String variables
last_alm = robot.snpx.string_system_variables.read("$ALM_IF.$LAST_ALM")

# Karel program variables
karel_var = robot.snpx.integer_system_variables.read("$[MyKarelProg]my_variable")
robot.snpx.integer_system_variables.write("$[MyKarelProg]my_variable", 42)

# Set variable by name (auto-typed)
robot.snpx.set_variable("$RMT_MASTER", 1)
##
```

## Complete example

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

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

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

    robot.Connect(parameters);

    /**/
    // --- Integer system variables ---
    int rmtMaster = robot.Snpx.IntegerSystemVariables.Read("$RMT_MASTER");
    robot.Snpx.IntegerSystemVariables.Write("$RMT_MASTER", 1);

    // --- Real (float) system variables ---
    float genOverride = robot.Snpx.RealSystemVariables.Read("$MCR.$GENOVERRIDE");
    robot.Snpx.RealSystemVariables.Write("$MCR.$GENOVERRIDE", 50.0f);

    // --- Position system variables ---
    Position cellFloor = robot.Snpx.PositionSystemVariables.Read("$CELL_FLOOR");
    robot.Snpx.PositionSystemVariables.Write("$CELL_FLOOR", cellFloor);

    // --- String system variables ---
    string lastAlm = robot.Snpx.StringSystemVariables.Read("$ALM_IF.$LAST_ALM");
    robot.Snpx.StringSystemVariables.Write("$ALM_IF.$LAST_ALM", "No alarms");

    // --- Karel program variables ---
    int karelVar = robot.Snpx.IntegerSystemVariables.Read("$[MyKarelProg]my_variable");
    robot.Snpx.IntegerSystemVariables.Write("$[MyKarelProg]my_variable", 42);

    // --- Set variable (auto-detects type) ---
    robot.Snpx.SetVariable("$RMT_MASTER", 1);
    /**/
  }
}
```

**Python : SnpxVariables**
```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)

##
# --- Integer system variables ---
rmt_master = robot.snpx.integer_system_variables.read("$RMT_MASTER")
robot.snpx.integer_system_variables.write("$RMT_MASTER", 1)

# --- Real (float) system variables ---
gen_override = robot.snpx.real_system_variables.read("$MCR.$GENOVERRIDE")
robot.snpx.real_system_variables.write("$MCR.$GENOVERRIDE", 50.0)

# --- Position system variables ---
cell_floor = robot.snpx.position_system_variables.read("$CELL_FLOOR")
robot.snpx.position_system_variables.write("$CELL_FLOOR", cell_floor)

# --- String system variables ---
last_alm = robot.snpx.string_system_variables.read("$ALM_IF.$LAST_ALM")
robot.snpx.string_system_variables.write("$ALM_IF.$LAST_ALM", "No alarms")

# --- Karel program variables ---
karel_var = robot.snpx.integer_system_variables.read("$[MyKarelProg]my_variable")
robot.snpx.integer_system_variables.write("$[MyKarelProg]my_variable", 42)

# --- Set variable (auto-detects type) ---
robot.snpx.set_variable("$RMT_MASTER", 1)
##
```

## API reference

**Members of Snpx.Internal.PositionSystemVariables**
```csharp
public class PositionSystemVariables : SnpxWritableAssignableElements<Position, string, PositionSystemVariablesBatchAssignment> {
    protected override string GetAssignmentName(string index)

    protected override int GetAssignmentSize(string index)

    protected override string GetAssignmentTarget(string index)

    // Reads the position at the specified system variable.
    public Position Read(string index)

    // Reads a value from the client at the specified memory offset.
    protected override Position ReadFromClient(int offset, string index)

    // Writes a Cartesian position to the specified system variable.
    public void Write(string variable, CartesianPosition cartesianPosition)

    // Writes an extended Cartesian position to the specified system variable.
    public void Write(string variable, ExtendedCartesianPosition extendedCartesianPosition)

    // Writes a joints position to the specified system variable.
    public void Write(string variable, JointsPosition jointsPosition)

    // Writes a value to the robot at the specified offset.
    protected override void WriteInClient(int offset, string index, Position value)
}
```

**Members of Snpx.Internal.StringSystemVariables**
```csharp
public class StringSystemVariables : SnpxWritableAssignableElements<string, string, StringSystemVariablesBatchAssignment> {
    protected override string GetAssignmentName(string index)

    protected override int GetAssignmentSize(string index)

    protected override string GetAssignmentTarget(string index)

    // Reads a value from the client at the specified memory offset.
    protected override string ReadFromClient(int offset, string index)

    // Writes a value to the robot at the specified offset.
    protected override void WriteInClient(int offset, string index, string value)
}
```