Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog generation using USB-6259 with native C

Solved!
Go to solution

Hi,

 

I have been developing some kind of access library (with unified interface for all type of tasks) for 6259 device and I don't know how to generate analog voltage (other signals probably too) the way I want. I can generate finite or continous signals but only with specified samples buffer (the signal is then very periodical). My intention is to use everyNSamplesEvent to change the buffer content so I can generate easily user defined signals. I noticed that the buffer changing is well performed when the task is stopped. But I don't want to stop the task to exchange the buffer content. How can I do this? 

0 Kudos
Message 1 of 6
(3,573 Views)

Hello again,

I know that this issue may not be the easiest thing to do, but this forum exists for NI experts to share the knowledge and experience with others users of NI products. That's why leaving the thread without any answer is bad idea, cause it shows that even NI experts don't know the solution. The better way is to reply that the problem is impossible to solve in case of any hardware limitation than no response at all.

I still don't know the solution for my problem so I am waiting for someone to guide me within this area. 

0 Kudos
Message 2 of 6
(3,554 Views)
Solution
Accepted by topic author DBoczkowski
Hi,

Are you developing this application using Measurement Studio or using LabWindows CVI?
Can you please tell me which version of DAQmx driver are you using?

You can check this example if you are using LabWindows CVI.
http://zone.ni.com/devzone/cda/epd/p/id/1733

As I understand you wish to perform a non regenerated output.
Please let me know your status.


Regards.
Message Edited by sebastianbratescu on 11-20-2008 10:04 AM
0 Kudos
Message 3 of 6
(3,528 Views)

Sebastian, sebastianbratescu

 

Thanks for your reply.

 

I am developing without any development environment for NI device - just Visual Studio and use only native C API. I have got NI-DAQmx 8.7.1 driver installed.

 

My intention is to achieve dynamicaly changing analog generation without stopping a task. The most convienient way would be to get a callback after generating N (buffer size) samples and to exchange buffer data within this callback to allow generation newly defined signal.

 

Best regards,

Dariusz Boczkowski 

0 Kudos
Message 4 of 6
(3,509 Views)

Hello Dariusz,

A function that you might find useful is the DAQmxRegisterEveryNSamplesEvent. Information about this function can be found in the NI-DAQmx C Reference Help under NI-DAQmx C Functions»Task Configuration/Control»Events»DAQmxRegisterEveryNSamplesEvent.

The purpose from the help file:

"Registers a callback function to receive an event when the specified number of samples is written from the device to the buffer or from the buffer to the device. This function only works with devices that support buffered tasks."

Regards,
Dan King

0 Kudos
Message 5 of 6
(3,477 Views)

Hello,

Thank you for an answer. I have been using this method since some time and it works very weel to my purpose. The point of was to generate dynamically changing signal with using everyNSamplesEvent callback. The solution is of course non regenerated output.  

0 Kudos
Message 6 of 6
(3,450 Views)