10-10-2008 01:57 AM
Hello,
After getting to know that developing in C++ without Measurement Studio is possible I am facing the problem of creating access interface to NI USB-6259 device. Does anybody have similar experience? I am thinking of making dynamic link library (dll) that will provide such interface to control this device. Some kind of task manager will be required but dividing taks into class tree seems to be kind a tricky. Any help is appreciated.
Regards,
Dariusz Boczkowski
10-10-2008 06:36 AM
Well, please clear some of confusions that created after checking the possibilities of USB-6259:
1) Is it possible to run any two task simultaneusly on the device? From my small experience it's not possible but duplicating the same taks might not be an answer.
2) When I try to do 1) I get an error -50103: The specified resource is reserved. The operation could not be completed as specified. How to interpret this error.
It might a little bit difficult to develop access library with at least most functionalities of the DAQmx driver...
10-13-2008 04:11 AM
Ok, I found out what is the problem with this error. But it revealed some limitation of using the USB-6259 device. I would like to create an environment with the possiblity of defining any task and running them at any time. But each task could be launched separately. Is it possible? Right now my knowledge is this won't be able. If so what kind of task types can not be run simultanously or where to find such information? Just to implement some kind of scheduling in the library....
Thanks in advance!
10-14-2008 02:27 AM
CLA, CTA
10-14-2008 02:40 AM
Thanks for reply!
I had already read the article in KB you have provided me. I know the problem is when more than one task uses the same resource in the device. I would rather get to know how to manage the task (of any type) that can occur at any time.Unreasonable is to stop one channel then add next one and run multiple channel task again. A cannot assure that these tasks will show up in the same time to organise them into one multichannel task. So far the only way I can see is to queue the tasks of the same type...
10-14-2008 06:34 AM
Hi Dariusz,
I am afraid, that there is not easy way how to manage the application with task that can occure in any time on any channel.
Unreasonable is to stop one channel then add next one and run multiple channel task again - this is exactly behaviour of the drivers. Because you are using the multiplexed M series card, the driver according to number of channel sets up
the multiplexer and the transfer of the data. So I think, that from the basis of the driver and multiplexer you are not able to add another channel to running channel. If you need this behaviour, you may use the simultaneous sampling card.
The solutions with the queue of aggregation of similar tasks could be the way, but it still supposes, the you will start those tasks in the same time or you must stop running task and reorganize to new multichannel task.
Regards,
Jiri
Jiří Keprt | Application Engineer
CLA, CTA
10-20-2008 03:44 AM
Ok, I agreed I must manage the limitation with using simultanous tasks, but which function of DAQmx C provide channel combining? I have found only DAQmxCreateTEDS function group. Is this the only way? What about adding digital channel to analog one?
Best regards.
10-20-2008 06:38 AM
Hi Dariusz,
here are some examples in CVI, that documents your problem. The first example shows how to acquire data from multiple channels.
http://zone.ni.com/devzone/cda/epd/p/id/5021
http://zone.ni.com/devzone/cda/epd/p/id/4801
You can run this example and select more than one channel to measure.
You can create the task for AI for more than one channel for example:
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk DAQmxCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
This example shows how to create more the one task on one device and start it simultaneously
http://zone.ni.com/devzone/cda/epd/p/id/2333
You can run more than one task on one device, but the task must be of different type. It is shown in the example.
(For example you can run analog input task and analog output task on one device, but you can’t run two analog input tasks on one device).
So you have to manage it and aggregate it per task type (f.e. analog input).
Regards
Jiri
CLA, CTA
10-20-2008 06:43 AM
10-20-2008 08:35 AM
Hi Dariusz,
the links in my browser works fine. Anyway you can find the according the name in the search window.
http://zone.ni.com/devzone/cda/epd/p/id/5021
http://zone.ni.com/devzone/cda/epd/p/id/4801
http://zone.ni.com/devzone/cda/epd/p/id/2333
DAQmx - Simultaneously Started Analog Input and Output using CVI
Jiri
CLA, CTA