• 0
dpekin

Waveform SDK FDwfAnalogInStatusData16not working in c#?

Question

Hello,  

I wrote a quick program in C++ to verify operation of the Analog Discovery2 A/D acquisition for a project starting up.  It seem to work correctly and the results are what I expect.

I then wrote that same code flow in a C# application.  The C++ to C# conversion was simple and the program compiled and ran.  Unfortunately, the FDwfAnalogInStatusData16 function did not fill the ushort array that was passed it as it did in the C++ flow.  The c# ushort array to be filled that passed to the function was not touched.  I then changed the code to retrieve doubles rather than the raw ushorts and it works as expected.

            n = dwf.FDwfAnalogInStatusData16(hdwf, 0, m_ushort_buf, 0, NUMSAMPLES);    <-- This does not work
            n = dwf.FDwfAnalogInStatusData(hdwf, 0, m_double_buf,  NUMSAMPLES);      <-- This does work

 

So, it appears to me that the C# wrapper provided in the SDK does not work for the FDwfAnalogInStatusData16 function call.   Has anyone encountered this?  Is there an updated dwf.cs file that remedies this bug?

I'm running version 3.10.9 of the Waveforms program. 

Thank you,

 

- Dave
 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @dpekin

There was a mistake in the C# wrapper. The data16 function was actually calling the data-double function.
It is corrected in this wrapper: dwf.cs

Thank you for the observation.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now