10-02-2009 10:11 AM
Hello,
is it possible to create a task that can be used for PWM output and setting of digitals outputs at the same time?
I have a NI-USB 6210 that provides two counters and additional digital outputs.
I have already implemented some code that generates PWM signals on both counters.
At all, I have created one task, containing both counters and I am able to set the duty cycle by using DAQmxWriteCtrFreq.
Now, I also want to write the digital outputs.
I first tried to create a second task that handles the outputs, but I got an error (sorry, forgot the error number) that says that the task can not be created because the digital output resource is already in use (by the PWM task).
Therefore, I think that I have to add the digital output channels to my PWM task, so that there is only one task that handles all my digital signals (counter and bits).
Am I right here or not?
Furthermore, if I am right, how can I set the digital outputs?
Maybe DAQmxWriteDigitalLines is the correct line but how can I tell this function, which channels should be set?
Any help is appreciated.
Thank you.
Christian
10-09-2009 07:39 AM
Hi CristianEC,
i think the error number was -200022, because the PFI lines for the two PWM counter look all your digital ports.
You can see this if you look on into the pinout for your device. You need an device with some additional digital ports.