Set a threshold of the binary level by the average of the measurement result

Set a threshold of the binary level by the average of the measurement result.
refMacro Sample:Set a threshold of the binary level by the average of the measurement result