Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

capture single channel in c++

Hi,

I'm trying to write a simple C++ routing (Visual C++) using the NIDSA functions that generates a sine wave and captures the response data.

I can generate a sine wave using NIDSA_configure_source(), but I can't figure out how to get the response data.
I tried calling NIDSA_configure_capture_buffer() and then NIDSA_read_capture_single_chan() but then I get an "Unknown Error" from NIDSA_read_capture_single_chan(). (Error code = 0xffffd5d0)

Sample Code:
rc = NI4551_ConfigureSource(1,0);

// configure capture buffer
rc = NI4551_ConfigureCaptureBuffer(numMeasurements);

// read single channel
rc = NI4551_ReadSingleChannel("0", numMeasurements, pResult);

rc = NI4551_ConfigureSource(0,0);

I don't know if I've got the correct functions to generate the sine wave and capture data or if I'm even calling them in the correct order.

Is there any sample code out there??

Thanks!
0 Kudos
Message 1 of 2
(6,173 Views)
Hello,

You have specified a resource descriptor for the source task but when you are calling the capture commands you have not set up an initialize function that tells the program what board to use. For instance try using the NIDSA_init and then use that session to pass to the other function calls such as NIDSA_configure_capture_buffer() etc. I have attached some example code that reads from the board and demonstrates the analog triggering capabilities of the board. I hope this helps. Please let me know if you have any questions after exploring these resources.

Regards,

Shea C
Applications
NI
0 Kudos
Message 2 of 2
(6,151 Views)