Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

a problem with NI 6024e in simulink model

Hallo everyone,
I have a problem by using the card NI DAQ 6024E in simulink model.
I have built a model in simulink. In this model there are 2 analog input blocks and 1 analog output block of the "data aquisition toolbox". The problem is, everytime when I want to get the signals from one card, there is error.
For example, I want to use the same card to get 1 analog input signal and send 1 analog output signal, the error is:
 
                     NI-DAQ: No DMA channel is available for use.
 
if I use the same card to get 2 analog input signals, the error is:
 
                     Could not create an analog input subsystem.
                     Error using ==> analoginput.analoginput
                     Error using ==> analoginput.analoginput>localCreateAnalogInputObject
                     The device id is invalid or the device is in use.
 
It seems that I can only use 1 card to manipulate one input or one output signal, I can not use 1 card to manipulate ´more than one signalsource. That is certainly not correct. But I don't know how to solve this problem.
 
Can anyone give me some tipps?
 
Thanks a lot!
0 Kudos
Message 1 of 7
(4,128 Views)
No one has any idea about this problem?
0 Kudos
Message 2 of 7
(4,126 Views)

The card you are using has only one A/D converter. All Analog input channels are multiplexed to one A/D converter, so you can not have two subsystems trying to acquire data at the same time. Use one subsystem to acquire ALL neccessary channels at one time, and seperate the data in software afterwards.

 

Message 3 of 7
(4,104 Views)

Hallo Andreas(do you named Andreas?), thank you for your reply. But because I am not so familiar with the NI, so would you like to give me one example about how to use one subsystem to acquire ALL neccessary channels at one time, and seperate the data in software afterwards. Or give me some more tipps?

Thank you very much!

0 Kudos
Message 4 of 7
(4,096 Views)

It is impossible for me to post an example, as I don´t have simulink. I only can tell you that the board you are using can not have two processes (two threads in C, or two applications) access the analog inputs AT THE SAME TIME, so you alway can have only one process accesssing the analog inputs of your hardware. If you have some kind of blocks in simulink to access the hardware, use one block to acquire all data, not two or more blocks where each block acquires data from one channel.

You can separate the data the single block acquires after that, to process the data in parallel afterwards.

 

Hope this helps!

André 😉

 

Message 5 of 7
(4,094 Views)
Hallo, Andre, thank you very much! I have solved the problem at least half. That is, I use only one analog input block to get 2 analog input signals, then demux the signals into 2 parts, and it works well. because I have 2 cards, so I use the other one for the only one analog output signal. but is it possible, that all the analog input signal and analog output signal use one card? but in simulink analog input signal and analog output signal use different blocks. they can not use one block. do you have any idea?
0 Kudos
Message 6 of 7
(4,079 Views)

I guess you get the error you posted in your first post (no DMA...) if you rty to use both analog input and output on one card.

First, the 6024E has only one DMA-channel, so the error makes sence in a way: the single available DMA-channel si used by the analog input block, so there is no DMA channel available for the anaolog output block.

In general the driver should automatically use the interrupt mode, so yews, in general it is possible to use both anaolg input and analog output on one card at the same time. This works fine in the environments I use (LabVIEW, CVI, C++, .NET etc.)

is there a way to configure the data acquisition in simulink in more dtail (for example, define which transfer mechanism (DMA or Interrupt) is used etc.? You should investigate the options of your blocks in siulink with which you acquire/gernerate your data, to see if you could specifiy the apropriate settings there somehow.

Hope this helps!

 

André

 

 

0 Kudos
Message 7 of 7
(4,051 Views)