function CameraON(deviceName)

javaMethod('setProperty', 'java.lang.System', 'cmw.names', 'abcmw.cern.ch:5020');
rda = cern.cmw.rda.client.RDAService.init();
cycle = 'SCT:USER:SETUP';
device = rda.getDeviceHandle(deviceName);


ExpertSettingProp='ExpertSetting';
ExpertSettingFields=device.get(ExpertSettingProp,cycle);

xmin=ExpertSettingFields.extractShort('windowOriginX_min');
xmax=ExpertSettingFields.extractShort('windowSizeX_max');
xact=ExpertSettingFields.extractShort('windowSizeX');
ymin=ExpertSettingFields.extractShort('windowOriginY_min');
ymax=ExpertSettingFields.extractShort('windowSizeY_max');
yact=ExpertSettingFields.extractShort('windowSizeY');

%ExpertSettingFields.insert('windowOriginX',int16(xmin+7));
%ExpertSettingFields.insert('windowSizeX',int16(xmax-7));
%ExpertSettingFields.insert('windowOriginY',int16(ymin+11));
%ExpertSettingFields.insert('windowSizeY',int16(ymax-11));


ExpertSettingFields.insert('cameraSwitch',int32(3));
ExpertSettingFields.insert('alwaysAcquire',logical(1));
ExpertSettingFields.insert('startAcquisition',logical(1));

device.set(ExpertSettingProp,cycle,ExpertSettingFields);


ExpertSettingFields=device.get(ExpertSettingProp,cycle);

aa = ExpertSettingFields.extractBoolean('alwaysAcquire');
sa = ExpertSettingFields.extractBoolean('startAcquisition');

fprintf(1,'Camera %s: alwaysAcquire=%d  startAcquisition=%d\n',deviceName,aa,sa);

