Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading and writing problema with daqmxbase

Hi. I need help for a big problem I have using the National 6501 card and DAQmxbase driver ver. 2.1 (the more recent version a found). I'm using the function in Delphi language.on Windows XP. My application needs read inputs with a timer component at 300 msec rate and write outputs when the operator press some buttons. The system crashs when I try to write !!!. I used semaphores, mutex and any other software implementation but when the application try to write, 7 times of 10 the system crash and does not respond (is necessary to kill the process). It seems that the call to the write function does not return any more  OR the function DAQmxisTaskDone does not finish any more!.  Anyone can helpme or tell me something about reading and writing problems when is necessary to have significants rates  ?   Thank you
0 Kudos
Message 1 of 5
(3,480 Views)

Greetings,

 

It looks like you should be good to go with the DAQmx Base version 2.1. Now, you mentioned that 7 out of 10 times the system crashes. Is this consistent? What if you lower the sampling rate? Does it still crash when you write? It almost sounds like your processor is starving for threads and when you ask for more (request keyboard interrupt to write), it is crashing the system. How often do you call the write function? What if you call the write function immediately?

 

Maybe these questions can help me better understand your system.

 

Let me know any progress!

 

Regards,

Jordan Randall
National Instruments Italy
0 Kudos
Message 2 of 5
(3,443 Views)
 

Hi Guillermo-

Since you're using Windows XP, you should use NI-DAQmx rather than NI-DAQmx Base.  It sounds like you may be running into the single thread access requirement of NI-DAQmx Base (which is not a problem for NI-DAQmx).  I would suggest that you upgrade to NI-DAQmx and reference the material in this KB to get up and running.

Hopefully this helps-

Tom W
National Instruments
0 Kudos
Message 3 of 5
(3,425 Views)
Hi there;

I am trying to use Delphi 7 with NI USB-6008. I have tried the wrapper which is provided in the link below. But unfortunately it looks like there is something wrong with the wrapper files. There are identifiers as "<not supported>". I changed all of these identifiers to longint but this time I kept getting Access violation errors. My code is as simple as follows:

procedure TForm1.Timer1Timer(Sender: TObject);
var
taskHandle: longint;

begin
   try
      DAQmxCreateTask('t',taskHandle);
   except
      showmessage('Nao deu certo!');
   end;
end;

The KB I used is:

http://digital.ni.com/public.nsf/websearch/A6715AA42405ACD786256F0A00633B8F?OpenDocument
0 Kudos
Message 4 of 5
(3,379 Views)
hi !   many thanks to all for the responses. The problem becomes in this scenery: one TTimer class at 300 msec rate that reads inputs. in the main thread. If I try to write (always in the same thread) when it's reading,  the program blocks its operation because the write function does not return anymore !  I used semaphores in order to avoid collitions but is just impossible get a fine control flow because, sometimes, crash also. I think that DAQmxBase library is a very poor library  for low performance applications and  for this reasons now, I'm working  with another card  (no National) with libraries more robust and powerfull. Thank you anyway for all responses.
Guillermo.
 
0 Kudos
Message 5 of 5
(3,358 Views)