Index: src/client/c/hu/varadiistvan/xplra/XPlane.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/XPlane.cc	(revision 17)
+++ src/client/c/hu/varadiistvan/xplra/XPlane.cc	(revision 18)
@@ -331,4 +331,65 @@
 //------------------------------------------------------------------------------
 
+void XPlane::setArray(const char* name, uint8_t type, size_t length,
+                      size_t offset) throw(Exception)
+{
+    stream->writeU8(Protocol::COMMAND_SET_SINGLE);
+    stream->writeString(name, strlen(name));
+    stream->writeU8(type);
+    stream->writeS32(static_cast<int32_t>(length));
+    stream->writeS32(static_cast<int32_t>(offset));
+}
+
+//------------------------------------------------------------------------------
+
+void XPlane::setFloatArray(const char* name, const float* values, size_t length,
+                           size_t offset) throw(Exception)
+{
+    setArray(name, Protocol::TYPE_FLOAT_ARRAY, length, offset);
+    stream->write(values, length*sizeof(*values));
+    stream->flush();
+    checkResult();
+}
+
+//------------------------------------------------------------------------------
+
+void XPlane::setIntArray(const char* name, const int32_t* values, size_t length,
+                         size_t offset) throw(Exception)
+{
+    setArray(name, Protocol::TYPE_INT_ARRAY, length, offset);
+    stream->write(values, length*sizeof(*values));
+    stream->flush();
+    checkResult();
+}
+
+//------------------------------------------------------------------------------
+
+void XPlane::setByteArray(const char* name, const uint8_t* values, size_t length,
+                          size_t offset) throw(Exception)
+{
+    setArray(name, Protocol::TYPE_BYTE_ARRAY, length, offset);
+    stream->write(values, length*sizeof(*values));
+    stream->flush();
+    checkResult();
+}
+
+//------------------------------------------------------------------------------
+
+void XPlane::setString(const char* name, const char* value, size_t length,
+                       size_t offset) throw(Exception)
+{
+    size_t valueLength = strlen(value);
+    if ((valueLength+1)>=length) {
+        setByteArray(name, reinterpret_cast<const uint8_t*>(value),
+                     length, offset);
+    } else {
+        auto_ptr<uint8_t> buffer(new uint8_t[length]);
+        memcpy(buffer.get(), value, valueLength);
+        memset(buffer.get() + valueLength, 0, length - valueLength);
+        setByteArray(name, buffer.get(), length, offset);
+    }
+}
+//------------------------------------------------------------------------------
+
 // Local Variables:
 // mode: C++
Index: src/client/c/hu/varadiistvan/xplra/XPlane.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/XPlane.h	(revision 17)
+++ src/client/c/hu/varadiistvan/xplra/XPlane.h	(revision 18)
@@ -198,4 +198,31 @@
     void setDouble(const char* name, double value) throw(Exception);
 
+    /**
+     * Set the given float array to values in the given buffer.
+     */
+    void setFloatArray(const char* name, const float* values, size_t length,
+                       size_t offset = 0) throw(Exception);
+
+    /**
+     * Set the given integer array to values in the given buffer.
+     */
+    void setIntArray(const char* name, const int32_t* values, size_t length,
+                     size_t offset = 0) throw(Exception);
+
+    /**
+     * Set the given byte array to values in the given buffer.
+     */
+    void setByteArray(const char* name, const uint8_t* values, size_t length,
+                      size_t offset = 0) throw(Exception);
+
+    /**
+     * Set the given string to the given value. Since strings are byte
+     * arrays, and the bytes after the string should be zeroed, the
+     * length must be given. The string will be converted to a byte
+     * array of the given length, padded with 0s.
+     */
+    void setString(const char* name, const char* value, size_t length,
+                   size_t offset = 0) throw(Exception);
+
 private:
     /**
@@ -237,4 +264,10 @@
      */
     void setScalar(const char* name, uint8_t type) throw(Exception);
+
+    /**
+     * Issue the command to set an array value of the given type.
+     */
+    void setArray(const char* name, uint8_t type, size_t length,
+                  size_t offset) throw(Exception);
 };
 
