Sending RDM commands via e:script

This script shows how to reset a device via RDM to factory settings. All you have to know is the RDM address of the device, you don’t have to know the port or controller to which the device is connected, as the the reset command is sent via all ports that support RDM. And you don’t have to activate RDM. This is an easy and simple way to reset a device without a former RDM discovery. Even devices not answering to discovery requests can be reset. This is the procedure:

After declaring and initialising the necessary variables, an iteration run is executes over all controllers and corresponding ports. This includes ports that have no activated RDM. The key function here is SendRdmRequestByController.

// RDM reset script by Till Wiebke
// Traxon Technologies Europe, Paderborn
int controller = 0;
int port = 0;
int success = 0;

// Unique RDM ID of the target device.
string target = "4845:000002C6";
// The binary object block is needed for the custom RDM request.
int bobHandle = BobAllocate(0);

for (controller = 0; controller < GetRdmControllerCount(); 
                                                    controller++)
{
   for (port = 0; 
        port < GetRdmControllerPortCountByController(controller);
                 port++)
   {
      // Enable the controller if necessary.
      success = RdmPortIsEnabledByController(controller, port);
      if (0 == success)
      {
         success = RdmPortEnableByController(controller, port);
      }
      if (1 == success)
      {
         // Sending a "factory reset" (0x0090) 
         // set-request (0x30) to the root-device (0).
         printf("FACTORY_DEFAULTS to %s, controller %d,port %d.\n",
                                         target, controller, port);
         SendRdmRequestByController(controller, port, target, 
                                    0, 0x30, 0x0090, 0, bobHandle);
       }
   }
}
printf("Done.\n");

Leave a Reply

Your email address will not be published. Required fields are marked *