Context : Aims : We have studied the emission of CO ro-vibrational lines in the disc around the Herbig Be star HD100546 to determine physical properties , disc asymmetries , the CO excitation mechanism , and the spatial extent of the emission , with the final goal of using the CO ro-vibrational lines as a diagnostic to understand inner disc structure in the context of planet formation . Methods : High-spectral-resolution infrared spectra of CO ro-vibrational emission at eight different position angles were taken with CRIRES ( CRyogenic high-resolution InfraRed Echelle Spectrograph ) at the VLT ( Very Large Telescope ) . From these spectra flux tables , line profiles for individual CO ro-vibrational transitions , co-added line profiles , and population diagrams were produced . We have investigated variations in the line profile shapes and line strengths as a function of slit position angle . We used the thermo-chemical disc modelling code ProDiMo based on the chemistry , radiation field , and temperature structure of a previously published model for HD100546 . We calculated line fluxes and profiles for the whole set of observed CO ro-vibrational transitions using a large CO model molecule that includes the lowest two electronic states , each with 7 vibrational levels and within them 60 rotational levels . Comparing observations and the model , we investigated the possibility of disc asymmetries , the excitation mechanism ( UV fluorescence ) , the geometry , and physical conditions of the inner disc . Results : The observed CO ro-vibrational lines are largely emitted from the inner rim of the outer disc at 10-13 AU . The line shapes are similar for all v levels and line fluxes from all vibrational levels vary only within one order of magnitude . All line profile asymmetries and variations can be explained with a symmetric disc model to which a slit correction and pointing offset is applied . Because the angular size of the CO emitting region ( 10-13 AU ) and the slit width are comparable the line profiles are very sensitive to the placing of the slit . The model reproduces the line shapes and the fluxes of the v=1-0 lines as well as the spatial extent of the CO ro-vibrational emission . It does not reproduce the observed band ratios of 0.5-0.2 with higher vibrational bands . We find that lower gas volume densities at the surface of the inner rim of the outer disc can make the fluorescence pumping more efficient and reproduce the observed band ratios . Conclusions :