Discussion:
How do I generate two different waveforms simultaneously at Ao0 and Ao1 of DAQ6259?
(too old to reply)
Robert Mensah
2008-08-07 15:10:10 UTC
Permalink
Hello,
 
I am using winXP, CVI8.5.1, DAQ6259 and a modified waveform generation sample code which comes with CVI. 
I have two different tasks. Task1 generates 50Hz sine wave at Ao0. Task2 generates 30Hz triangle waveform at Ao1. The two tasks work well independently. However, I want to generate both waveforms simultaneously.
a)   When I execute Task0 first, it generates the 50Hz sine wave.
b)   Then, when I execute Task1, I get   "Non Fatal run-time error, ...  Task Name: _<unamed Task<1> ...  resources reserved ... Status code -50103."
in the same way

a)   When I execute Task1 first, it generates the 30Hz triangular wave.
b)   Then, when I execute Task0, I get   "Non Fatal run-time error, ...  Task Name: _<unamed Task<1> ...  resources reserved ... Status code -50103."
I use two different tasks and two different functions(with differerent variable names)in my code to make sure I do not use the same resources. My questions are:
1)   Does DAQ card 6259 have the capability to generate two waveforms simultaneously?
2)   If  1)  is yes, how do you implement it? 
3)   Is there a sample code somewhere which demonstrates this?
 
Thank you.
Robert.
James McN
2008-08-07 17:10:08 UTC
Permalink
Hi Robert,
I'm afraid it does not.  Your card runs all of the analogue outputs off of the same clock which gets configured per task.  This is why you are getting this error.  You must group all similar processes into a single task e.g. all analogue outputs/inputs.
This does not mean you cannot do this but what it does mean is that both outputs must be done from the same sample clock and so at the same rate.  Therefore if you ensure you generate the signals correctly programmatically e.g. so the conform to the equation signal frequency = (no. cycles x rate)/size of buffer.
I hope this helps.
Regards,
Robert Mensah
2008-08-07 22:10:09 UTC
Permalink
Thanks for the response. I now understand why my code does not work. Is there any DAQ card with two clocks which can generate two different waveforms simultaneously?
Robert
James McN
2008-08-08 12:40:08 UTC
Permalink
Hi Robert,
Unfortunately our standard multifunction DAQ cards all work on the same principal.  I wondered why it was that you wanted to use a hardware solution to this rather than a software solution?  If it really must be done in seperate tasks then the best solution would probably be to fit an additional analogue output card and have a dedicated card for each. 
Just to demonstrate the software approach though I have produced some example code which I have attached demonstrating how your application could work under a single task using your current hardware set up.
Let me know what you think.


DAQmx Example.zip:
http://forums.ni.com/attachments/ni/250/42192/1/DAQmx Example.zip
Robert Mensah
2008-08-11 15:40:09 UTC
Permalink
Hello James Mc,
The DAQmx Example.zip that you provided is actually an example of using the DMM to take measurement. The question I was asking is generating two different analog waveforms simultaneously at DAQ Ao0 and Ao1. Your help would still be appreciated. Thank you.
Robert 
James McN
2008-08-11 17:10:10 UTC
Permalink
Hi Robert,
 
I have just tested the program again on my machine and it does seem to be producing the desired effect although there was an error in the number of samples per channel in the analog write which I have corrected in the new source file attached.  I am running this with an E-series card as Dev1.  If you have another card in Dev1 this could be why it is not working for you but if you look at the code it is using 2 DAQmx analog out channels will only one task configured.
 
Regards,


DAQmx Example_v2.c:
http://forums.ni.com/attachments/ni/250/42229/1/DAQmx Example_v2.c
Loading...