Below is an extract of code : (the problem is visible by testing only this extract)
let cptIdCO = ref 0;; (* compteur : id