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");

Autotext and RDM

One of the most helpful features in the Programmer is Autotext. But what is Autotext?

An ancient feature

Autotext was implemented in a rather early version of the Programmer and realizes access to internal data and parameters of the Programmer. This can be system time and date, astronomical times like sunset or twilight, even network parameters, cuelist parameters or Versatile Master names and values. The most prominent use of Autotext  is in the Action Pad. In a textfield, for example, use the expression <nicetime %X> and the Programmer will substitute this expression with the systemtime. <master 1 name> will show the name of the Versatile Master #1. A complete list of Autotext parameters can be found in the LAS Advanced System Manual, for free download from the Traxon or e:cue website.

The next big step

With LAS 6.1 it is possible now to access the RDM subsystem of the Programmer as Autotext. In this way you can show fixture data like lamp lifetime, up-time and all other RDM values and parameters in the Action Pad. And these are not static values, but updated all the time while the fixture runs RDM communication. The best way to see this is to watch the RDM timestamp of a fixture. To insert RDM Autotext in a textfield is very simple, because there is an interactive method to do this. You can, but you must not create the Autotext by hand.

Autotext sources

Autotext sources

In the Action Pad create a textfield. Double-click the created field or select Properties from the element’s context menu (right mouse button). The properties dialog has a button for Autotext. Clicking the button, a subselection gets displayed where you can choose the Autotext source. Here you can see the many sources to Autotext. For RDM select RDM and Create RDM Autotext. The RDM Autotext dialog opens.

RDM parameter dialog

RDM parameter dialog

In the RDM dialog you now can select the fixture and subdevice, as well as what sensor or parameter will be used. Click the varoius areas in the dialog to define the Autotext source from the RDM vaue stream, the click OK.

This will insert the proper Autotext definition in the textfield of the Action Pad.

Do not forget to enable Autotext substitution for the field in the element properties of the field. Otherwise you will only see the Autotext definition instead of the real value.

Action Pad and RDM

Action Pad and RDM

That’s all. You now have dynamic, realtime RDM data in your Action Pad page.

A complete description of RDM and Autotext is in the LAS Advanced System Manual for the LAS 6.1, available in the product page for the LAS in the Traxon website, and a complete description of the LAS as LAS System Manual (after release of LAS 6.1, of course).

Reading RDM with e:script

RDM (Remote Device Management) is a remote management protocol on top of DMX and allows bidirectional communication with fixtures. You can read system values and status, and depending on the type of fixture you can set DMX addresses and other parameters. The Programmer of the Lighting Application Suite has a complete implementation of ANSI E1.20, Remote Device Management on board. With the coming LAS 6.1 you can read RDM values in fixtures and use them as Autotext (similar to time, astronomical times, system parameters) in the Action Pad.

You can also use the RDM API in the Programmer in e:script, which allows very flexible and custom-specific functions. Here is an example script how the RDM API can be used to check fixture temperatures.

// --------------------------------
// checkTemperature script comment
// --------------------------------

int sensorId = 7; // id of temperature sensor
int temperatureMax = 80000; 
              // commonly given in m°C so 80000 is 80°C
string deviceId;
int li = CreateRdmDeviceList();
int deviceCount = GetRdmDeviceCount(li);

// iterate all rdm devices
int i;
for (i = 0; i < deviceCount; i++)
{
     deviceId = GetRdmDeviceId(li, i);
     printf("deviceId = %s\n", deviceId);
     checkTemperature(deviceId);
}
DestroyRdmDeviceList(li);

// checks if temperature value from sensor 
// is within allowed range
function checkTemperature(string deviceId)
{
     int t = GetRdmSensorValue(deviceId, sensorId);
     printf(" %s %d\n", deviceId, t);
     if (t > temperatureMax)
     {
          // do something if temperature too high
          alert("Warning: temperature of device %s is > %d!\n", 
                                   deviceId, temperatureMax);
     }
}