function machineId = get_relevant_machine
   global gMachineInfo
   
   if(gMachineInfo.mainMachineId ~= 0)
      machineId = gMachineInfo.mainMachineId;
   else 
      machineId = gMachineInfo.machineId;
   end
   