Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Use M-Series cards with DAQmx in Matlab!

Was refering to the original topic.
0 Kudos
Message 21 of 106
(5,263 Views)
the topic is the configuration of fpga and simulationInterface  from matlab 
0 Kudos
Message 22 of 106
(5,252 Views)
As there still seems to be interest on how to work with PCI NI cards and Matlab 7.0, here is my code from last year.
I didnt use it since then, but it should still work.
It triggers a flash and then ADs 8 detector signals into an array.

Back then Matlab didnt support those cards, maybe that changed,
I dont know. Maybe there are way better functions and libs out there now.

Also I am a amateur programmer, so dont be hard on me. Its a quick and dirty fix. And use Jens steps exactly as described before.
Matlab 6 doesnt work, that I found out last year already.

I cant run the program as I dont have the card anymore installed....

Wendelin
0 Kudos
Message 23 of 106
(5,252 Views)
Hi Wendelin!

Thanks for providing more code samples!
Indeed, Matlab now supports NIDAQmx via the DAQ toolbox, but certain functions like RTSI snychronization are not accessible with it.

You say that your code does not work with Matlab 6. This is a bit surprising. Matlab 6 does not natively support dll import, but you can use this great tool:
http://www.codeproject.com/dll/MatlabGenericDll.asp?df=100&forumid=26247&exp=0&select=972623
to do so. At least I was/am able to access NIDAQmx with Matlab 6.5 through 2006b.

Cheers
Jens


Befaiz,
I'm sorry, but noone here seems to be fluent in the R-series technology, certainly not me. Do these specialized cards have their own forum? As I said, I doubt you can bypass the FPGA interface of National Instruments via NIDAQmx communication, but I might be wrong.

Cheers
Jens

0 Kudos
Message 24 of 106
(5,241 Views)
Hi Jens,

The dll load tool worked great with Matlab 6, that was not the problem.
The problem, as far as I can remember, was the uint64, Matlab6 handles those differently than Matlab 7.

Back then I tried weeks with 6.0 and all different kind of tricks of defining the integers, but nothing worked.
Till I gave up and upgraded to 7.0, then everything was a walk in the park.

Wendelin
0 Kudos
Message 25 of 106
(5,238 Views)
Hi Wendelin,

ah, now I remember! Yes, I never had to use those integers, so that's why I forgot.

Thanks for the wake-up call! 🙂
Jens

0 Kudos
Message 26 of 106
(5,257 Views)

I can confirm that Matlab and Data Acquisition Toolbox work with M-series cards ... I used Matlab last week with my USB-6009.   Here is Matlab's web page describing its support for NI-daqmx and M-series:

www.mathworks.com/products/daq/supportedio5871.html

This page also provides a downloadable code example for using Matlab with M-series hardware to acquire some data:

www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=12052

Like Jens said, unless you need something not provided, just use Matlab and Data Acquisition Toolbox with your M-series hardware. 

Tom

P.S. I also don't use the integers you mentioned.

0 Kudos
Message 27 of 106
(5,140 Views)
Hallo
we have question about Konfiruration of FPGA from Simulink/Labview , and now I return again on my request concerning SIT and Simulink. The new requirement is, it possible to write the values of configuration for SIT of the Connection manager from Simulink ?. If not, would be the second variant ,whether it possible  to start Labview the program and SIT connection managers from Simulink/Matlab. I thank you much for your support .
 
Befaiz
 
Powertrain Mechatronik Application/
simulation/test MS-T2
0 Kudos
Message 28 of 106
(5,098 Views)
Hi,

I'm very new to the NI cards (and to this forum) and I want to use a PCI-6221 with matlab 2006. I found many simulink blocks with NI names (PCI-6031E, PCI-6503,...). Do you use such blocks to control M-series cards? is there a block for the 6221 that we can download, or a block already in simulink that works? These blocks are located in the xPC Target/Digital input/NI Simulink library.

I dont have the Data Acquisition Toolbox 2.9.

Thank you very much!

Marc
0 Kudos
Message 29 of 106
(5,085 Views)
Hi Marc!
Mathwork's xPC Target Toolbox does not (yet?) support the newer M-series cards.
http://www.mathworks.com/products/xpctarget/supportedio5791.html#PCI
Furthermore, xPC is aimed at real time applications, which probably isn't what you want? You can probably use xPC for data aquisition as a work-around, but that point is mute as it does not support your cards anyway.
So, besides buying the new Data Acquisition Toolbox,
http://www.mathworks.com/products/supportedio.html?prodCode=DA your only(?)
option is using my code which is available here: http://www.jr-worldwi.de/work/matlab/index.html and also has been used/improved for a Matlab Central submission by Andreas, also a contributor here. http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=6970&objectType=file
It takes a bit of time digging through the process, but once done, it works nicely.


Best of luck
Jens
0 Kudos
Message 30 of 106
(5,075 Views)