Index: test/basictest.cc
===================================================================
--- test/basictest.cc	(revision 17)
+++ test/basictest.cc	(revision 18)
@@ -32,4 +32,5 @@
 
 #include <cstdio>
+#include <cstring>
 
 //------------------------------------------------------------------------------
@@ -145,10 +146,82 @@
         printf("The aircraft elevator up control set to %f\n\n", acfElevUp);
 
-        double acfElevDown = xplane.getDouble("sim/flightmodel/position/local_x");
-        printf("Setting the aircraft elevator down control from %f to %f...\n",
-               acfElevDown, acfElevDown + 15.0);
-        xplane.setDouble("sim/flightmodel/position/local_x", acfElevDown + 15.0);
-        acfElevDown = xplane.getDouble("sim/flightmodel/position/local_x");
-        printf("The aircraft elevator down control set to %f\n\n", acfElevDown);
+        double localX = xplane.getDouble("sim/flightmodel/position/local_x");
+        printf("Setting the aircraft's local X-coordinate from %f to %f...\n",
+               localX, localX + 15.0);
+        xplane.setDouble("sim/flightmodel/position/local_x", localX + 15.0);
+        localX = xplane.getDouble("sim/flightmodel/position/local_x");
+        printf("The aircraft's local X-coordinate set to %f\n\n", localX);
+
+        float numBlades[8];
+        length = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades",
+                                      numBlades, sizeof(numBlades)/sizeof(numBlades[0]));
+
+        printf("Setting the number of blades\n    from:");
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %f", numBlades[i]);
+        }
+        printf("\n    to:");
+        for(size_t i = 0; i<length; ++i) {
+            numBlades[i] += 2.5;
+            if (i>0) printf(",");
+            printf(" %f", numBlades[i]);
+        }
+        printf("\n");
+        xplane.setFloatArray("sim/aircraft/prop/acf_num_blades",
+                             numBlades, length);
+        length = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades",
+                                      numBlades, sizeof(numBlades)/sizeof(numBlades[0]));
+        printf("The result:");
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %f", numBlades[i]);
+        }
+        printf("\n\n");
+
+        int32_t batteryArrayOn[8];
+        length = xplane.getIntArray("sim/cockpit/electrical/battery_array_on",
+                                    batteryArrayOn,
+                                    sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]));
+
+        printf("Setting the batteries\n    from:");
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %d", batteryArrayOn[i]);
+        }
+        printf("\n    to:");
+        for(size_t i = 0; i<length; ++i) {
+            batteryArrayOn[i] = !batteryArrayOn[i];
+            numBlades[i] += 2.5;
+            if (i>0) printf(",");
+            printf(" %d", batteryArrayOn[i]);
+        }
+        printf("\n");
+        xplane.setIntArray("sim/cockpit/electrical/battery_array_on",
+                           batteryArrayOn, length);
+        length = xplane.getIntArray("sim/cockpit/electrical/battery_array_on",
+                                    batteryArrayOn,
+                                    sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]));
+        printf("The result:");
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %d", batteryArrayOn[i]);
+        }
+        printf("\n\n");
+
+        uint8_t tailNum[40];
+        memset(tailNum, 0, sizeof(tailNum));
+        strcpy(reinterpret_cast<char*>(tailNum), "HA-VAI");
+        printf("Setting the tail number to %s as a byte array...\n", tailNum);
+        xplane.setByteArray("sim/aircraft/view/acf_tailnum",
+                            tailNum, sizeof(tailNum));
+        printf("The tail number is: '%s'\n\n",
+               xplane.getString("sim/aircraft/view/acf_tailnum").c_str());
+
+        static const char* tailNum1 = "VAI";
+        printf("Setting the tail number to %s as a string...\n", tailNum1);
+        xplane.setString("sim/aircraft/view/acf_tailnum", tailNum1, 40);
+        printf("The tail number is: '%s'\n\n",
+               xplane.getString("sim/aircraft/view/acf_tailnum").c_str());
 
         try {
