07-24-2006
04:37 AM
- last edited on
10-21-2025
11:59 AM
by
Content Cleaner
Hello,
I'm trying to program my NI-USB 6008 with The Mathworks MatLab. On this site, I found a very useful toolbox, called NI-DAQmx tools for MatLab.
http://zone.ni.com/devzone/conceptd.nsf/webmain/f7312fdfe627eed186257139001eca49
All functions work perfectly, with one notable exception : I can't manage using analog outputs.
My needs are very simple : I need to set a single voltage on one of the outputs, then return control to my MatLab application and keep the value as set.
Although it's not exactly what I'm trying to do, I tried the function "GenNUpdates", which is supposed to send to the AO an array of data at a fixed rate.
Unfortunately, it doesn't work, I get the following error :
??? Error using ==> GenNUpdates
Error -200452 occurred at Property Node DAQmx Timing (arg 1) in MEXToolkit_Generate N Updates.vi->Generate N Updates.vi->858990635368GenNUpdates_nonUI.vi->858990635368GenNUpdates_nonUI.vi.ProxyCaller
Possible reason(s):
Specified property is not supported by the device or is not applicable to the task.
Property: SampClk.Rate
Task Name: _unnamedTask<DC1>
Curiously, the same function seems to work properly using another card (a PCMCIA NI 6024E).
On the other hand, in the toolbox, there are also demos with a user interface.
When I run the demo called GenNUPdates_UI, I get a control panel which seems to correspond to a simpler function : you enter a single value with a cursor, and obviously there is no rate to enter. This works perfectly with the USB-6008, and I actually don't need anything more. But of course, I can't use it with the user interface, I need to access the underlying function.
So my question is double :
1. Is there a way to make the non-UI function work with the USB-6008, and set its rate to 0 Hz to get a single DC value ?
2. If not, is there a way to strip the UI-demo from its user interface and use it from the MatLab code ?
Thanks a lot for your help in anticipation,
Jean-Louis
08-08-2006 07:18 AM
Hello Jean-Louis,
You are getting this error because you try to use a hardware-timed task for the USB-6008, which is not supported by this device, only software-timing.
Sorry, but i'm not familiar with the DAQmx Tools for MatLab, but there must be another function using software-timing for AO, and using this one it
should be possible to set the frequency to 0.
Hope this helps a little bit, Christian
01-10-2007 07:54 PM
01-11-2007 07:01 AM
01-21-2007 06:50 PM