After some pfaffing aboit I now managed to have correct readings from the height sensor.
First at all ACM engineer has ordered a different type of height sensor. X4 lanes on production line all x4 using 4-20ma signals.
So reading into Tom's comment that sensor is reading at 220mm a far too high object with a value of 32767 I've gone through the sensor technical manual documemtation and compared them all. It turned out the sensor ordered was a 0-10v sensor. Better communication should be no.1 in our agenda.
Anyway changed then analogue card configuration from current input to voltage input and there you go values been suddenly where showing around 18800 on an empty conveyor.
Following the code ilustrated by Tom 220mm-50mm or 0-170mm and this divided by 18800-0 was giving a slope of near about 0.0090...
Then left offset was 170mm as its 170-(0×slope).
Done the scaling with the raw input and there you go readings where correct or near about. According to the sensors specs there is still an opportunity to teach 2 analogue meassurement point to narrow down the range of reading giving better accuracy.
I think I was going wrong with scaled max considered as the maximum range of the sensor (350mm) and scaled minumum as 50mm according to the sensors specs.
Could had been left with the option I mentioned before only if the sensor were to be fitted 350mm above the conveyor surface.
Anyway it was a good help and appreciate it. This site worth the money