Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx access interface

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 

0 Kudos
Message 1 of 12
(3,934 Views)

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... 

0 Kudos
Message 2 of 12
(3,925 Views)

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! 

0 Kudos
Message 3 of 12
(3,905 Views)
Hi Dariusz, I found the KB on the ni.com, where is described the reasons, that can cause your problem. http://digital.ni.com/public.nsf/allkb/04BEDD9E9E91ED3486256D180048116D?OpenDocument I found some more information, that could helped:It is not possible to have multiple DAQmx tasks attempting to access the same physical device. Thus it is necessary to clear each task after the data acquisition has completed. You have to configure one multiple channel task.For example:Concurrently running two analog input or two analog output tasks.  This error can also be thrown when a program explicitly calls multiple tasks performing the same type of operation at the same time. As with the other two cases, this produces a situation where multiple independent tasks are concurrently attempting to access the same resource. Even though the tasks might be using different channels, this is still a conflict because they require use of the same analog to digital converter and sample clock. To resolve this issue, combine all operations of the same type into the same task. For DAQmx 7.3 and later, it is possible to do this even with multiple types of analog input if you use multiple DAQmx Create Channel VIs.Regards,Jiri KeprtJiří Keprt | Application Engineer

CLA, CTA

0 Kudos
Message 4 of 12
(3,887 Views)

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...  

0 Kudos
Message 5 of 12
(3,885 Views)

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

0 Kudos
Message 6 of 12
(3,870 Views)