question about signal data type

Making & changing hardware drivers in Acquisition Server
Post Reply
Amélie
Posts: 13
Joined: Wed Nov 24, 2010 3:47 pm

question about signal data type

Post by Amélie »

Hello,

I am developping a driver and I just encountered something curious :
in the Designer, the type of signal samples is float64, so I though no precision would be lost if the driver acquires double precision data.
But in the driver, the buffer that has to be filled with these samples and sent to the callback function contains float32 samples.
I'm not sure but it seems to me that samples are cast from float32 to float64 in ovpCGenericNetworkAcquisition.cpp.
Why this choice ? If a simple precision is enough, why are samples transformed into float64 in the Designer ?

Thank you,
Amélie

jlegeny
Posts: 239
Joined: Tue Nov 02, 2010 8:51 am
Location: Mensia Technologies Paris FR
Contact:

Re: question about signal data type

Post by jlegeny »

Hello Amélie,

Since I have not yet developed a driver my answer might be imprecise but I suppose that different acquisition devices use different precision for the data they read from the hardware. As the designer has to be compatible with all of them (and hopefully those in the future as well, provided someone develops a driver) it has to work with the maximal precision. The drivers themselves can simply use the precision of the device.

Best regards
Jozef

Amélie
Posts: 13
Joined: Wed Nov 24, 2010 3:47 pm

Re: question about signal data type

Post by Amélie »

Hello Jozef

I agree with you, it's great that the designer allows double precision. But my acquisition device also provides double precision data, and this precision is lost in the driver, which requires simple precision data. This is what I do not understand.

Best regards,
Amélie

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: question about signal data type

Post by yrenard »

Dear Amelie,

the reason is that the data going from acquisition server to designer uses TCP connection which possibly occurs on different machines and even more on distant machines. So it has been considered that 32 bits floats would be enough for acquisition as this would reduce the network stress a half. Getting back to the designer, the successive operations that occur in the different boxes can hurt the precision so it has been considered that 64 bits floats would be better. This data transmission is only local and does not stress much on the transport layer.

Hope this answers your questions :)
Yann

Amélie
Posts: 13
Joined: Wed Nov 24, 2010 3:47 pm

Re: question about signal data type

Post by Amélie »

I found it was a strange choice, now I understand.

Thank You Yann !

Post Reply