I moved the cast laster to the call to WaitForData. It migh be possible to use float all the way up but I thing we get some times as double from opc-ua so we need a cast somewhere