Материал из Module developer
Перейти к: навигация, поиск
// Get the unique module and bus identifiers at launch
 IR.AddListener(IR.EVENT_MODULE_START, 0, function(moduleID, busID){
   // Getting the module instance 	
   // moduleID - the unique module identifier 
   // Assigning to the variable  module
   var module = B.getModule(moduleID);
   // Form the subnet name and assign it to the variable netWorkName
   var netWorkName = "HDL-BUS Pro Network (UDP)" + '''busID'''; 
   // Take the available device and assign it to the variable ''device'' 
   var device = IR.GetDevice(netWorkName); 
   // Create a new SubDevice with properties:
   // Device - the driver object of the iRidium device
   // The name of the created SubDevice which will be used to referring to it. It will be seen by the user
   var NewSubDevice = module.addSubDevice({
       Device: "device",
       DeviceName: "HDL Dimmer 1"
    });
 });