//implementation following this protocol : https://www.epiphan.com/userguides/LUMiO12x/Content/UserGuides/PTZ/3-operation/VISCAcommands.htm#InquiryCommands // var parameterPath = local.parameters; // var valuesPath = local.values; var ZoomPos = script.addFloatParameter("Zoom Position", "", 0., 0., 1.); // var state = var inquiry = ['CAM_ZoomPosInq', 'CAM_FocusModeInq', 'CAM_FocusPosInq']; var camID = 1; var waitTaskComplete = 0 ; var currentInquiry = ''; /////////// HELPERS FUNCTIONS //////////////// function printArray(name, array){ var printHeader = ' '+name+' : '; if (array.length){for(var i=0; i " + parseInt((""+data[i]),16)); // } //fill buffer with bytes until you find a 255 for (var i = 0 ; i " +data[i]); } } script.log(msg); } //inquiry answers else if (buffer[1]==80){//0x50 if(currentInquiry == 'CAM_ZoomPosInq'){ var position = buffer[2]*4096 + buffer[3]*256 + buffer[4]*16 + buffer[5]; printArray("zoom position :", buffer); script.log(position); ZoomPos.set(position/16384.); } //free inquiry slot currentInquiry = ''; } else{printArray("unknown answer :", buffer);} } bufferIndex = 0; buffer=[]; } } //then process buffer }